import * as request from 'request-promise' import * as config from 'config' export class TWSCore { private token: string constructor (token: string, cookies) { this.token = token } getScenariofieldConfigById(_id: string) { return request.get(`${config.TWS.CORE.URL}/v2/scenariofieldconfigs/${_id}`, { headers: { Authorization: `Bearer ${this.token}` }, strictSSL: false, json: true }) } getCustomfieldById(_customfieldId: string) { return request.get(`${config.TWS.CORE.URL}/v2/customfields/${_customfieldId}`, { headers: { Authorization: `Bearer ${this.token}` }, strictSSL: false, json: true }) } getTasklistById (_tasklistId: string) { return request.get(`${config.TWS.CORE.URL}/v2/tasklists/${_tasklistId}`, { headers: { strictSSL: false, Authorization: `Bearer ${this.token}` }, json: true }) } }