easyproctor 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -219,9 +219,9 @@ const {
219
219
  });
220
220
  ```
221
221
 
222
- ## Release Note V 1.0.6
222
+ ## Release Note V 1.0.7
223
223
 
224
- - Atualização na função checkDevices
224
+ - Retirada da comunicação com a extensão
225
225
 
226
226
  ## License
227
227
 
package/esm/index.js CHANGED
@@ -25558,7 +25558,6 @@ var Proctoring = class {
25558
25558
  this.extension = new Extension();
25559
25559
  this.extension.addEventListener();
25560
25560
  const baseURL = this.backend.selectBaseUrl(this.context.type);
25561
- setTimeout(() => this.extension.sendVerifyMsg(baseURL, this.context.token), 5e3);
25562
25561
  const devices = await enumarateDevices();
25563
25562
  await this.repositoryDevices.save({ ...devices, id: "devices" });
25564
25563
  this.sessionOptions = { ...getDefaultProctoringOptions, ...options };
package/index.js CHANGED
@@ -37092,7 +37092,6 @@ var Proctoring = class {
37092
37092
  this.extension = new Extension();
37093
37093
  this.extension.addEventListener();
37094
37094
  const baseURL = this.backend.selectBaseUrl(this.context.type);
37095
- setTimeout(() => this.extension.sendVerifyMsg(baseURL, this.context.token), 5e3);
37096
37095
  const devices = await enumarateDevices();
37097
37096
  await this.repositoryDevices.save({ ...devices, id: "devices" });
37098
37097
  this.sessionOptions = { ...getDefaultProctoringOptions, ...options };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Modulo web de gravação do EasyProctor",
5
5
  "main": "./index.js",
6
6
  "module": "./esm/index.js",
@@ -29,7 +29,7 @@ bitsperframe: %d
29
29
  File size: ${n.size}`),new Error("Failed to upload to AWS")}}};var Oo=class{constructor(e,r){this.backend=r;this.proctoringId=e}async upload(e,r){let{file:n,onProgress:i}=e;try{let a=d=>{let p=d.loadedBytes/n.size*100;i&&i(Math.round(p))},s=await this.backend.getAzureSignedUrl(r,n),v=await Ua.request({url:s,method:"PUT",headers:{"x-ms-blob-type":"BlockBlob"},data:n,onUploadProgress:d=>{a({loadedBytes:d.loaded})}}).then(()=>!0).catch(()=>!1);return{storage:"AzureBlob",url:s,uploaded:v}}catch{throw Yt.registerError(this.proctoringId,`Failed to upload to Azure
30
30
  File name: ${n.name}
31
31
  File type: ${n.type}
32
- File size: ${n.size}`),new Error("Failed to upload to azure")}}};function b1(){let t=window.navigator.userAgent.split("SEB/");return t.length>1?t[1]:"1.0.0.0"}var n0=class{constructor(e){this.context=e;this.proctoringId="";this.insights=void 0;this.state="Stop";this.serviceType="Upload";this.onStopSharingScreenCallback=()=>{console.log("Stop sharing screen"),Yt.registerStopSharingScreen(this.proctoringId,"Stop sharing screen")};this.onLostFocusCallback=()=>{};this.onFocusCallback=()=>{};this.onNoiseDetectedCallback=()=>{};this.backend=new Qs({type:e.type}),this.repository=new No("EasyProctorDb","exams2"),this.repositoryDevices=new No("EasyProctorDbDevices","devices")}setOnStopSharingScreenCallback(e){this.onStopSharingScreenCallback=()=>e()}setOnLostFocusCallback(e){this.onLostFocusCallback=()=>e()}setOnFocusCallback(e){this.onFocusCallback=()=>e()}setOnNoiseDetectedCallback(e){this.onNoiseDetectedCallback=()=>e()}async onChangeDevices(e={}){new Hs(this.repositoryDevices,this.proctoringId).startRecording(e)}createRecorders(e=oi){let r=new ai({cameraId:this.sessionOptions.cameraId,microphoneId:this.sessionOptions.microphoneId},{width:this.videoOptions.width,height:this.videoOptions.height}),n=new t0,i=this.sessionOptions.captureScreen?new r0({allowOnlyFirstMonitor:this.sessionOptions.allowOnlyFirstMonitor??!0,onStopSharingScreenCallback:()=>this.onStopSharingScreenCallback()}):void 0,a=new e0({onFocusCallback:()=>this.onFocusCallback(),onLostFocusCallback:()=>this.onLostFocusCallback(),onNoiseDetectedCallback:()=>this.onNoiseDetectedCallback()},e,r);this.onChangeDevices();let s=[r,n,i,a].filter(Boolean);return this.recorder=new Js(this.proctoringSession,s),{cameraRecorder:r,audioRecorder:n,screenRecorder:i,alertRecorder:a}}async start(e=oi,r={}){this.extension=new es,this.extension.addEventListener();let n=this.backend.selectBaseUrl(this.context.type);setTimeout(()=>this.extension.sendVerifyMsg(n,this.context.token),5e3);let i=await Gn();if(await this.repositoryDevices.save({...i,id:"devices"}),this.sessionOptions={...oi,...e},this.videoOptions=$o(r),this.state!="Stop")throw Y1;this.state="Starting",await this.initConfig(),await this.verifyMultipleMonitors(this.sessionOptions),await this.repository.hasSessions()&&await this.repository.clear();try{let a=await this.backend.confirmStart({clientId:this.context.clientId,examId:this.context.examId,token:this.context.token},this.sessionOptions.proctoringType);return this.proctoringId=a.id,this.proctoringSession=new Yo(this.proctoringId),this.allRecorders=this.createRecorders(this.sessionOptions),await this.recorder.startAll(),await this.repository.save(this.proctoringSession),Yt.registerStart(this.proctoringId,!0,""),a.cameraStream=this.allRecorders.cameraRecorder.cameraStream,this.allRecorders.screenRecorder&&(a.screenStream=this.allRecorders.screenRecorder.screenStream),this.state="Recording",a}catch(a){throw await this.cancel(),Yt.registerStart(this.proctoringId,!1,`Token: ${this.context.token}
32
+ File size: ${n.size}`),new Error("Failed to upload to azure")}}};function b1(){let t=window.navigator.userAgent.split("SEB/");return t.length>1?t[1]:"1.0.0.0"}var n0=class{constructor(e){this.context=e;this.proctoringId="";this.insights=void 0;this.state="Stop";this.serviceType="Upload";this.onStopSharingScreenCallback=()=>{console.log("Stop sharing screen"),Yt.registerStopSharingScreen(this.proctoringId,"Stop sharing screen")};this.onLostFocusCallback=()=>{};this.onFocusCallback=()=>{};this.onNoiseDetectedCallback=()=>{};this.backend=new Qs({type:e.type}),this.repository=new No("EasyProctorDb","exams2"),this.repositoryDevices=new No("EasyProctorDbDevices","devices")}setOnStopSharingScreenCallback(e){this.onStopSharingScreenCallback=()=>e()}setOnLostFocusCallback(e){this.onLostFocusCallback=()=>e()}setOnFocusCallback(e){this.onFocusCallback=()=>e()}setOnNoiseDetectedCallback(e){this.onNoiseDetectedCallback=()=>e()}async onChangeDevices(e={}){new Hs(this.repositoryDevices,this.proctoringId).startRecording(e)}createRecorders(e=oi){let r=new ai({cameraId:this.sessionOptions.cameraId,microphoneId:this.sessionOptions.microphoneId},{width:this.videoOptions.width,height:this.videoOptions.height}),n=new t0,i=this.sessionOptions.captureScreen?new r0({allowOnlyFirstMonitor:this.sessionOptions.allowOnlyFirstMonitor??!0,onStopSharingScreenCallback:()=>this.onStopSharingScreenCallback()}):void 0,a=new e0({onFocusCallback:()=>this.onFocusCallback(),onLostFocusCallback:()=>this.onLostFocusCallback(),onNoiseDetectedCallback:()=>this.onNoiseDetectedCallback()},e,r);this.onChangeDevices();let s=[r,n,i,a].filter(Boolean);return this.recorder=new Js(this.proctoringSession,s),{cameraRecorder:r,audioRecorder:n,screenRecorder:i,alertRecorder:a}}async start(e=oi,r={}){this.extension=new es,this.extension.addEventListener();let n=this.backend.selectBaseUrl(this.context.type),i=await Gn();if(await this.repositoryDevices.save({...i,id:"devices"}),this.sessionOptions={...oi,...e},this.videoOptions=$o(r),this.state!="Stop")throw Y1;this.state="Starting",await this.initConfig(),await this.verifyMultipleMonitors(this.sessionOptions),await this.repository.hasSessions()&&await this.repository.clear();try{let a=await this.backend.confirmStart({clientId:this.context.clientId,examId:this.context.examId,token:this.context.token},this.sessionOptions.proctoringType);return this.proctoringId=a.id,this.proctoringSession=new Yo(this.proctoringId),this.allRecorders=this.createRecorders(this.sessionOptions),await this.recorder.startAll(),await this.repository.save(this.proctoringSession),Yt.registerStart(this.proctoringId,!0,""),a.cameraStream=this.allRecorders.cameraRecorder.cameraStream,this.allRecorders.screenRecorder&&(a.screenStream=this.allRecorders.screenRecorder.screenStream),this.state="Recording",a}catch(a){throw await this.cancel(),Yt.registerStart(this.proctoringId,!1,`Token: ${this.context.token}
33
33
  Error: `+a),this.state="Stop",a}}async cancel(){this.state==="Recording"&&await this.recorder.stopAll(),this.state="Stop"}async finish(e={}){if(this.extension.options=e,this.state!=="Recording")throw Jo;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession);let r,n;b1()!=="1.0.0.0"?(r=new Va(this.proctoringSession,this.proctoringId,[new Ha(this.proctoringId)]),n="Download",this.serviceType="Download"):(r=new Va(this.proctoringSession,this.proctoringId,[new Oo(this.proctoringId,this.backend),new Do(this.proctoringId,this.backend),new Ha(this.proctoringId)]),n="Azure, AWS, Download",this.serviceType="Upload");let i=!1;this.extension.hasExtension&&await this.extension.start().then(a=>{i=a}).catch(a=>{i=!1}),(!i||!this.extension.hasExtension)&&(await r.upload(this.context.token,e.onProgress).catch(async a=>{Yt.registerUpload(this.proctoringSession.id,!1,`upload error: ${a}
34
34
 
35
35
  Upload Services: ${n}`,this.serviceType),b1()!=="1.0.0.0"&&(r=new Va(this.proctoringSession,this.proctoringId,[new Oo(this.proctoringId,this.backend),new Do(this.proctoringId,this.backend),new Ha(this.proctoringId)]),n="Azure, AWS, Download",this.serviceType="Upload",await r.upload(this.context.token,e.onProgress).catch(s=>{Yt.registerUpload(this.proctoringSession.id,!1,`upload backup error: ${s}