dispatch-node-sdk
Advanced tools
Comparing version
@@ -69,2 +69,6 @@ 'use strict'; | ||
var _survey = require('./entities/survey'); | ||
var _survey2 = _interopRequireDefault(_survey); | ||
var _user = require('./entities/user'); | ||
@@ -115,2 +119,3 @@ | ||
organizations: new _Collection2.default(this, endpoints.ORGANIZATIONS), | ||
survey: (0, _survey2.default)(this), | ||
user: (0, _user2.default)(this), | ||
@@ -335,2 +340,22 @@ users: new _Collection2.default(this, endpoints.USERS) | ||
/** | ||
* Creates a new user and organization using the signup endpoint. | ||
* | ||
* DISP-4285: Add error processing for showing tooltips on frontend | ||
* | ||
* @param {Object} userInfo User data | ||
* @param {Object} organizationInfo Organization data | ||
*/ | ||
}, { | ||
key: 'signUp', | ||
value: function signUp(userInfo, organizationInfo) { | ||
return this.getAppClient().then(function (client) { | ||
return client.post('/v1/signup', { | ||
user: userInfo, | ||
organization: organizationInfo | ||
}); | ||
}); | ||
} | ||
/** | ||
* Log the user in with their phone number and verification code | ||
@@ -412,3 +437,2 @@ * | ||
} | ||
return this.doAuthenticatedRequest('GET', fullPath).then(function (response) { | ||
@@ -415,0 +439,0 @@ if (opts.raw === true) { |
@@ -18,3 +18,4 @@ 'use strict'; | ||
var ORGANIZATIONS = exports.ORGANIZATIONS = '/v1/organizations'; | ||
var PUBLIC_SURVEY_RESPONSES = exports.PUBLIC_SURVEY_RESPONSES = '/v1/public/survey_responses'; | ||
var SURVEY_RESPONSES = exports.SURVEY_RESPONSES = '/v1/survey_responses'; | ||
var USERS = exports.USERS = '/v1/users'; |
@@ -17,2 +17,40 @@ 'use strict'; | ||
}); | ||
}, | ||
/** | ||
* Returns photos for a customer | ||
* @return {Promise} API call | ||
*/ | ||
getPhotos: function getPhotos() { | ||
var query = { | ||
filter: { | ||
customer_id_eq: id, | ||
file_token_not_eq: 'null' | ||
} | ||
}; | ||
return client.getCollection(_endpoints.ATTACHMENTS, query); | ||
}, | ||
/** | ||
* Returns notes for a customer | ||
* @return {Promise} API call | ||
*/ | ||
getNotes: function getNotes() { | ||
var query = { | ||
filter: { | ||
customer_id_eq: id, | ||
file_token_null: '1' | ||
} | ||
}; | ||
return client.getCollection(_endpoints.ATTACHMENTS, query); | ||
}, | ||
/** | ||
* Returns all attachments for a customer | ||
* @return {Promise} API call | ||
*/ | ||
getAttachments: function getAttachments() { | ||
var query = { | ||
filter: { | ||
customer_id_eq: id | ||
} | ||
}; | ||
return client.getCollection(_endpoints.ATTACHMENTS, query); | ||
} | ||
@@ -19,0 +57,0 @@ }; |
@@ -120,2 +120,24 @@ 'use strict'; | ||
}); | ||
}, | ||
getSurveys: function getSurveys() { | ||
var query = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
var DEFAULT_QUERY = { | ||
job_id_eq: id | ||
}; | ||
if (query.filter) { | ||
query.filter = Object.assign({}, query.filter, DEFAULT_QUERY); | ||
} else { | ||
query.filter = DEFAULT_QUERY; | ||
} | ||
return client.getCollection(endpoints.SURVEY_RESPONSES, query); | ||
}, | ||
update: function update(jobProperties) { | ||
return client.doAuthenticatedRequest('PATCH', endpoints.JOBS + '/' + id, jobProperties).then(function (response) { | ||
return response.job; | ||
}); | ||
} | ||
@@ -122,0 +144,0 @@ }; |
{ | ||
"name": "dispatch-node-sdk", | ||
"version": "0.0.41", | ||
"version": "0.0.42", | ||
"description": "High- and low-level libraries for interacting with the Dispatch API", | ||
@@ -5,0 +5,0 @@ "main": "dist/lib/index.js", |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
181318
1.82%60
1.69%4702
2.15%