Skip to content

Commit

Permalink
feat: make the client take in options
Browse files Browse the repository at this point in the history
  • Loading branch information
thislooksfun committed Mar 11, 2021
1 parent 4628499 commit 79875ab
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
import type { Credentials } from "./helper/api/creds";

export interface UsernameAuth {
username: string;
password: string;
}
export interface TokenAuth {
refreshToken: string;
}
export type Auth = UsernameAuth | TokenAuth;

export interface ClientOptions {
auth?: Auth;
creds?: Credentials;
userAgent: string;
}

export default class Client {
protected auth?: Auth;
protected creds?: Credentials;
protected userAgent: string;

constructor(opts: ClientOptions) {
this.auth = opts.auth;
this.creds = opts.creds;
this.userAgent = opts.userAgent;
}
}

0 comments on commit 79875ab

Please sign in to comment.