electerm-sync
Version:
electerm sync API wrapper.
34 lines (33 loc) • 1.06 kB
TypeScript
import { type AxiosInstance } from 'axios';
import { type Algorithm } from 'jsonwebtoken';
import { type Config } from './types';
export declare class HTTPError extends Error {
status: number;
statusText: string;
data: Object;
config: Config;
constructor(status: number, statusText: string, data: Object, config: Config);
}
declare class ElectermSync {
algorithm: Algorithm;
token: string;
server: string;
userId: string;
_axios: AxiosInstance;
userAgentHeader: string;
constructor(str: string, userAgentHeader?: string);
request(config: Config): Promise<any>;
create(data: Object, conf: Config): Promise<any>;
update(userId: string, data: Object, conf: Config): Promise<any>;
getOne(userId: string, conf: Config): Promise<any>;
test(conf: Config): Promise<any>;
_patchHeaders(headers?: Config): {
'X-User-Agent': string;
Authorization: string;
'Content-Type': string;
};
_authHeader(): {
Authorization: string;
};
}
export default ElectermSync;