@smarterservices/sp-public-client
Advanced tools
Comparing version 0.1.11 to 0.1.12
928
index.js
@@ -66,13 +66,10 @@ /*jshint -W069 */ | ||
/** | ||
* Sign an agreement | ||
* Join an existing session and get permissions | ||
* @method | ||
* @name Client#signAgreements | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {string} agreementId - | ||
* @param {string} versionId - | ||
* @name Client#joinSession | ||
* @param {string} sessionId - Access Key | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.signAgreements = function(parameters) { | ||
Client.prototype.joinSession = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -84,3 +81,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/agreements/{agreement_id}/versions/{version_id}/sign'; | ||
var path = '/v1/sessions/{session_id}/join'; | ||
@@ -92,11 +89,2 @@ var body; | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
@@ -109,16 +97,2 @@ | ||
path = path.replace('{agreement_id}', parameters['agreementId']); | ||
if (parameters['agreementId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: agreementId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{version_id}', parameters['versionId']); | ||
if (parameters['versionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: versionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
@@ -141,10 +115,11 @@ body = parameters['body']; | ||
/** | ||
* Join an existing session and get permissions | ||
* Get history of current session | ||
* @method | ||
* @name Client#joinSession | ||
* @param {string} sessionId - Access Key | ||
* @param {} body - | ||
* @name Client#getAgreementHistory | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {string} agreementId - | ||
* | ||
*/ | ||
Client.prototype.joinSession = function(parameters) { | ||
Client.prototype.getAgreementHistory = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -156,3 +131,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/join'; | ||
var path = '/v1/sessions/{session_id}/agreements/{agreement_id}/history'; | ||
@@ -164,2 +139,11 @@ var body; | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
@@ -172,4 +156,7 @@ | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
path = path.replace('{agreement_id}', parameters['agreementId']); | ||
if (parameters['agreementId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: agreementId')); | ||
return deferred.promise; | ||
} | ||
@@ -185,3 +172,3 @@ | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -191,11 +178,11 @@ return deferred.promise; | ||
/** | ||
* Get agreements to sign | ||
* Get session details for a given exam | ||
* @method | ||
* @name Client#getAgreements | ||
* @name Client#getSession | ||
* @param {string} token - | ||
* @param {string} examId - | ||
* @param {string} sessionId - | ||
* @param {string} locationId - | ||
* | ||
*/ | ||
Client.prototype.getAgreements = function(parameters) { | ||
Client.prototype.getSession = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -207,3 +194,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/agreements/location/{location_id}'; | ||
var path = '/v1/exams/{exam_id}/sessions/{session_id}'; | ||
@@ -224,13 +211,13 @@ var body; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{location_id}', parameters['locationId']); | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['locationId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: locationId')); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
@@ -252,11 +239,8 @@ } | ||
/** | ||
* This endpoint is used to get an image list for an user | ||
* Used to make sure that the api is current only | ||
* @method | ||
* @name Client#listImages | ||
* @param {string} sessionId - | ||
* @param {string} clientId - | ||
* @param {string} type - | ||
* @name Client#health | ||
* | ||
*/ | ||
Client.prototype.listImages = function(parameters) { | ||
Client.prototype.health = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -268,3 +252,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/images'; | ||
var path = '/v1'; | ||
@@ -276,22 +260,2 @@ var body; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['clientId'] !== undefined) { | ||
queryParameters['client_id'] = parameters['clientId']; | ||
} | ||
if (parameters['clientId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: clientId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['type'] !== undefined) { | ||
queryParameters['type'] = parameters['type']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -310,11 +274,10 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* This endpoint is used to upload images for a user | ||
* Get all the incident types | ||
* @method | ||
* @name Client#uploadImage | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* @name Client#getIncidentTypes | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* | ||
*/ | ||
Client.prototype.uploadImage = function(parameters) { | ||
Client.prototype.getIncidentTypes = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -326,3 +289,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/images'; | ||
var path = '/v1/incidents/types'; | ||
@@ -334,22 +297,10 @@ var body; | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
} | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
return deferred.promise; | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -363,3 +314,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -369,9 +320,11 @@ return deferred.promise; | ||
/** | ||
* Used to login and authenticate proctors | ||
* List incidents for a given session | ||
* @method | ||
* @name Client#proctorLogin | ||
* @param {} body - | ||
* @name Client#listIncidents | ||
* @param {string} sessionId - | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* | ||
*/ | ||
Client.prototype.proctorLogin = function(parameters) { | ||
Client.prototype.listIncidents = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -383,3 +336,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/proctors/login'; | ||
var path = '/v1/sessions/{session_id}/incidents'; | ||
@@ -391,6 +344,17 @@ var body; | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
} | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -404,3 +368,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -410,11 +374,10 @@ return deferred.promise; | ||
/** | ||
* Get history of current session | ||
* Creates an incident for a given session | ||
* @method | ||
* @name Client#getAgreementHistory | ||
* @param {string} token - | ||
* @name Client#createIncident | ||
* @param {string} sessionId - | ||
* @param {string} agreementId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.getAgreementHistory = function(parameters) { | ||
Client.prototype.createIncident = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -426,3 +389,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/agreements/{agreement_id}/history'; | ||
var path = '/v1/sessions/{session_id}/incidents'; | ||
@@ -434,11 +397,2 @@ var body; | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
@@ -451,7 +405,4 @@ | ||
path = path.replace('{agreement_id}', parameters['agreementId']); | ||
if (parameters['agreementId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: agreementId')); | ||
return deferred.promise; | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
@@ -467,3 +418,3 @@ | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -473,9 +424,10 @@ return deferred.promise; | ||
/** | ||
* List sessions for a given exam | ||
* Cancel session for a given exam | ||
* @method | ||
* @name Client#listSessions | ||
* @name Client#cancelSession | ||
* @param {string} examId - | ||
* @param {string} sessionId - | ||
* | ||
*/ | ||
Client.prototype.listSessions = function(parameters) { | ||
Client.prototype.cancelSession = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -487,3 +439,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/exams/{exam_id}/sessions'; | ||
var path = '/v1/exams/{exam_id}/sessions/{session_id}/cancel'; | ||
@@ -502,2 +454,9 @@ var body; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -511,3 +470,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -517,11 +476,10 @@ return deferred.promise; | ||
/** | ||
* Will return start and end time for a users media | ||
* Start a new session and create permissions | ||
* @method | ||
* @name Client#videoSetup | ||
* @param {string} token - | ||
* @param {string} userId - | ||
* @name Client#startSession | ||
* @param {string} sessionId - Access Key | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.videoSetup = function(parameters) { | ||
Client.prototype.startSession = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -533,3 +491,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/{userId}/videoSetup'; | ||
var path = '/v1/sessions/{session_id}/start'; | ||
@@ -541,18 +499,9 @@ var body; | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{userId}', parameters['userId']); | ||
if (parameters['userId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: userId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
@@ -575,11 +524,10 @@ body = parameters['body']; | ||
/** | ||
* Get exam details | ||
* Gets the zookeeper session history | ||
* @method | ||
* @name Client#getExam | ||
* @param {string} courseId - | ||
* @param {string} examId - | ||
* @param {string} enrollmentId - | ||
* @name Client#getProcesses | ||
* @param {string} sessionId - | ||
* @param {string} zookeeperId - | ||
* | ||
*/ | ||
Client.prototype.getExam = function(parameters) { | ||
Client.prototype.getProcesses = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -591,3 +539,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/courses/{course_id}/exams/{exam_id}'; | ||
var path = '/v1/sessions/{session_id}/processes'; | ||
@@ -599,22 +547,15 @@ var body; | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['courseId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: courseId')); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
return deferred.promise; | ||
if (parameters['zookeeperId'] !== undefined) { | ||
queryParameters['zookeeper_id'] = parameters['zookeeperId']; | ||
} | ||
if (parameters['enrollmentId'] !== undefined) { | ||
queryParameters['enrollment_id'] = parameters['enrollmentId']; | ||
} | ||
if (parameters['enrollmentId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: enrollmentId')); | ||
if (parameters['zookeeperId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: zookeeperId')); | ||
return deferred.promise; | ||
@@ -636,9 +577,10 @@ } | ||
/** | ||
* List all exams for a course | ||
* Updates the session with the current running processes | ||
* @method | ||
* @name Client#listExams | ||
* @param {string} courseId - | ||
* @name Client#sessionProcesses | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.listExams = function(parameters) { | ||
Client.prototype.sessionProcesses = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -650,3 +592,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/courses/{course_id}/exams'; | ||
var path = '/v1/sessions/{session_id}/processes'; | ||
@@ -658,9 +600,13 @@ var body; | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['courseId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: courseId')); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -674,3 +620,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('PUT', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -680,10 +626,10 @@ return deferred.promise; | ||
/** | ||
* Cancel session for a given exam | ||
* Will return return details about a single course | ||
* @method | ||
* @name Client#cancelSession | ||
* @param {string} examId - | ||
* @param {string} sessionId - | ||
* @name Client#getCourse | ||
* @param {string} courseId - | ||
* @param {string} institutionId - | ||
* | ||
*/ | ||
Client.prototype.cancelSession = function(parameters) { | ||
Client.prototype.getCourse = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -695,3 +641,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/exams/{exam_id}/sessions/{session_id}/cancel'; | ||
var path = '/v1/institutions/{institution_id}/courses/{course_id}'; | ||
@@ -703,13 +649,13 @@ var body; | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
if (parameters['courseId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: courseId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
return deferred.promise; | ||
@@ -726,3 +672,3 @@ } | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -732,10 +678,8 @@ return deferred.promise; | ||
/** | ||
* Get instructor details | ||
* Will return a full list of all institutions | ||
* @method | ||
* @name Client#getInstructor | ||
* @param {string} courseId - | ||
* @param {string} instructorId - | ||
* @name Client#listInstitutions | ||
* | ||
*/ | ||
Client.prototype.getInstructor = function(parameters) { | ||
Client.prototype.listInstitutions = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -747,3 +691,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/courses/{course_id}/instructors/{instructor_id}'; | ||
var path = '/v1/institutions'; | ||
@@ -755,16 +699,2 @@ var body; | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
if (parameters['courseId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: courseId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{instructor_id}', parameters['instructorId']); | ||
if (parameters['instructorId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: instructorId')); | ||
return deferred.promise; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -783,9 +713,11 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* List students for a given exam | ||
* Get agreements to sign | ||
* @method | ||
* @name Client#listStudents | ||
* @param {string} examId - | ||
* @name Client#getAgreements | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {string} locationId - | ||
* | ||
*/ | ||
Client.prototype.listStudents = function(parameters) { | ||
Client.prototype.getAgreements = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -797,3 +729,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/exams/{exam_id}/students'; | ||
var path = '/v1/sessions/{session_id}/agreements/location/{location_id}'; | ||
@@ -805,9 +737,25 @@ var body; | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{location_id}', parameters['locationId']); | ||
if (parameters['locationId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: locationId')); | ||
return deferred.promise; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -826,9 +774,11 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* This endpoint is used to get an image list for an proctor | ||
* This endpoint is used to get an image list for an user | ||
* @method | ||
* @name Client#listProctorImages | ||
* @param {string} userId - | ||
* @name Client#listImages | ||
* @param {string} sessionId - | ||
* @param {string} clientId - | ||
* @param {string} type - | ||
* | ||
*/ | ||
Client.prototype.listProctorImages = function(parameters) { | ||
Client.prototype.listImages = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -840,3 +790,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/proctor/{user_id}/images'; | ||
var path = '/v1/sessions/{session_id}/images'; | ||
@@ -848,9 +798,22 @@ var body; | ||
path = path.replace('{user_id}', parameters['userId']); | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['userId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: userId')); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['clientId'] !== undefined) { | ||
queryParameters['client_id'] = parameters['clientId']; | ||
} | ||
if (parameters['clientId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: clientId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['type'] !== undefined) { | ||
queryParameters['type'] = parameters['type']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -869,10 +832,11 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* This endpoint is used to upload headshot for a proctor | ||
* This endpoint is used to upload images for a user | ||
* @method | ||
* @name Client#uploadProctorImage | ||
* @param {string} userId - | ||
* @name Client#uploadImage | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.uploadProctorImage = function(parameters) { | ||
Client.prototype.uploadImage = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -884,3 +848,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/proctor/{user_id}/images'; | ||
var path = '/v1/sessions/{session_id}/images'; | ||
@@ -892,9 +856,18 @@ var body; | ||
path = path.replace('{user_id}', parameters['userId']); | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
if (parameters['userId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: userId')); | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
@@ -917,10 +890,9 @@ body = parameters['body']; | ||
/** | ||
* Gets the zookeeper session history | ||
* Will return detailed information about an institution | ||
* @method | ||
* @name Client#getProcesses | ||
* @param {string} sessionId - | ||
* @param {string} zookeeperId - | ||
* @name Client#getInstitution | ||
* @param {string} institutionId - | ||
* | ||
*/ | ||
Client.prototype.getProcesses = function(parameters) { | ||
Client.prototype.getInstitution = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -932,3 +904,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/processes'; | ||
var path = '/v1/institutions/{institution_id}'; | ||
@@ -940,18 +912,9 @@ var body; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['zookeeperId'] !== undefined) { | ||
queryParameters['zookeeper_id'] = parameters['zookeeperId']; | ||
} | ||
if (parameters['zookeeperId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: zookeeperId')); | ||
return deferred.promise; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -970,10 +933,9 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Updates the session with the current running processes | ||
* List students for a given exam | ||
* @method | ||
* @name Client#sessionProcesses | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* @name Client#listStudents | ||
* @param {string} examId - | ||
* | ||
*/ | ||
Client.prototype.sessionProcesses = function(parameters) { | ||
Client.prototype.listStudents = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -985,3 +947,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/processes'; | ||
var path = '/v1/exams/{exam_id}/students'; | ||
@@ -993,13 +955,9 @@ var body; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1013,3 +971,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('PUT', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1019,10 +977,9 @@ return deferred.promise; | ||
/** | ||
* This endpoint is used to get playback tokens for a user | ||
* Will return return a list of courses for an institution | ||
* @method | ||
* @name Client#playbackToken | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* @name Client#listCourses | ||
* @param {string} institutionId - | ||
* | ||
*/ | ||
Client.prototype.playbackToken = function(parameters) { | ||
Client.prototype.listCourses = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1034,3 +991,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{sessionId}/playback/token'; | ||
var path = '/v1/institutions/{institution_id}/courses'; | ||
@@ -1042,13 +999,9 @@ var body; | ||
path = path.replace('{sessionId}', parameters['sessionId']); | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1062,3 +1015,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1123,11 +1076,11 @@ return deferred.promise; | ||
/** | ||
* Get session details for a given exam | ||
* Updates an incident for a given session | ||
* @method | ||
* @name Client#getSession | ||
* @param {string} token - | ||
* @param {string} examId - | ||
* @name Client#createIncident | ||
* @param {string} incidentNumber - | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.getSession = function(parameters) { | ||
Client.prototype.createIncident = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1139,3 +1092,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/exams/{exam_id}/sessions/{session_id}'; | ||
var path = '/v1/sessions/{session_id}/incidents/{incident_number}'; | ||
@@ -1147,18 +1100,9 @@ var body; | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
path = path.replace('{incident_number}', parameters['incidentNumber']); | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
if (parameters['incidentNumber'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: incidentNumber')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
@@ -1171,2 +1115,6 @@ | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1180,3 +1128,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('PUT', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1186,8 +1134,10 @@ return deferred.promise; | ||
/** | ||
* Get all corrective_action_types | ||
* delete incident for a given session | ||
* @method | ||
* @name Client#getCorrectiveActionTypes | ||
* @name Client#listIncidents | ||
* @param {string} sessionId - | ||
* @param {string} incidentNumber - | ||
* | ||
*/ | ||
Client.prototype.getCorrectiveActionTypes = function(parameters) { | ||
Client.prototype.listIncidents = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1199,3 +1149,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/incidents/corrective_action_types'; | ||
var path = '/v1/sessions/{session_id}/incidents/{incident_number}'; | ||
@@ -1207,2 +1157,16 @@ var body; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{incident_number}', parameters['incidentNumber']); | ||
if (parameters['incidentNumber'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: incidentNumber')); | ||
return deferred.promise; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1216,3 +1180,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('DELETE', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1222,10 +1186,13 @@ return deferred.promise; | ||
/** | ||
* Get all the incident types | ||
* Sign an agreement | ||
* @method | ||
* @name Client#getIncidentTypes | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* @name Client#signAgreements | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {string} agreementId - | ||
* @param {string} versionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.getIncidentTypes = function(parameters) { | ||
Client.prototype.signAgreements = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1237,3 +1204,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/incidents/types'; | ||
var path = '/v1/sessions/{session_id}/agreements/{agreement_id}/versions/{version_id}/sign'; | ||
@@ -1245,10 +1212,36 @@ var body; | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{agreement_id}', parameters['agreementId']); | ||
if (parameters['agreementId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: agreementId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{version_id}', parameters['versionId']); | ||
if (parameters['versionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: versionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1262,3 +1255,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1268,8 +1261,9 @@ return deferred.promise; | ||
/** | ||
* Used to make sure that the api is current only | ||
* Used to login and authenticate proctors | ||
* @method | ||
* @name Client#health | ||
* @name Client#proctorLogin | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.health = function(parameters) { | ||
Client.prototype.proctorLogin = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1281,3 +1275,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1'; | ||
var path = '/v1/proctors/login'; | ||
@@ -1289,2 +1283,6 @@ var body; | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1298,3 +1296,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1304,9 +1302,9 @@ return deferred.promise; | ||
/** | ||
* Will return detailed information about an institution | ||
* List all exams for a course | ||
* @method | ||
* @name Client#getInstitution | ||
* @param {string} institutionId - | ||
* @name Client#listExams | ||
* @param {string} courseId - | ||
* | ||
*/ | ||
Client.prototype.getInstitution = function(parameters) { | ||
Client.prototype.listExams = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1318,3 +1316,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions/{institution_id}'; | ||
var path = '/v1/courses/{course_id}/exams'; | ||
@@ -1326,6 +1324,6 @@ var body; | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
if (parameters['courseId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: courseId')); | ||
return deferred.promise; | ||
@@ -1347,11 +1345,10 @@ } | ||
/** | ||
* List all instructors for a course | ||
* Get instructor details | ||
* @method | ||
* @name Client#listInstructors | ||
* @name Client#getInstructor | ||
* @param {string} courseId - | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* @param {string} instructorId - | ||
* | ||
*/ | ||
Client.prototype.listInstructors = function(parameters) { | ||
Client.prototype.getInstructor = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1363,3 +1360,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/courses/{course_id}/instructors'; | ||
var path = '/v1/courses/{course_id}/instructors/{instructor_id}'; | ||
@@ -1378,8 +1375,7 @@ var body; | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
} | ||
path = path.replace('{instructor_id}', parameters['instructorId']); | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
if (parameters['instructorId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: instructorId')); | ||
return deferred.promise; | ||
} | ||
@@ -1400,10 +1396,10 @@ | ||
/** | ||
* Start a new session and create permissions | ||
* Get student details | ||
* @method | ||
* @name Client#startSession | ||
* @param {string} sessionId - Access Key | ||
* @param {} body - | ||
* @name Client#getStudent | ||
* @param {string} institutionId - | ||
* @param {string} studentId - | ||
* | ||
*/ | ||
Client.prototype.startSession = function(parameters) { | ||
Client.prototype.getStudent = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1415,3 +1411,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/start'; | ||
var path = '/v1/institutions/{institution_id}/students/{student_id}'; | ||
@@ -1423,11 +1419,14 @@ var body; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
path = path.replace('{student_id}', parameters['studentId']); | ||
if (parameters['studentId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: studentId')); | ||
return deferred.promise; | ||
} | ||
@@ -1443,3 +1442,3 @@ | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1449,10 +1448,11 @@ return deferred.promise; | ||
/** | ||
* Will return return details about a single course | ||
* Get exam details | ||
* @method | ||
* @name Client#getCourse | ||
* @name Client#getExam | ||
* @param {string} courseId - | ||
* @param {string} institutionId - | ||
* @param {string} examId - | ||
* @param {string} enrollmentId - | ||
* | ||
*/ | ||
Client.prototype.getCourse = function(parameters) { | ||
Client.prototype.getExam = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1464,3 +1464,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions/{institution_id}/courses/{course_id}'; | ||
var path = '/v1/courses/{course_id}/exams/{exam_id}'; | ||
@@ -1479,9 +1479,18 @@ var body; | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['enrollmentId'] !== undefined) { | ||
queryParameters['enrollment_id'] = parameters['enrollmentId']; | ||
} | ||
if (parameters['enrollmentId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: enrollmentId')); | ||
return deferred.promise; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1500,10 +1509,11 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Get student details | ||
* Will return start and end time for a users media | ||
* @method | ||
* @name Client#getStudent | ||
* @param {string} institutionId - | ||
* @param {string} studentId - | ||
* @name Client#videoSetup | ||
* @param {string} token - | ||
* @param {string} userId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.getStudent = function(parameters) { | ||
Client.prototype.videoSetup = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1515,3 +1525,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions/{institution_id}/students/{student_id}'; | ||
var path = '/v1/{userId}/videoSetup'; | ||
@@ -1523,16 +1533,22 @@ var body; | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{student_id}', parameters['studentId']); | ||
path = path.replace('{userId}', parameters['userId']); | ||
if (parameters['studentId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: studentId')); | ||
if (parameters['userId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: userId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1546,3 +1562,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1552,9 +1568,10 @@ return deferred.promise; | ||
/** | ||
* Will return return a list of courses for an institution | ||
* This endpoint is used to get playback tokens for a user | ||
* @method | ||
* @name Client#listCourses | ||
* @param {string} institutionId - | ||
* @name Client#playbackToken | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.listCourses = function(parameters) { | ||
Client.prototype.playbackToken = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1566,3 +1583,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions/{institution_id}/courses'; | ||
var path = '/v1/sessions/{sessionId}/playback/token'; | ||
@@ -1574,9 +1591,13 @@ var body; | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
path = path.replace('{sessionId}', parameters['sessionId']); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1590,3 +1611,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1596,11 +1617,8 @@ return deferred.promise; | ||
/** | ||
* List incidents for a given session | ||
* Get all corrective_action_types | ||
* @method | ||
* @name Client#listIncidents | ||
* @param {string} sessionId - | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* @name Client#getCorrectiveActionTypes | ||
* | ||
*/ | ||
Client.prototype.listIncidents = function(parameters) { | ||
Client.prototype.getCorrectiveActionTypes = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1612,3 +1630,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/incidents'; | ||
var path = '/v1/incidents/corrective_action_types'; | ||
@@ -1620,17 +1638,2 @@ var body; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
} | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1649,10 +1652,9 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Creates an incident for a given session | ||
* This endpoint is used to get an image list for an proctor | ||
* @method | ||
* @name Client#createIncident | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* @name Client#listProctorImages | ||
* @param {string} userId - | ||
* | ||
*/ | ||
Client.prototype.createIncident = function(parameters) { | ||
Client.prototype.listProctorImages = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1664,3 +1666,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/incidents'; | ||
var path = '/v1/proctor/{user_id}/images'; | ||
@@ -1672,13 +1674,9 @@ var body; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
path = path.replace('{user_id}', parameters['userId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
if (parameters['userId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: userId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1692,3 +1690,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1698,8 +1696,10 @@ return deferred.promise; | ||
/** | ||
* Will return a full list of all institutions | ||
* This endpoint is used to upload headshot for a proctor | ||
* @method | ||
* @name Client#listInstitutions | ||
* @name Client#uploadProctorImage | ||
* @param {string} userId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.listInstitutions = function(parameters) { | ||
Client.prototype.uploadProctorImage = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1711,3 +1711,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions'; | ||
var path = '/v1/proctor/{user_id}/images'; | ||
@@ -1719,2 +1719,13 @@ var body; | ||
path = path.replace('{user_id}', parameters['userId']); | ||
if (parameters['userId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: userId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1728,3 +1739,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1782,11 +1793,11 @@ return deferred.promise; | ||
/** | ||
* Updates an incident for a given session | ||
* List all instructors for a course | ||
* @method | ||
* @name Client#createIncident | ||
* @param {string} incidentNumber - | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* @name Client#listInstructors | ||
* @param {string} courseId - | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* | ||
*/ | ||
Client.prototype.createIncident = function(parameters) { | ||
Client.prototype.listInstructors = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1798,3 +1809,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/incidents/{incident_number}'; | ||
var path = '/v1/courses/{course_id}/instructors'; | ||
@@ -1806,18 +1817,15 @@ var body; | ||
path = path.replace('{incident_number}', parameters['incidentNumber']); | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
if (parameters['incidentNumber'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: incidentNumber')); | ||
if (parameters['courseId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: courseId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
} | ||
@@ -1833,3 +1841,3 @@ | ||
this.request('PUT', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1839,10 +1847,9 @@ return deferred.promise; | ||
/** | ||
* delete incident for a given session | ||
* List sessions for a given exam | ||
* @method | ||
* @name Client#listIncidents | ||
* @param {string} sessionId - | ||
* @param {string} incidentNumber - | ||
* @name Client#listSessions | ||
* @param {string} examId - | ||
* | ||
*/ | ||
Client.prototype.listIncidents = function(parameters) { | ||
Client.prototype.listSessions = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1854,3 +1861,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/incidents/{incident_number}'; | ||
var path = '/v1/exams/{exam_id}/sessions'; | ||
@@ -1862,16 +1869,9 @@ var body; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{incident_number}', parameters['incidentNumber']); | ||
if (parameters['incidentNumber'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: incidentNumber')); | ||
return deferred.promise; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1885,3 +1885,3 @@ Object.keys(parameters.$queryParameters) | ||
this.request('DELETE', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1888,0 +1888,0 @@ return deferred.promise; |
@@ -1,1 +0,1 @@ | ||
{"name":"@smarterservices/sp-public-client","version":"0.1.11","description":"the middle layer to microservice architecture for SP that handles tasks like proxying to backend api's,formatting responces,checking permissions","main":"index.js","dependencies":{"q":"latest","request":"latest"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"jordan piepkow","license":null} | ||
{"name":"@smarterservices/sp-public-client","version":"0.1.12","description":"the middle layer to microservice architecture for SP that handles tasks like proxying to backend api's,formatting responces,checking permissions","main":"index.js","dependencies":{"q":"latest","request":"latest"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"jordan piepkow","license":null} |