@smarterservices/sp-public-client
Advanced tools
Comparing version 0.0.99 to 0.1.11
962
index.js
@@ -66,9 +66,13 @@ /*jshint -W069 */ | ||
/** | ||
* List sessions for a given exam | ||
* Sign an agreement | ||
* @method | ||
* @name Client#listSessions | ||
* @param {string} examId - | ||
* @name Client#signAgreements | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {string} agreementId - | ||
* @param {string} versionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.listSessions = function(parameters) { | ||
Client.prototype.signAgreements = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -80,3 +84,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/exams/{exam_id}/sessions'; | ||
var path = '/v1/sessions/{session_id}/agreements/{agreement_id}/versions/{version_id}/sign'; | ||
@@ -88,9 +92,36 @@ 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('{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) { | ||
@@ -104,3 +135,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); | ||
@@ -110,11 +141,10 @@ return deferred.promise; | ||
/** | ||
* List all instructors for a course | ||
* Join an existing session and get permissions | ||
* @method | ||
* @name Client#listInstructors | ||
* @param {string} courseId - | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* @name Client#joinSession | ||
* @param {string} sessionId - Access Key | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.listInstructors = function(parameters) { | ||
Client.prototype.joinSession = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -126,3 +156,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/courses/{course_id}/instructors'; | ||
var path = '/v1/sessions/{session_id}/join'; | ||
@@ -134,17 +164,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['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -158,3 +184,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); | ||
@@ -222,9 +248,11 @@ return deferred.promise; | ||
/** | ||
* List students for a given exam | ||
* This endpoint is used to get an image list for an user | ||
* @method | ||
* @name Client#listStudents | ||
* @param {string} examId - | ||
* @name Client#listImages | ||
* @param {string} sessionId - | ||
* @param {string} clientId - | ||
* @param {string} type - | ||
* | ||
*/ | ||
Client.prototype.listStudents = function(parameters) { | ||
Client.prototype.listImages = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -236,3 +264,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/exams/{exam_id}/students'; | ||
var path = '/v1/sessions/{session_id}/images'; | ||
@@ -244,9 +272,22 @@ 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; | ||
} | ||
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) { | ||
@@ -265,10 +306,11 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Join an existing session and get permissions | ||
* This endpoint is used to upload images for a user | ||
* @method | ||
* @name Client#joinSession | ||
* @param {string} sessionId - Access Key | ||
* @name Client#uploadImage | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.joinSession = function(parameters) { | ||
Client.prototype.uploadImage = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -280,3 +322,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/join'; | ||
var path = '/v1/sessions/{session_id}/images'; | ||
@@ -288,2 +330,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']); | ||
@@ -313,10 +364,9 @@ | ||
/** | ||
* Will return an array of videos that contained signed urls and other metadata | ||
* Used to login and authenticate proctors | ||
* @method | ||
* @name Client#getVideos | ||
* @param {string} userId - | ||
* @name Client#proctorLogin | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.getVideos = function(parameters) { | ||
Client.prototype.proctorLogin = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -328,3 +378,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/{userId}/videos'; | ||
var path = '/v1/proctors/login'; | ||
@@ -336,9 +386,2 @@ var body; | ||
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) { | ||
@@ -361,8 +404,11 @@ body = parameters['body']; | ||
/** | ||
* Will return a full list of all institutions | ||
* Get history of current session | ||
* @method | ||
* @name Client#listInstitutions | ||
* @name Client#getAgreementHistory | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {string} agreementId - | ||
* | ||
*/ | ||
Client.prototype.listInstitutions = function(parameters) { | ||
Client.prototype.getAgreementHistory = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -374,3 +420,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions'; | ||
var path = '/v1/sessions/{session_id}/agreements/{agreement_id}/history'; | ||
@@ -382,2 +428,25 @@ 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']); | ||
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) { | ||
@@ -396,10 +465,9 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Start a new session and create permissions | ||
* List sessions for a given exam | ||
* @method | ||
* @name Client#startSession | ||
* @param {string} sessionId - Access Key | ||
* @param {} body - | ||
* @name Client#listSessions | ||
* @param {string} examId - | ||
* | ||
*/ | ||
Client.prototype.startSession = function(parameters) { | ||
Client.prototype.listSessions = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -411,3 +479,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/start'; | ||
var path = '/v1/exams/{exam_id}/sessions'; | ||
@@ -419,13 +487,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) { | ||
@@ -439,3 +503,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); | ||
@@ -445,10 +509,11 @@ return deferred.promise; | ||
/** | ||
* Cancel session for a given exam | ||
* Will return start and end time for a users media | ||
* @method | ||
* @name Client#cancelSession | ||
* @param {string} examId - | ||
* @param {string} sessionId - | ||
* @name Client#videoSetup | ||
* @param {string} token - | ||
* @param {string} userId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.cancelSession = function(parameters) { | ||
Client.prototype.videoSetup = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -460,3 +525,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/exams/{exam_id}/sessions/{session_id}/cancel'; | ||
var path = '/v1/{userId}/videoSetup'; | ||
@@ -468,16 +533,22 @@ 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']); | ||
path = path.replace('{userId}', 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) { | ||
@@ -496,11 +567,11 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* This endpoint is used to get an image list for an user | ||
* Get exam details | ||
* @method | ||
* @name Client#listImages | ||
* @param {string} sessionId - | ||
* @param {string} clientId - | ||
* @param {string} type - | ||
* @name Client#getExam | ||
* @param {string} courseId - | ||
* @param {string} examId - | ||
* @param {string} enrollmentId - | ||
* | ||
*/ | ||
Client.prototype.listImages = function(parameters) { | ||
Client.prototype.getExam = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -512,3 +583,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/images'; | ||
var path = '/v1/courses/{course_id}/exams/{exam_id}'; | ||
@@ -520,22 +591,25 @@ 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; | ||
} | ||
if (parameters['clientId'] !== undefined) { | ||
queryParameters['client_id'] = parameters['clientId']; | ||
} | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
if (parameters['clientId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: clientId')); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['type'] !== undefined) { | ||
queryParameters['type'] = parameters['type']; | ||
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) { | ||
@@ -554,11 +628,9 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* This endpoint is used to upload images for a user | ||
* List all exams for a course | ||
* @method | ||
* @name Client#uploadImage | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* @name Client#listExams | ||
* @param {string} courseId - | ||
* | ||
*/ | ||
Client.prototype.uploadImage = function(parameters) { | ||
Client.prototype.listExams = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -570,3 +642,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/images'; | ||
var path = '/v1/courses/{course_id}/exams'; | ||
@@ -578,22 +650,9 @@ var body; | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
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['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -607,3 +666,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); | ||
@@ -613,11 +672,10 @@ return deferred.promise; | ||
/** | ||
* List incidents for a given session | ||
* Cancel session for a given exam | ||
* @method | ||
* @name Client#listIncidents | ||
* @name Client#cancelSession | ||
* @param {string} examId - | ||
* @param {string} sessionId - | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* | ||
*/ | ||
Client.prototype.listIncidents = function(parameters) { | ||
Client.prototype.cancelSession = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -629,3 +687,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/incidents'; | ||
var path = '/v1/exams/{exam_id}/sessions/{session_id}/cancel'; | ||
@@ -637,2 +695,9 @@ var body; | ||
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']); | ||
@@ -645,10 +710,2 @@ | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
} | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -662,3 +719,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); | ||
@@ -668,10 +725,10 @@ return deferred.promise; | ||
/** | ||
* Creates an incident for a given session | ||
* Get instructor details | ||
* @method | ||
* @name Client#createIncident | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* @name Client#getInstructor | ||
* @param {string} courseId - | ||
* @param {string} instructorId - | ||
* | ||
*/ | ||
Client.prototype.createIncident = function(parameters) { | ||
Client.prototype.getInstructor = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -683,3 +740,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/incidents'; | ||
var path = '/v1/courses/{course_id}/instructors/{instructor_id}'; | ||
@@ -691,11 +748,14 @@ 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; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
path = path.replace('{instructor_id}', parameters['instructorId']); | ||
if (parameters['instructorId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: instructorId')); | ||
return deferred.promise; | ||
} | ||
@@ -711,3 +771,3 @@ | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -717,10 +777,9 @@ return deferred.promise; | ||
/** | ||
* Gets the zookeeper session history | ||
* List students for a given exam | ||
* @method | ||
* @name Client#getProcesses | ||
* @param {string} sessionId - | ||
* @param {string} zookeeperId - | ||
* @name Client#listStudents | ||
* @param {string} examId - | ||
* | ||
*/ | ||
Client.prototype.getProcesses = function(parameters) { | ||
Client.prototype.listStudents = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -732,3 +791,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/processes'; | ||
var path = '/v1/exams/{exam_id}/students'; | ||
@@ -740,18 +799,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['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 +820,9 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Updates the session with the current running processes | ||
* This endpoint is used to get an image list for an proctor | ||
* @method | ||
* @name Client#sessionProcesses | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* @name Client#listProctorImages | ||
* @param {string} userId - | ||
* | ||
*/ | ||
Client.prototype.sessionProcesses = function(parameters) { | ||
Client.prototype.listProctorImages = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -785,3 +834,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/processes'; | ||
var path = '/v1/proctor/{user_id}/images'; | ||
@@ -793,13 +842,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) { | ||
@@ -813,3 +858,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); | ||
@@ -819,9 +864,10 @@ return deferred.promise; | ||
/** | ||
* Will return return a list of courses for an institution | ||
* This endpoint is used to upload headshot for a proctor | ||
* @method | ||
* @name Client#listCourses | ||
* @param {string} institutionId - | ||
* @name Client#uploadProctorImage | ||
* @param {string} userId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.listCourses = function(parameters) { | ||
Client.prototype.uploadProctorImage = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -833,3 +879,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions/{institution_id}/courses'; | ||
var path = '/v1/proctor/{user_id}/images'; | ||
@@ -841,9 +887,13 @@ var body; | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
path = path.replace('{user_id}', parameters['userId']); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
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) { | ||
@@ -857,3 +907,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); | ||
@@ -863,11 +913,10 @@ return deferred.promise; | ||
/** | ||
* Get history of current session | ||
* Gets the zookeeper session history | ||
* @method | ||
* @name Client#getAgreementHistory | ||
* @param {string} token - | ||
* @name Client#getProcesses | ||
* @param {string} sessionId - | ||
* @param {string} agreementId - | ||
* @param {string} zookeeperId - | ||
* | ||
*/ | ||
Client.prototype.getAgreementHistory = function(parameters) { | ||
Client.prototype.getProcesses = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -879,3 +928,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/agreements/{agreement_id}/history'; | ||
var path = '/v1/sessions/{session_id}/processes'; | ||
@@ -887,11 +936,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']); | ||
@@ -904,6 +944,8 @@ | ||
path = path.replace('{agreement_id}', parameters['agreementId']); | ||
if (parameters['zookeeperId'] !== undefined) { | ||
queryParameters['zookeeper_id'] = parameters['zookeeperId']; | ||
} | ||
if (parameters['agreementId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: agreementId')); | ||
if (parameters['zookeeperId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: zookeeperId')); | ||
return deferred.promise; | ||
@@ -925,11 +967,10 @@ } | ||
/** | ||
* Get exam details | ||
* Updates the session with the current running processes | ||
* @method | ||
* @name Client#getExam | ||
* @param {string} courseId - | ||
* @param {string} examId - | ||
* @param {string} enrollmentId - | ||
* @name Client#sessionProcesses | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.getExam = function(parameters) { | ||
Client.prototype.sessionProcesses = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -941,3 +982,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/courses/{course_id}/exams/{exam_id}'; | ||
var path = '/v1/sessions/{session_id}/processes'; | ||
@@ -949,25 +990,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; | ||
} | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
return deferred.promise; | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
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) { | ||
@@ -981,3 +1010,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); | ||
@@ -987,9 +1016,10 @@ return deferred.promise; | ||
/** | ||
* List all exams for a course | ||
* This endpoint is used to get playback tokens for a user | ||
* @method | ||
* @name Client#listExams | ||
* @param {string} courseId - | ||
* @name Client#playbackToken | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.listExams = function(parameters) { | ||
Client.prototype.playbackToken = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1001,3 +1031,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/courses/{course_id}/exams'; | ||
var path = '/v1/sessions/{sessionId}/playback/token'; | ||
@@ -1009,9 +1039,13 @@ var body; | ||
path = path.replace('{course_id}', parameters['courseId']); | ||
path = path.replace('{sessionId}', 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) { | ||
@@ -1025,3 +1059,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); | ||
@@ -1031,10 +1065,11 @@ return deferred.promise; | ||
/** | ||
* Will return return details about a single course | ||
* Will return an array of videos that contained signed urls and other metadata | ||
* @method | ||
* @name Client#getCourse | ||
* @param {string} courseId - | ||
* @param {string} institutionId - | ||
* @name Client#getVideos | ||
* @param {string} token - | ||
* @param {string} userId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.getCourse = function(parameters) { | ||
Client.prototype.getVideos = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1046,3 +1081,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions/{institution_id}/courses/{course_id}'; | ||
var path = '/v1/{userId}/videos'; | ||
@@ -1054,16 +1089,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('{institution_id}', parameters['institutionId']); | ||
path = path.replace('{userId}', parameters['userId']); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
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) { | ||
@@ -1077,3 +1118,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); | ||
@@ -1083,10 +1124,11 @@ return deferred.promise; | ||
/** | ||
* Get student details | ||
* Get session details for a given exam | ||
* @method | ||
* @name Client#getStudent | ||
* @param {string} institutionId - | ||
* @param {string} studentId - | ||
* @name Client#getSession | ||
* @param {string} token - | ||
* @param {string} examId - | ||
* @param {string} sessionId - | ||
* | ||
*/ | ||
Client.prototype.getStudent = function(parameters) { | ||
Client.prototype.getSession = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1098,3 +1140,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions/{institution_id}/students/{student_id}'; | ||
var path = '/v1/exams/{exam_id}/sessions/{session_id}'; | ||
@@ -1106,16 +1148,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('{student_id}', parameters['studentId']); | ||
path = path.replace('{exam_id}', parameters['examId']); | ||
if (parameters['studentId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: studentId')); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
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.$queryParameters) { | ||
@@ -1134,10 +1185,8 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Returns the media token needed for the client to connect to the session. | ||
* Get all corrective_action_types | ||
* @method | ||
* @name Client#getMediaToken | ||
* @param {string} sessionId - | ||
* @param {string} clientId - | ||
* @name Client#getCorrectiveActionTypes | ||
* | ||
*/ | ||
Client.prototype.getMediaToken = function(parameters) { | ||
Client.prototype.getCorrectiveActionTypes = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1149,3 +1198,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/clients/{client_id}/mediatoken'; | ||
var path = '/v1/incidents/corrective_action_types'; | ||
@@ -1157,16 +1206,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; | ||
} | ||
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) { | ||
@@ -1185,10 +1220,10 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Get instructor details | ||
* Get all the incident types | ||
* @method | ||
* @name Client#getInstructor | ||
* @param {string} courseId - | ||
* @param {string} instructorId - | ||
* @name Client#getIncidentTypes | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* | ||
*/ | ||
Client.prototype.getInstructor = function(parameters) { | ||
Client.prototype.getIncidentTypes = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1200,3 +1235,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/courses/{course_id}/instructors/{instructor_id}'; | ||
var path = '/v1/incidents/types'; | ||
@@ -1208,14 +1243,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('{instructor_id}', parameters['instructorId']); | ||
if (parameters['instructorId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: instructorId')); | ||
return deferred.promise; | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
} | ||
@@ -1236,9 +1265,8 @@ | ||
/** | ||
* This endpoint is used to get an image list for an proctor | ||
* Used to make sure that the api is current only | ||
* @method | ||
* @name Client#listProctorImages | ||
* @param {string} userId - | ||
* @name Client#health | ||
* | ||
*/ | ||
Client.prototype.listProctorImages = function(parameters) { | ||
Client.prototype.health = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1250,3 +1278,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/proctor/{user_id}/images'; | ||
var path = '/v1'; | ||
@@ -1258,9 +1286,2 @@ 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) { | ||
@@ -1279,10 +1300,9 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* This endpoint is used to upload headshot for a proctor | ||
* Will return detailed information about an institution | ||
* @method | ||
* @name Client#uploadProctorImage | ||
* @param {string} userId - | ||
* @param {} body - | ||
* @name Client#getInstitution | ||
* @param {string} institutionId - | ||
* | ||
*/ | ||
Client.prototype.uploadProctorImage = function(parameters) { | ||
Client.prototype.getInstitution = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1294,3 +1314,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/proctor/{user_id}/images'; | ||
var path = '/v1/institutions/{institution_id}'; | ||
@@ -1302,13 +1322,9 @@ var body; | ||
path = path.replace('{user_id}', parameters['userId']); | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
if (parameters['userId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: userId')); | ||
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) { | ||
@@ -1322,3 +1338,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); | ||
@@ -1328,8 +1344,11 @@ return deferred.promise; | ||
/** | ||
* Get all corrective_action_types | ||
* List all instructors for a course | ||
* @method | ||
* @name Client#getCorrectiveActionTypes | ||
* @name Client#listInstructors | ||
* @param {string} courseId - | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* | ||
*/ | ||
Client.prototype.getCorrectiveActionTypes = function(parameters) { | ||
Client.prototype.listInstructors = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1341,3 +1360,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/incidents/corrective_action_types'; | ||
var path = '/v1/courses/{course_id}/instructors'; | ||
@@ -1349,2 +1368,17 @@ 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']; | ||
} | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1363,9 +1397,10 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* Used to login and authenticate proctors | ||
* Start a new session and create permissions | ||
* @method | ||
* @name Client#proctorLogin | ||
* @name Client#startSession | ||
* @param {string} sessionId - Access Key | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.proctorLogin = function(parameters) { | ||
Client.prototype.startSession = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1377,3 +1412,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/proctors/login'; | ||
var path = '/v1/sessions/{session_id}/start'; | ||
@@ -1385,2 +1420,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['body'] !== undefined) { | ||
@@ -1403,8 +1445,10 @@ body = parameters['body']; | ||
/** | ||
* Used to make sure that the api is current only | ||
* Will return return details about a single course | ||
* @method | ||
* @name Client#health | ||
* @name Client#getCourse | ||
* @param {string} courseId - | ||
* @param {string} institutionId - | ||
* | ||
*/ | ||
Client.prototype.health = function(parameters) { | ||
Client.prototype.getCourse = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1416,3 +1460,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1'; | ||
var path = '/v1/institutions/{institution_id}/courses/{course_id}'; | ||
@@ -1424,2 +1468,16 @@ 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('{institution_id}', parameters['institutionId']); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1438,11 +1496,10 @@ Object.keys(parameters.$queryParameters) | ||
/** | ||
* This endpoint is used to get playback tokens for a user | ||
* Get student details | ||
* @method | ||
* @name Client#playbackToken | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* @name Client#getStudent | ||
* @param {string} institutionId - | ||
* @param {string} studentId - | ||
* | ||
*/ | ||
Client.prototype.playbackToken = function(parameters) { | ||
Client.prototype.getStudent = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1454,3 +1511,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{sessionId}/playback/token'; | ||
var path = '/v1/institutions/{institution_id}/students/{student_id}'; | ||
@@ -1462,22 +1519,16 @@ var body; | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
} | ||
path = path.replace('{institution_id}', parameters['institutionId']); | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
if (parameters['institutionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: institutionId')); | ||
return deferred.promise; | ||
} | ||
path = path.replace('{sessionId}', parameters['sessionId']); | ||
path = path.replace('{student_id}', parameters['studentId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
if (parameters['studentId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: studentId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
if (parameters.$queryParameters) { | ||
@@ -1491,3 +1542,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); | ||
@@ -1497,9 +1548,9 @@ return deferred.promise; | ||
/** | ||
* Will return detailed information about an institution | ||
* Will return return a list of courses for an institution | ||
* @method | ||
* @name Client#getInstitution | ||
* @name Client#listCourses | ||
* @param {string} institutionId - | ||
* | ||
*/ | ||
Client.prototype.getInstitution = function(parameters) { | ||
Client.prototype.listCourses = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1511,3 +1562,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/institutions/{institution_id}'; | ||
var path = '/v1/institutions/{institution_id}/courses'; | ||
@@ -1539,11 +1590,11 @@ var body; | ||
/** | ||
* Get session details for a given exam | ||
* List incidents for a given session | ||
* @method | ||
* @name Client#getSession | ||
* @param {string} token - | ||
* @param {string} examId - | ||
* @name Client#listIncidents | ||
* @param {string} sessionId - | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* | ||
*/ | ||
Client.prototype.getSession = function(parameters) { | ||
Client.prototype.listIncidents = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1555,3 +1606,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/exams/{exam_id}/sessions/{session_id}'; | ||
var path = '/v1/sessions/{session_id}/incidents'; | ||
@@ -1563,23 +1614,15 @@ 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('{exam_id}', parameters['examId']); | ||
if (parameters['examId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: examId')); | ||
return deferred.promise; | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
} | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
} | ||
@@ -1600,10 +1643,10 @@ | ||
/** | ||
* Get all the incident types | ||
* Creates an incident for a given session | ||
* @method | ||
* @name Client#getIncidentTypes | ||
* @param {string} page - | ||
* @param {string} pageSize - | ||
* @name Client#createIncident | ||
* @param {string} sessionId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.getIncidentTypes = function(parameters) { | ||
Client.prototype.createIncident = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1615,3 +1658,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/incidents/types'; | ||
var path = '/v1/sessions/{session_id}/incidents'; | ||
@@ -1623,8 +1666,11 @@ var body; | ||
if (parameters['page'] !== undefined) { | ||
queryParameters['page'] = parameters['page']; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
if (parameters['sessionId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: sessionId')); | ||
return deferred.promise; | ||
} | ||
if (parameters['pageSize'] !== undefined) { | ||
queryParameters['page_size'] = parameters['pageSize']; | ||
if (parameters['body'] !== undefined) { | ||
body = parameters['body']; | ||
} | ||
@@ -1640,3 +1686,3 @@ | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
@@ -1646,13 +1692,8 @@ return deferred.promise; | ||
/** | ||
* Sign an agreement | ||
* Will return a full list of all institutions | ||
* @method | ||
* @name Client#signAgreements | ||
* @param {string} token - | ||
* @param {string} sessionId - | ||
* @param {string} agreementId - | ||
* @param {string} versionId - | ||
* @param {} body - | ||
* @name Client#listInstitutions | ||
* | ||
*/ | ||
Client.prototype.signAgreements = function(parameters) { | ||
Client.prototype.listInstitutions = function(parameters) { | ||
if (parameters === undefined) { | ||
@@ -1664,3 +1705,3 @@ parameters = {}; | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/agreements/{agreement_id}/versions/{version_id}/sign'; | ||
var path = '/v1/institutions'; | ||
@@ -1672,11 +1713,36 @@ var body; | ||
if (parameters['token'] !== undefined) { | ||
headers['token'] = parameters['token']; | ||
if (parameters.$queryParameters) { | ||
Object.keys(parameters.$queryParameters) | ||
.forEach(function(parameterName) { | ||
var parameter = parameters.$queryParameters[parameterName]; | ||
queryParameters[parameterName] = parameter; | ||
}); | ||
} | ||
if (parameters['token'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: token')); | ||
return deferred.promise; | ||
this.request('GET', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
return deferred.promise; | ||
}; | ||
/** | ||
* Returns the media token needed for the client to connect to the session. | ||
* @method | ||
* @name Client#getMediaToken | ||
* @param {string} sessionId - | ||
* @param {string} clientId - | ||
* | ||
*/ | ||
Client.prototype.getMediaToken = function(parameters) { | ||
if (parameters === undefined) { | ||
parameters = {}; | ||
} | ||
var deferred = Q.defer(); | ||
var domain = this.domain; | ||
var path = '/v1/sessions/{session_id}/clients/{client_id}/mediatoken'; | ||
var body; | ||
var queryParameters = {}; | ||
var headers = {}; | ||
var form = {}; | ||
path = path.replace('{session_id}', parameters['sessionId']); | ||
@@ -1689,20 +1755,9 @@ | ||
path = path.replace('{agreement_id}', parameters['agreementId']); | ||
path = path.replace('{client_id}', parameters['clientId']); | ||
if (parameters['agreementId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: agreementId')); | ||
if (parameters['clientId'] === undefined) { | ||
deferred.reject(new Error('Missing required parameter: clientId')); | ||
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) { | ||
@@ -1716,3 +1771,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); | ||
@@ -1822,58 +1877,3 @@ return deferred.promise; | ||
}; | ||
/** | ||
* Will return start and end time for a users media | ||
* @method | ||
* @name Client#videoSetup | ||
* @param {string} token - | ||
* @param {string} userId - | ||
* @param {} body - | ||
* | ||
*/ | ||
Client.prototype.videoSetup = function(parameters) { | ||
if (parameters === undefined) { | ||
parameters = {}; | ||
} | ||
var deferred = Q.defer(); | ||
var domain = this.domain; | ||
var path = '/v1/{userId}/videoSetup'; | ||
var body; | ||
var queryParameters = {}; | ||
var headers = {}; | ||
var form = {}; | ||
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('{userId}', 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) { | ||
Object.keys(parameters.$queryParameters) | ||
.forEach(function(parameterName) { | ||
var parameter = parameters.$queryParameters[parameterName]; | ||
queryParameters[parameterName] = parameter; | ||
}); | ||
} | ||
this.request('POST', domain + path, parameters, body, headers, queryParameters, form, deferred); | ||
return deferred.promise; | ||
}; | ||
return Client; | ||
@@ -1880,0 +1880,0 @@ })(); |
@@ -1,1 +0,1 @@ | ||
{"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} | ||
{"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} |
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