@miguel-cagide/smb2
Version:
A SMB2 implementation in TypeScript
35 lines (34 loc) • 1.36 kB
TypeScript
/// <reference types="node" />
import Tree from "./Tree";
import Client from "./Client";
import { EventEmitter } from "events";
import Header from "../protocol/smb2/Header";
export interface AuthenticateOptions {
domain: string;
username: string;
password: string;
/** When true the client will require signing. Defaults to false (signing enabled but not required). */
signingRequired?: boolean;
}
interface Session {
on(event: "authenticate" | "logoff", callback: (session: Session) => void): this;
once(event: "authenticate" | "logoff", callback: (session: Session) => void): this;
}
declare class Session extends EventEmitter {
client: Client;
_id: string;
authenticated: boolean;
/** The negotiated session signing key (NTLM User Session Key). */
signingKey: Buffer | null;
/** Whether message signing is active for this session. */
signingActive: boolean;
connectedTrees: Tree[];
constructor(client: Client);
connectTree(path: string): Promise<Tree>;
createRequest(header?: Header, body?: any): import("../protocol/smb2/Request").default;
request(header?: Header, body?: any): Promise<import("../protocol/smb2/Response").default>;
authenticate(options: AuthenticateOptions): Promise<void>;
private registerTree;
logoff(): Promise<void>;
}
export default Session;