javascript-ampache
Version:
A JS library for the Ampache API
57 lines (56 loc) • 2.12 kB
TypeScript
import { Base, Success } from "../base";
import { AuthResponse } from "./types";
export declare class Auth extends Base {
/**
* Handles verifying a new handshake
* @remarks MINIMUM_API_VERSION=380001
* @param params.auth encrypted apikey OR password if using password auth
* @param [params.user] username
* @param [params.timestamp] UNIXTIME()
* @param [params.version] version of Ampache API to establish connection with
* @see {@link https://ampache.org/api/api-json-methods#handshake}
*/
handshake(params: {
auth: string;
user?: string;
timestamp?: number;
version?: string;
}): Promise<AuthResponse>;
/**
* This can be called without being authenticated, it is useful for determining if what the status
* of the server is, and what version it is running/compatible with
* @remarks MINIMUM_API_VERSION=380001
* @param [params.auth] (Session ID) returns version information and extends the session if passed
* @param [params.version] API Version that the application understands
* @see {@link https://ampache.org/api/api-json-methods#ping}
*/
ping(params?: {
auth?: string;
version?: string;
}): Promise<AuthResponse>;
/**
* Destroy a session using the session auth parameter
* @remarks MINIMUM_API_VERSION=400001
* @param params.auth Session ID to destroy
* @see {@link https://ampache.org/api/api-json-methods#goodbye}
*/
goodbye(params: {
auth: string;
}): Promise<Success>;
/**
* Email a new password to the user (if allowed) using a reset token.
* @remarks MINIMUM_API_VERSION=6.1.0
* @param params.auth Password reset token
* @see {@link https://ampache.org/api/api-json-methods#lost_password}
*/
lostPassword(params: {
auth: string;
}): Promise<Success>;
/**
* Encrypt your password into the accepted format.
*/
encryptPassword(params: {
password: string;
time: number;
}): string;
}