Skip to content

Commit

Permalink
fixes merge fail
Browse files Browse the repository at this point in the history
  • Loading branch information
mathewmeconry committed May 28, 2019
1 parent f8fec72 commit 3567889
Showing 1 changed file with 15 additions and 48 deletions.
63 changes: 15 additions & 48 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,59 +1,24 @@
import Scopes from "./constants/Scopes";
import OAuth2, { AuthorizationResponse } from "./libs/OAuth2";
import Contacts from "./resources/Contacts";
import { ContactsStatic } from './interfaces/ContactsStatic';
import ContactTypes from './resources/ContactTypes';
import ContactSectors from './resources/ContactSectors';
import ContactGroups from './resources/ContactGroups';
import ContactRelations from './resources/ContactRelations';
import Expenses from './resources/Expenses'
import { ContactsStatic } from "./interfaces/ContactsStatic";
import ContactTypes from "./resources/ContactTypes";
import ContactSectors from "./resources/ContactSectors";
import ContactGroups from "./resources/ContactGroups";
import ContactRelations from "./resources/ContactRelations";
import Expenses from "./resources/Expenses";
import Bills from "./resources/Bills";
import Orders from './resources/Orders';
import request from 'request-promise-native'
import { CookieJar } from 'request';
import Orders from "./resources/Orders";
import request from "request-promise-native";
import { CookieJar } from "request";

export { ContactsStatic, Scopes };

export default class Bexio {
private clientId: string
private clientSecret: string
private redirectUri: string
private scopes: Array<Scopes>

private bexioAuth: OAuth2

// Resources
// Contacts
public contacts: Contacts
public contactTypes: ContactTypes
public contactSectors: ContactSectors
public contactGroups: ContactGroups
public contactRelations: ContactRelations

// Sales Order Management
public orders: Orders
public expenses: Expenses

constructor(clientId: string, clientSecret: string, redirectUri: string, scopes: Array<Scopes>) {
this.clientId = clientId
this.clientSecret = clientSecret
this.redirectUri = redirectUri
this.scopes = scopes

// add general scope to the request list
this.scopes.push(Scopes.GENERAL)

this.bexioAuth = new OAuth2(this.clientId, this.clientSecret, this.redirectUri, this.scopes)

// Init resources
this.contacts = new Contacts(this.bexioAuth)
this.contactTypes = new ContactTypes(this.bexioAuth)
this.contactSectors = new ContactSectors(this.bexioAuth)
this.contactGroups = new ContactGroups(this.bexioAuth)
this.contactRelations = new ContactRelations(this.bexioAuth)
this.orders = new Orders(this.bexioAuth)
this.expenses = new Expenses(this.bexioAuth)
}
private clientId: string;
private clientSecret: string;
private redirectUri: string;
private scopes: Array<Scopes>;

private bexioAuth: OAuth2;

Expand All @@ -67,6 +32,7 @@ export default class Bexio {

// Sales Order Management
public orders: Orders;
public expenses: Expenses;
public bills: Bills;

constructor(
Expand Down Expand Up @@ -97,6 +63,7 @@ export default class Bexio {
this.contactGroups = new ContactGroups(this.bexioAuth);
this.contactRelations = new ContactRelations(this.bexioAuth);
this.orders = new Orders(this.bexioAuth);
this.expenses = new Expenses(this.bexioAuth);
this.bills = new Bills(this.bexioAuth);
}

Expand Down

0 comments on commit 3567889

Please sign in to comment.