b0VIM 8.0I^Z T>ÛGdylanjhaveriDylans-MacBook-Pro.local~dylanjhaveri/code/drip-node/lib/client.jsutf-8 3210#"! Utpiad¢bióòÔ¢|hG+)(ÿÞª‰b7ê æ å Ê § ~ z y c J ( ý Ï ž l 4  ÿ û ú º € l  Î y u t Z   ý ï º £ � ƒ ^ X T S 5  öỚˆwfbaBìÆ¥“‚qml]Aò媤 Ÿ‰sBúôØš”�}{zb/ümodule.exports = Client} } return headers module.exports = Client} } return headers module.exports = Client} } return headers } headers['Authorization'] = `Bearer ${this.accessToken}` if (this.accessToken) { } 'Accept': '*/*' 'Content-Type': 'application/vnd.api+json', 'User-Agent': `Drip Node ${this.version}`, const headers = { requestHeaders () { } } return `https://${this.apiKey}:@api.getdrip.com/v2/` } else { // basic auth if no accessToken return 'https://api.getdrip.com/v2/' if (this.accessToken) { urlBase () { } }, callback) json: true body: data, url: this.urlBase() + url, headers: this.requestHeaders(), method: 'POST', return this.request({ log('attempting POST', url, data) post (url, data, callback) { } }, callback) json: true body: data, url: this.urlBase() + url, headers: this.requestHeaders(), method: 'GET', return this.request({ log('attempting GET', url, data) get (url, data, callback) { } } return requestPromise(options) } else { }).catch(cb) cb(null, resp) requestPromise(options).then(function (resp) { if (cb) { } delete options.body if (options.body && !Object.keys(options.body).length) { request (options, cb) { } this.trackEvents = this._resources.event.createBatch.bind(this._resources.event) this.trackEvent = this._resources.event.create.bind(this._resources.event) this.accounts = this._resources.account.list.bind(this._resources.account) _prepMethods () { // users of the client library will call these directly // these are the public methods available on the drip client. } } this._resources[resourceName] = resource // assign this instance to `this` client instance log('initializing resource:', resourceName) const resource = new resources[type](this) const resourceName = type.toLowerCase() // make an instance of each resource for (let type in resources) { this._resources = {} _prepResources () { } console.error('missing credentials') this.missingCredentials = true _missingCredentials () { } this._prepMethods() this._prepResources() this.version = VERSION this.accessToken = options.accessToken this.accountId = options.accountId this.apiKey = options.apiKey if (!options) return this._missingCredentials() log('initializing', options) constructor (options) {class Client {} Event: require('./event') Account: require('./account'),const resources = {const VERSION = require('../version')const requestPromise = require('request-promise')const log = require('../log')'use strict'