@smarterservices/sp-public-client
Advanced tools
Comparing version 0.0.98 to 0.0.99
936
index.js
@@ -66,10 +66,9 @@ /*jshint -W069 */ | ||
/** | ||
* Returns the media token needed for the client to connect to the session. | ||
* List sessions for a given exam | ||
* @method | ||
* @name Client#getMediaToken | ||
* @param {string} sessionId - | ||
* @param {string} clientId - | ||
* @name Client#listSessions | ||
* @param {string} examId - | ||
* | ||
*/ | ||
Client.prototype.getMediaToken = function(parameters) { | ||
Client.prototype.listSessions = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -81,3 +80,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/clients/{client_id}/mediatoken'; | ||
var path = '/v1/exams/{exam_id}/sessions'; | ||
@@ -89,16 +88,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('{client_id}', parameters['clientId']); | ||
if (parameters['clientId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: clientId')); | ||
return deferred.promise; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -117,9 +109,11 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* List all exams for a course | ||
* List all instructors for a course | ||
* @method | ||
* @name Client#listExams | ||
* @name Client#listInstructors | ||
* @param {string} courseId - | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* | ||
*/ | ||
Client.prototype.listExams = function(parameters) { | ||
Client.prototype.listInstructors = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -131,3 +125,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/courses/{course_id}/exams'; | ||
var path = '/v1/courses/{course_id}/instructors'; | ||
@@ -146,2 +140,10 @@ var body; | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
} | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -160,9 +162,11 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* List sessions for a given exam | ||
* Get agreements to sign | ||
* @method | ||
* @name Client#listSessions | ||
* @param {string} examId - | ||
* @name Client#getAgreements | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {string} locationId - | ||
* | ||
*/ | ||
Client.prototype.listSessions = function(parameters) { | ||
Client.prototype.getAgreements = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -174,3 +178,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/exams/{exam_id}/sessions'; | ||
var path = '/v1/sessions/{session_id}/agreements/location/{location_id}'; | ||
@@ -182,9 +186,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) { | ||
@@ -203,10 +223,9 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Get student details | ||
* List students for a given exam | ||
* @method | ||
* @name Client#getStudent | ||
* @param {string} institutionId - | ||
* @param {string} studentId - | ||
* @name Client#listStudents | ||
* @param {string} examId - | ||
* | ||
*/ | ||
Client.prototype.getStudent = function(parameters) { | ||
Client.prototype.listStudents = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -218,3 +237,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions/{institution_id}/students/{student_id}'; | ||
var path = '/v1/exams/{exam_id}/students'; | ||
@@ -226,16 +245,9 @@ 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; | ||
} | ||
path = path.replace('{student_id}', parameters['studentId']); | ||
if (parameters['studentId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: studentId')); | ||
return deferred.promise; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -254,11 +266,10 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Get history of current session | ||
* Join an existing session and get permissions | ||
* @method | ||
* @name Client#getAgreementHistory | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {string} agreementId - | ||
* @name Client#joinSession | ||
* @param {string} sessionId - Access Key | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.getAgreementHistory = function(parameters) { | ||
Client.prototype.joinSession = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -270,3 +281,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/agreements/{agreement_id}/history'; | ||
var path = '/v1/sessions/{session_id}/join'; | ||
@@ -278,11 +289,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']); | ||
@@ -295,7 +297,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']; | ||
} | ||
@@ -311,3 +310,3 @@ | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -317,5 +316,5 @@ return deferred.promise; | ||
/** | ||
* Will return start and end time for a users media | ||
* Will return an array of videos that contained signed urls and other metadata | ||
* @method | ||
* @name Client#videoSetup | ||
* @name Client#getVideos | ||
* @param {string} userId - | ||
@@ -325,3 +324,3 @@ * @param {} body - | ||
*/ | ||
Client.prototype.videoSetup = function(parameters) { | ||
Client.prototype.getVideos = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -333,3 +332,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/{userId}/videoSetup'; | ||
var path = '/v1/{userId}/videos'; | ||
@@ -365,11 +364,8 @@ var body; | ||
/** | ||
* List incidents for a given session | ||
* Will return a full list of all institutions | ||
* @method | ||
* @name Client#listIncidents | ||
* @param {string} sessionId - | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* @name Client#listInstitutions | ||
* | ||
*/ | ||
Client.prototype.listIncidents = function(parameters) { | ||
Client.prototype.listInstitutions = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -381,3 +377,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/incidents'; | ||
var path = '/v1/institutions'; | ||
@@ -389,17 +385,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) { | ||
@@ -418,10 +399,10 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Creates an incident for a given session | ||
* Start a new session and create permissions | ||
* @method | ||
* @name Client#createIncident | ||
* @param {string} sessionId - | ||
* @name Client#startSession | ||
* @param {string} sessionId - Access Key | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.createIncident = function(parameters) { | ||
Client.prototype.startSession = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -433,3 +414,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/incidents'; | ||
var path = '/v1/sessions/{session_id}/start'; | ||
@@ -465,11 +446,10 @@ var body; | ||
/** | ||
* Get agreements to sign | ||
* Cancel session for a given exam | ||
* @method | ||
* @name Client#getAgreements | ||
* @param {string} token - | ||
* @name Client#cancelSession | ||
* @param {string} examId - | ||
* @param {string} sessionId - | ||
* @param {string} locationId - | ||
* | ||
*/ | ||
Client.prototype.getAgreements = function(parameters) { | ||
Client.prototype.cancelSession = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -481,3 +461,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}/cancel'; | ||
@@ -489,8 +469,6 @@ var body; | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
return deferred.promise; | ||
@@ -506,9 +484,2 @@ } | ||
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) { | ||
@@ -522,3 +493,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); | ||
@@ -528,9 +499,11 @@ return deferred.promise; | ||
/** | ||
* Used to login and authenticate proctors | ||
* This endpoint is used to get an image list for an user | ||
* @method | ||
* @name Client#proctorLogin | ||
* @param {} body - | ||
* @name Client#listImages | ||
* @param {string} sessionId - | ||
* @param {string} clientId - | ||
* @param {string} type - | ||
* | ||
*/ | ||
Client.prototype.proctorLogin = function(parameters) { | ||
Client.prototype.listImages = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -542,3 +515,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/proctors/login'; | ||
var path = '/v1/sessions/{session_id}/images'; | ||
@@ -550,6 +523,22 @@ 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['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) { | ||
@@ -563,3 +552,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); | ||
@@ -569,10 +558,11 @@ return deferred.promise; | ||
/** | ||
* Cancel session for a given exam | ||
* This endpoint is used to upload images for a user | ||
* @method | ||
* @name Client#cancelSession | ||
* @param {string} examId - | ||
* @name Client#uploadImage | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.cancelSession = function(parameters) { | ||
Client.prototype.uploadImage = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -584,3 +574,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/exams/{exam_id}/sessions/{session_id}/cancel'; | ||
var path = '/v1/sessions/{session_id}/images'; | ||
@@ -592,6 +582,8 @@ 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; | ||
@@ -607,2 +599,6 @@ } | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -621,9 +617,11 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Will return detailed information about an institution | ||
* List incidents for a given session | ||
* @method | ||
* @name Client#getInstitution | ||
* @param {string} institutionId - | ||
* @name Client#listIncidents | ||
* @param {string} sessionId - | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* | ||
*/ | ||
Client.prototype.getInstitution = function(parameters) { | ||
Client.prototype.listIncidents = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -635,3 +633,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions/{institution_id}'; | ||
var path = '/v1/sessions/{session_id}/incidents'; | ||
@@ -643,9 +641,17 @@ var body; | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
path = path.replace('{session_id}', 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['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
} | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -664,11 +670,10 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Get session details for a given exam | ||
* Creates an incident for a given session | ||
* @method | ||
* @name Client#getSession | ||
* @param {string} token - | ||
* @param {string} examId - | ||
* @name Client#createIncident | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.getSession = function(parameters) { | ||
Client.prototype.createIncident = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -680,3 +685,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/exams/{exam_id}/sessions/{session_id}'; | ||
var path = '/v1/sessions/{session_id}/incidents'; | ||
@@ -688,18 +693,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('{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']); | ||
@@ -712,2 +701,6 @@ | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -721,3 +714,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); | ||
@@ -727,9 +720,10 @@ return deferred.promise; | ||
/** | ||
* This endpoint is used to get an image list for an proctor | ||
* Gets the zookeeper session history | ||
* @method | ||
* @name Client#listProctorImages | ||
* @param {string} userId - | ||
* @name Client#getProcesses | ||
* @param {string} sessionId - | ||
* @param {string} zookeeperId - | ||
* | ||
*/ | ||
Client.prototype.listProctorImages = function(parameters) { | ||
Client.prototype.getProcesses = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -741,3 +735,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/proctor/{user_id}/images'; | ||
var path = '/v1/sessions/{session_id}/processes'; | ||
@@ -749,9 +743,18 @@ 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['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) { | ||
@@ -770,10 +773,10 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* This endpoint is used to upload headshot for a proctor | ||
* Updates the session with the current running processes | ||
* @method | ||
* @name Client#uploadProctorImage | ||
* @param {string} userId - | ||
* @name Client#sessionProcesses | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.uploadProctorImage = function(parameters) { | ||
Client.prototype.sessionProcesses = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -785,3 +788,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/proctor/{user_id}/images'; | ||
var path = '/v1/sessions/{session_id}/processes'; | ||
@@ -793,6 +796,6 @@ 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; | ||
@@ -813,3 +816,3 @@ } | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('PUT', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -819,10 +822,9 @@ return deferred.promise; | ||
/** | ||
* Start a new session and create permissions | ||
* Will return return a list of courses for an institution | ||
* @method | ||
* @name Client#startSession | ||
* @param {string} sessionId - Access Key | ||
* @param {} body - | ||
* @name Client#listCourses | ||
* @param {string} institutionId - | ||
* | ||
*/ | ||
Client.prototype.startSession = function(parameters) { | ||
Client.prototype.listCourses = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -834,3 +836,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/start'; | ||
var path = '/v1/institutions/{institution_id}/courses'; | ||
@@ -842,13 +844,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['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -862,3 +860,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); | ||
@@ -868,9 +866,11 @@ return deferred.promise; | ||
/** | ||
* Will return return a list of courses for an institution | ||
* Get history of current session | ||
* @method | ||
* @name Client#listCourses | ||
* @param {string} institutionId - | ||
* @name Client#getAgreementHistory | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {string} agreementId - | ||
* | ||
*/ | ||
Client.prototype.listCourses = function(parameters) { | ||
Client.prototype.getAgreementHistory = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -882,3 +882,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions/{institution_id}/courses'; | ||
var path = '/v1/sessions/{session_id}/agreements/{agreement_id}/history'; | ||
@@ -890,9 +890,25 @@ 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('{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; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -911,10 +927,11 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Get instructor details | ||
* Get exam details | ||
* @method | ||
* @name Client#getInstructor | ||
* @name Client#getExam | ||
* @param {string} courseId - | ||
* @param {string} instructorId - | ||
* @param {string} examId - | ||
* @param {string} enrollmentId - | ||
* | ||
*/ | ||
Client.prototype.getInstructor = function(parameters) { | ||
Client.prototype.getExam = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -926,3 +943,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/courses/{course_id}/instructors/{instructor_id}'; | ||
var path = '/v1/courses/{course_id}/exams/{exam_id}'; | ||
@@ -941,9 +958,18 @@ var body; | ||
path = path.replace('{instructor_id}', parameters['instructorId']); | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
if (parameters['instructorId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: instructorId')); | ||
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) { | ||
@@ -962,10 +988,9 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* This endpoint is used to get playback tokens for a user | ||
* List all exams for a course | ||
* @method | ||
* @name Client#playbackToken | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* @name Client#listExams | ||
* @param {string} courseId - | ||
* | ||
*/ | ||
Client.prototype.playbackToken = function(parameters) { | ||
Client.prototype.listExams = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -977,3 +1002,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{sessionId}/playback/token'; | ||
var path = '/v1/courses/{course_id}/exams'; | ||
@@ -985,13 +1010,9 @@ var body; | ||
path = path.replace('{sessionId}', parameters['sessionId']); | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
if (parameters['courseId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: courseId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1005,3 +1026,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); | ||
@@ -1011,10 +1032,10 @@ return deferred.promise; | ||
/** | ||
* Get all the incident types | ||
* Will return return details about a single course | ||
* @method | ||
* @name Client#getIncidentTypes | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* @name Client#getCourse | ||
* @param {string} courseId - | ||
* @param {string} institutionId - | ||
* | ||
*/ | ||
Client.prototype.getIncidentTypes = function(parameters) { | ||
Client.prototype.getCourse = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1026,3 +1047,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/incidents/types'; | ||
var path = '/v1/institutions/{institution_id}/courses/{course_id}'; | ||
@@ -1034,8 +1055,14 @@ var body; | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
if (parameters['courseId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: courseId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
return deferred.promise; | ||
} | ||
@@ -1056,11 +1083,10 @@ | ||
/** | ||
* List all instructors for a course | ||
* Get student details | ||
* @method | ||
* @name Client#listInstructors | ||
* @param {string} courseId - | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* @name Client#getStudent | ||
* @param {string} institutionId - | ||
* @param {string} studentId - | ||
* | ||
*/ | ||
Client.prototype.listInstructors = function(parameters) { | ||
Client.prototype.getStudent = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1072,3 +1098,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/courses/{course_id}/instructors'; | ||
var path = '/v1/institutions/{institution_id}/students/{student_id}'; | ||
@@ -1080,15 +1106,14 @@ var body; | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
if (parameters['courseId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: courseId')); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
} | ||
path = path.replace('{student_id}', parameters['studentId']); | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
if (parameters['studentId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: studentId')); | ||
return deferred.promise; | ||
} | ||
@@ -1109,11 +1134,10 @@ | ||
/** | ||
* Updates an incident for a given session | ||
* Returns the media token needed for the client to connect to the session. | ||
* @method | ||
* @name Client#createIncident | ||
* @param {string} incidentNumber - | ||
* @name Client#getMediaToken | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* @param {string} clientId - | ||
* | ||
*/ | ||
Client.prototype.createIncident = function(parameters) { | ||
Client.prototype.getMediaToken = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1125,3 +1149,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/incidents/{incident_number}'; | ||
var path = '/v1/sessions/{session_id}/clients/{client_id}/mediatoken'; | ||
@@ -1133,9 +1157,2 @@ var body; | ||
path = path.replace('{incident_number}', parameters['incidentNumber']); | ||
if (parameters['incidentNumber'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: incidentNumber')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
@@ -1148,4 +1165,7 @@ | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
path = path.replace('{client_id}', parameters['clientId']); | ||
if (parameters['clientId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: clientId')); | ||
return deferred.promise; | ||
} | ||
@@ -1161,3 +1181,3 @@ | ||
this.request('PUT', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1167,10 +1187,10 @@ return deferred.promise; | ||
/** | ||
* delete incident for a given session | ||
* Get instructor details | ||
* @method | ||
* @name Client#listIncidents | ||
* @param {string} sessionId - | ||
* @param {string} incidentNumber - | ||
* @name Client#getInstructor | ||
* @param {string} courseId - | ||
* @param {string} instructorId - | ||
* | ||
*/ | ||
Client.prototype.listIncidents = function(parameters) { | ||
Client.prototype.getInstructor = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1182,3 +1202,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/incidents/{incident_number}'; | ||
var path = '/v1/courses/{course_id}/instructors/{instructor_id}'; | ||
@@ -1190,13 +1210,13 @@ var body; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
if (parameters['courseId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: courseId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{incident_number}', parameters['incidentNumber']); | ||
path = path.replace('{instructor_id}', parameters['instructorId']); | ||
if (parameters['incidentNumber'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: incidentNumber')); | ||
if (parameters['instructorId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: instructorId')); | ||
return deferred.promise; | ||
@@ -1213,3 +1233,3 @@ } | ||
this.request('DELETE', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1219,8 +1239,9 @@ return deferred.promise; | ||
/** | ||
* Used to make sure that the api is current only | ||
* This endpoint is used to get an image list for an proctor | ||
* @method | ||
* @name Client#health | ||
* @name Client#listProctorImages | ||
* @param {string} userId - | ||
* | ||
*/ | ||
Client.prototype.health = function(parameters) { | ||
Client.prototype.listProctorImages = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1232,3 +1253,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1'; | ||
var path = '/v1/proctor/{user_id}/images'; | ||
@@ -1240,2 +1261,9 @@ 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.$queryParameters) { | ||
@@ -1254,13 +1282,10 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Sign an agreement | ||
* This endpoint is used to upload headshot for a proctor | ||
* @method | ||
* @name Client#signAgreements | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {string} agreementId - | ||
* @param {string} versionId - | ||
* @name Client#uploadProctorImage | ||
* @param {string} userId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.signAgreements = function(parameters) { | ||
Client.prototype.uploadProctorImage = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1272,3 +1297,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/agreements/{agreement_id}/versions/{version_id}/sign'; | ||
var path = '/v1/proctor/{user_id}/images'; | ||
@@ -1280,32 +1305,9 @@ var body; | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
path = path.replace('{user_id}', parameters['userId']); | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
if (parameters['userId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: userId')); | ||
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) { | ||
@@ -1360,11 +1362,9 @@ body = parameters['body']; | ||
/** | ||
* This endpoint is used to get an image list for an user | ||
* Used to login and authenticate proctors | ||
* @method | ||
* @name Client#listImages | ||
* @param {string} sessionId - | ||
* @param {string} clientId - | ||
* @param {string} type - | ||
* @name Client#proctorLogin | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.listImages = function(parameters) { | ||
Client.prototype.proctorLogin = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1376,3 +1376,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/images'; | ||
var path = '/v1/proctors/login'; | ||
@@ -1384,22 +1384,38 @@ 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['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters['clientId'] !== undefined) { | ||
queryParameters['client_id'] = parameters['clientId']; | ||
if (parameters.$queryParameters) { | ||
Object.keys(parameters.$queryParameters) | ||
.forEach(function(parameterName) { | ||
var parameter = parameters.$queryParameters[parameterName]; | ||
queryParameters[parameterName] = parameter; | ||
}); | ||
} | ||
if (parameters['clientId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: clientId')); | ||
return deferred.promise; | ||
} | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
if (parameters['type'] !== undefined) { | ||
queryParameters['type'] = parameters['type']; | ||
return deferred.promise; | ||
}; | ||
/** | ||
* Used to make sure that the api is current only | ||
* @method | ||
* @name Client#health | ||
* | ||
*/ | ||
Client.prototype.health = function(parameters) { | ||
if (parameters === undefined) { | ||
parameters = {}; | ||
} | ||
var deferred = Q.defer(); | ||
var domain = this.domain; | ||
var path = '/v1'; | ||
var body; | ||
var queryParameters = {}; | ||
var headers = {}; | ||
var form = {}; | ||
if (parameters.$queryParameters) { | ||
@@ -1418,5 +1434,5 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* This endpoint is used to upload images for a user | ||
* This endpoint is used to get playback tokens for a user | ||
* @method | ||
* @name Client#uploadImage | ||
* @name Client#playbackToken | ||
* @param {string} token - | ||
@@ -1427,3 +1443,3 @@ * @param {string} sessionId - | ||
*/ | ||
Client.prototype.uploadImage = function(parameters) { | ||
Client.prototype.playbackToken = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1435,3 +1451,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/images'; | ||
var path = '/v1/sessions/{sessionId}/playback/token'; | ||
@@ -1452,3 +1468,3 @@ var body; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
path = path.replace('{sessionId}', parameters['sessionId']); | ||
@@ -1477,10 +1493,9 @@ if (parameters['sessionId'] === undefined) { | ||
/** | ||
* 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) { | ||
@@ -1492,3 +1507,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/processes'; | ||
var path = '/v1/institutions/{institution_id}'; | ||
@@ -1500,18 +1515,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) { | ||
@@ -1530,10 +1536,11 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Updates the session with the current running processes | ||
* Get session details for a given exam | ||
* @method | ||
* @name Client#sessionProcesses | ||
* @name Client#getSession | ||
* @param {string} token - | ||
* @param {string} examId - | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.sessionProcesses = function(parameters) { | ||
Client.prototype.getSession = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1545,3 +1552,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/processes'; | ||
var path = '/v1/exams/{exam_id}/sessions/{session_id}'; | ||
@@ -1553,2 +1560,18 @@ 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('{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']); | ||
@@ -1561,6 +1584,2 @@ | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1574,3 +1593,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); | ||
@@ -1580,10 +1599,10 @@ return deferred.promise; | ||
/** | ||
* Will return return details about a single course | ||
* Get all the incident types | ||
* @method | ||
* @name Client#getCourse | ||
* @param {string} courseId - | ||
* @param {string} institutionId - | ||
* @name Client#getIncidentTypes | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* | ||
*/ | ||
Client.prototype.getCourse = function(parameters) { | ||
Client.prototype.getIncidentTypes = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1595,3 +1614,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions/{institution_id}/courses/{course_id}'; | ||
var path = '/v1/incidents/types'; | ||
@@ -1603,14 +1622,8 @@ var body; | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
if (parameters['courseId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: courseId')); | ||
return deferred.promise; | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
} | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
return deferred.promise; | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
} | ||
@@ -1631,10 +1644,13 @@ | ||
/** | ||
* Will return an array of videos that contained signed urls and other metadata | ||
* Sign an agreement | ||
* @method | ||
* @name Client#getVideos | ||
* @param {string} userId - | ||
* @name Client#signAgreements | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {string} agreementId - | ||
* @param {string} versionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.getVideos = function(parameters) { | ||
Client.prototype.signAgreements = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1646,3 +1662,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/{userId}/videos'; | ||
var path = '/v1/sessions/{session_id}/agreements/{agreement_id}/versions/{version_id}/sign'; | ||
@@ -1654,45 +1670,36 @@ var body; | ||
path = path.replace('{userId}', 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; | ||
} | ||
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.$queryParameters) { | ||
Object.keys(parameters.$queryParameters) | ||
.forEach(function(parameterName) { | ||
var parameter = parameters.$queryParameters[parameterName]; | ||
queryParameters[parameterName] = parameter; | ||
}); | ||
path = path.replace('{agreement_id}', parameters['agreementId']); | ||
if (parameters['agreementId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: agreementId')); | ||
return deferred.promise; | ||
} | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
path = path.replace('{version_id}', parameters['versionId']); | ||
return deferred.promise; | ||
}; | ||
/** | ||
* Will return a full list of all institutions | ||
* @method | ||
* @name Client#listInstitutions | ||
* | ||
*/ | ||
Client.prototype.listInstitutions = function(parameters) { | ||
if (parameters === undefined) { | ||
parameters = {}; | ||
if (parameters['versionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: versionId')); | ||
return deferred.promise; | ||
} | ||
var deferred = Q.defer(); | ||
var domain = this.domain; | ||
var path = '/v1/institutions'; | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
var body; | ||
var queryParameters = {}; | ||
var headers = {}; | ||
var form = {}; | ||
if (parameters.$queryParameters) { | ||
@@ -1706,3 +1713,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); | ||
@@ -1712,10 +1719,11 @@ return deferred.promise; | ||
/** | ||
* Join an existing session and get permissions | ||
* Updates an incident for a given session | ||
* @method | ||
* @name Client#joinSession | ||
* @param {string} sessionId - Access Key | ||
* @name Client#createIncident | ||
* @param {string} incidentNumber - | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.joinSession = function(parameters) { | ||
Client.prototype.createIncident = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1727,3 +1735,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/join'; | ||
var path = '/v1/sessions/{session_id}/incidents/{incident_number}'; | ||
@@ -1735,2 +1743,9 @@ var body; | ||
path = path.replace('{incident_number}', parameters['incidentNumber']); | ||
if (parameters['incidentNumber'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: incidentNumber')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
@@ -1755,3 +1770,3 @@ | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('PUT', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1761,9 +1776,10 @@ return deferred.promise; | ||
/** | ||
* List students for a given exam | ||
* delete incident for a given session | ||
* @method | ||
* @name Client#listStudents | ||
* @param {string} examId - | ||
* @name Client#listIncidents | ||
* @param {string} sessionId - | ||
* @param {string} incidentNumber - | ||
* | ||
*/ | ||
Client.prototype.listStudents = function(parameters) { | ||
Client.prototype.listIncidents = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1775,3 +1791,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/exams/{exam_id}/students'; | ||
var path = '/v1/sessions/{session_id}/incidents/{incident_number}'; | ||
@@ -1783,9 +1799,16 @@ var body; | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
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) { | ||
@@ -1799,3 +1822,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); | ||
@@ -1805,11 +1828,11 @@ return deferred.promise; | ||
/** | ||
* Get exam details | ||
* Will return start and end time for a users media | ||
* @method | ||
* @name Client#getExam | ||
* @param {string} courseId - | ||
* @param {string} examId - | ||
* @param {string} enrollmentId - | ||
* @name Client#videoSetup | ||
* @param {string} token - | ||
* @param {string} userId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.getExam = function(parameters) { | ||
Client.prototype.videoSetup = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1821,3 +1844,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/courses/{course_id}/exams/{exam_id}'; | ||
var path = '/v1/{userId}/videoSetup'; | ||
@@ -1829,25 +1852,22 @@ var body; | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
if (parameters['courseId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: courseId')); | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
path = path.replace('{userId}', parameters['userId']); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
if (parameters['userId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: userId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['enrollmentId'] !== undefined) { | ||
queryParameters['enrollment_id'] = parameters['enrollmentId']; | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters['enrollmentId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: enrollmentId')); | ||
return deferred.promise; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1861,3 +1881,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); | ||
@@ -1864,0 +1884,0 @@ return deferred.promise; |
@@ -1,1 +0,1 @@ | ||
{"name":"@smarterservices/sp-public-client","version":"0.0.98","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.0.99","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} |
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
55955
1454