@vista.io/vista-api-client
Version:
NodeJS implementation of the Vista API.
28 lines (21 loc) • 725 B
text/typescript
import { HttpMethods, ApiResource } from '../ApiResource';
class Admin extends ApiResource {
getCompany = async () => {
return this.dispatch('/v1/accounts', HttpMethods.GET);
}
createBranch = async (branch: string) => {
return this.dispatch('/v1/companies/branches', HttpMethods.POST, {
branch: branch,
});
}
cloneBranch = async (branch: string, newBranch: string) => {
return this.dispatch('/v1/companies/branches', HttpMethods.POST, {
branch: branch,
new_branch: newBranch,
});
}
createReadTokens = async () => {
return this.dispatch('/v1/auth/readTokens', HttpMethods.GET);
}
}
export default Admin;