dispatch-node-sdk
Advanced tools
Comparing version 0.0.30 to 0.0.31
@@ -57,2 +57,10 @@ 'use strict'; | ||
var _customer = require('./entities/customer'); | ||
var _customer2 = _interopRequireDefault(_customer); | ||
var _organization = require('./entities/organization'); | ||
var _organization2 = _interopRequireDefault(_organization); | ||
var _configuration = require('./configuration'); | ||
@@ -91,13 +99,15 @@ | ||
this.entities = { | ||
job: (0, _job2.default)(this), | ||
accounts: new _Collection2.default(this, endpoints.ACCOUNTS), | ||
appointments: new _Collection2.default(this, endpoints.APPOINTMENTS), | ||
attachment: (0, _attachment2.default)(this), | ||
brands: new _Collection2.default(this, endpoints.BRANDS), | ||
customer: (0, _customer2.default)(this), | ||
customers: new _Collection2.default(this, endpoints.CUSTOMERS), | ||
hybridJobs: new _Collection2.default(this, endpoints.HYBRID_JOBS), | ||
job: (0, _job2.default)(this), | ||
jobOffers: new _Collection2.default(this, endpoints.JOB_OFFERS), | ||
jobs: new _Collection2.default(this, endpoints.JOBS), | ||
jobOffers: new _Collection2.default(this, endpoints.JOB_OFFERS), | ||
hybridJobs: new _Collection2.default(this, endpoints.HYBRID_JOBS), | ||
customers: new _Collection2.default(this, endpoints.CUSTOMERS), | ||
organization: (0, _organization2.default)(this), | ||
organizations: new _Collection2.default(this, endpoints.ORGANIZATIONS), | ||
appointments: new _Collection2.default(this, endpoints.APPOINTMENTS), | ||
users: new _Collection2.default(this, endpoints.USERS), | ||
accounts: new _Collection2.default(this, endpoints.ACCOUNTS) | ||
users: new _Collection2.default(this, endpoints.USERS) | ||
}; | ||
@@ -516,7 +526,3 @@ | ||
return this.doAuthenticatedRequest('POST', '/v1/datafiles', formData, Object.assign({ | ||
client: 'files-api', | ||
headers: { | ||
'Content-Type': undefined, | ||
Accept: undefined | ||
} | ||
client: 'files-api' | ||
}, options)); | ||
@@ -523,0 +529,0 @@ } |
@@ -15,6 +15,6 @@ 'use strict'; | ||
var HYBRID_JOBS = exports.HYBRID_JOBS = '/v1/hybrid_jobs'; | ||
var JOB_OFFERS = exports.JOB_OFFERS = '/v1/job_offers'; | ||
var JOBS = exports.JOBS = '/v1/jobs'; | ||
var JOB_OFFERS = exports.JOB_OFFERS = '/v1/job_offers'; | ||
var ORGANIZATIONS = exports.ORGANIZATIONS = '/v1/organizations'; | ||
var SURVEY_RESPONSES = exports.SURVEY_RESPONSES = '/v1/survey_responses'; | ||
var USERS = exports.USERS = '/v1/users'; |
@@ -130,6 +130,17 @@ 'use strict'; | ||
var headers = Object.assign({ | ||
// XXX - FormData is not available on the server so we must do a try catch. | ||
var appendHeaders = true; | ||
try { | ||
appendHeaders = !(body instanceof FormData); | ||
} catch (error) { | ||
appendHeaders = true; | ||
} | ||
// Unless the body is an instance of form data | ||
// include content-type and accpet in the headers. | ||
// The form data will add its own headers for this. | ||
var headers = appendHeaders ? Object.assign({ | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json' | ||
}, options.headers); | ||
}, options.headers) : options.headers; | ||
@@ -136,0 +147,0 @@ switch (this.authMode) { |
@@ -14,2 +14,4 @@ import _ from 'underscore'; | ||
import { dataURItoBlob } from './fileHelpers'; | ||
import customerMethods from './entities/customer'; | ||
import organizationMethods from './entities/organization'; | ||
import Configuration from './configuration'; | ||
@@ -35,13 +37,15 @@ | ||
this.entities = { | ||
job: jobMethods(this), | ||
accounts: new Collection(this, endpoints.ACCOUNTS), | ||
appointments: new Collection(this, endpoints.APPOINTMENTS), | ||
attachment: attachmentMethods(this), | ||
brands: new Collection(this, endpoints.BRANDS), | ||
customer: customerMethods(this), | ||
customers: new Collection(this, endpoints.CUSTOMERS), | ||
hybridJobs: new Collection(this, endpoints.HYBRID_JOBS), | ||
job: jobMethods(this), | ||
jobOffers: new Collection(this, endpoints.JOB_OFFERS), | ||
jobs: new Collection(this, endpoints.JOBS), | ||
jobOffers: new Collection(this, endpoints.JOB_OFFERS), | ||
hybridJobs: new Collection(this, endpoints.HYBRID_JOBS), | ||
customers: new Collection(this, endpoints.CUSTOMERS), | ||
organization: organizationMethods(this), | ||
organizations: new Collection(this, endpoints.ORGANIZATIONS), | ||
appointments: new Collection(this, endpoints.APPOINTMENTS), | ||
users: new Collection(this, endpoints.USERS), | ||
accounts: new Collection(this, endpoints.ACCOUNTS), | ||
}; | ||
@@ -270,3 +274,2 @@ | ||
return this.doAuthenticatedRequest('GET', fullPath).then(response => { | ||
@@ -370,6 +373,2 @@ if (opts.raw === true) { | ||
client: 'files-api', | ||
headers: { | ||
'Content-Type': undefined, | ||
Accept: undefined, | ||
}, | ||
}, options)); | ||
@@ -376,0 +375,0 @@ } |
@@ -10,7 +10,6 @@ export const ACCOUNTS = '/v1/accounts'; | ||
export const HYBRID_JOBS = '/v1/hybrid_jobs'; | ||
export const JOB_OFFERS = '/v1/job_offers'; | ||
export const JOBS = '/v1/jobs'; | ||
export const JOB_OFFERS = '/v1/job_offers'; | ||
export const ORGANIZATIONS = '/v1/organizations'; | ||
export const SURVEY_RESPONSES = '/v1/survey_responses'; | ||
export const USERS = '/v1/users'; | ||
@@ -90,6 +90,17 @@ import { ensure, oneOf } from 'simplecheck'; | ||
const headers = Object.assign({ | ||
// XXX - FormData is not available on the server so we must do a try catch. | ||
let appendHeaders = true; | ||
try { | ||
appendHeaders = !(body instanceof FormData); | ||
} catch (error) { | ||
appendHeaders = true; | ||
} | ||
// Unless the body is an instance of form data | ||
// include content-type and accpet in the headers. | ||
// The form data will add its own headers for this. | ||
const headers = appendHeaders ? Object.assign({ | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, options.headers); | ||
}, options.headers) : options.headers; | ||
@@ -96,0 +107,0 @@ switch (this.authMode) { |
{ | ||
"name": "dispatch-node-sdk", | ||
"version": "0.0.30", | ||
"version": "0.0.31", | ||
"description": "High- and low-level libraries for interacting with the Dispatch API", | ||
@@ -5,0 +5,0 @@ "main": "dist/lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
130588
51
3337
1