easyproctor 0.0.76 → 0.0.78

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 0.0.76
222
+ ## Release Note V 0.0.78
223
223
 
224
- - Add 100% progress no download
224
+ - Teste em pegar o HASH do Safe Browser
225
225
 
226
226
  ## License
227
227
 
package/esm/index.js CHANGED
@@ -28897,11 +28897,6 @@ function useProctoring(proctoringOptions, homolConfig = false) {
28897
28897
  onChangeDevicesCallback && onChangeDevicesCallback();
28898
28898
  console.log("here");
28899
28899
  console.log(event);
28900
- alerts.push({
28901
- begin: Date.now() - startTime,
28902
- alert: 25,
28903
- end: 0
28904
- });
28905
28900
  };
28906
28901
  };
28907
28902
  const _onReturnFocus = () => {
@@ -28955,12 +28950,13 @@ function useProctoring(proctoringOptions, homolConfig = false) {
28955
28950
  init(config.insights);
28956
28951
  }
28957
28952
  async function start(options = defaultProctoringOptions, videoOptions = { width: 640, height: 480 }) {
28953
+ ehSafeBrowser();
28958
28954
  console.log(lastClick);
28959
28955
  if (lastClick >= Date.now() - delay)
28960
28956
  throw PROCTORING_ALREADY_STARTED;
28961
28957
  lastClick = Date.now();
28962
28958
  const { cameraId, microphoneId, allowOnlyFirstMonitor = true, allowMultipleMonitors = false, captureScreen = true, proctoringType } = options;
28963
- previousDownload = !options.previousDownload;
28959
+ previousDownload = !!options.previousDownload;
28964
28960
  try {
28965
28961
  await initConfig();
28966
28962
  } catch (err) {
@@ -29272,7 +29268,6 @@ function useProctoring(proctoringOptions, homolConfig = false) {
29272
29268
  trackers.registerUploadVideo(proctoringId, false, "" + error);
29273
29269
  }
29274
29270
  }
29275
- await clearBuffers("exams");
29276
29271
  cameraBuffer = [];
29277
29272
  screenBuffer = [];
29278
29273
  alerts = [];
@@ -29290,7 +29285,17 @@ function useProctoring(proctoringOptions, homolConfig = false) {
29290
29285
  function onChangeDevices(cb) {
29291
29286
  onChangeDevicesCallback = cb;
29292
29287
  }
29293
- return { start, startAudio, checkDevices, finish, finishAudio, closeCheckDevices, pause, resume, onFocus, onLostFocus, enumarateDevices, checkPermissions, checkIfhasMultipleMonitors, onStopSharingScreen };
29288
+ function readSafe(url) {
29289
+ const r = new XMLHttpRequest();
29290
+ r.open("GET", url, false);
29291
+ r.send(null);
29292
+ return r.getResponseHeader("x-safe-browser");
29293
+ }
29294
+ function ehSafeBrowser() {
29295
+ const result = readSafe(window.navigator.userAgent);
29296
+ alert(`O HASH \xE9: ${result}`);
29297
+ }
29298
+ return { start, startAudio, checkDevices, finish, finishAudio, closeCheckDevices, pause, resume, onFocus, onLostFocus, onChangeDevices, enumarateDevices, checkPermissions, checkIfhasMultipleMonitors, onStopSharingScreen };
29294
29299
  }
29295
29300
  if (typeof window !== "undefined") {
29296
29301
  window.useProctoring = useProctoring;
package/index.d.ts CHANGED
@@ -49,6 +49,7 @@ export declare function useProctoring(proctoringOptions: {
49
49
  }>;
50
50
  onFocus: (cb: () => void) => void;
51
51
  onLostFocus: (cb: () => void) => void;
52
+ onChangeDevices: (cb: () => void) => void;
52
53
  enumarateDevices: typeof enumarateDevices;
53
54
  checkPermissions: typeof checkPermissions;
54
55
  checkIfhasMultipleMonitors: typeof checkIfhasMultipleMonitors;
package/index.js CHANGED
@@ -40418,11 +40418,6 @@ function useProctoring(proctoringOptions, homolConfig = false) {
40418
40418
  onChangeDevicesCallback && onChangeDevicesCallback();
40419
40419
  console.log("here");
40420
40420
  console.log(event);
40421
- alerts.push({
40422
- begin: Date.now() - startTime,
40423
- alert: 25,
40424
- end: 0
40425
- });
40426
40421
  };
40427
40422
  };
40428
40423
  const _onReturnFocus = () => {
@@ -40476,12 +40471,13 @@ function useProctoring(proctoringOptions, homolConfig = false) {
40476
40471
  init(config.insights);
40477
40472
  }
40478
40473
  async function start(options = defaultProctoringOptions, videoOptions = { width: 640, height: 480 }) {
40474
+ ehSafeBrowser();
40479
40475
  console.log(lastClick);
40480
40476
  if (lastClick >= Date.now() - delay)
40481
40477
  throw PROCTORING_ALREADY_STARTED;
40482
40478
  lastClick = Date.now();
40483
40479
  const { cameraId, microphoneId, allowOnlyFirstMonitor = true, allowMultipleMonitors = false, captureScreen = true, proctoringType } = options;
40484
- previousDownload = !options.previousDownload;
40480
+ previousDownload = !!options.previousDownload;
40485
40481
  try {
40486
40482
  await initConfig();
40487
40483
  } catch (err) {
@@ -40793,7 +40789,6 @@ function useProctoring(proctoringOptions, homolConfig = false) {
40793
40789
  trackers.registerUploadVideo(proctoringId, false, "" + error);
40794
40790
  }
40795
40791
  }
40796
- await clearBuffers("exams");
40797
40792
  cameraBuffer = [];
40798
40793
  screenBuffer = [];
40799
40794
  alerts = [];
@@ -40811,7 +40806,17 @@ function useProctoring(proctoringOptions, homolConfig = false) {
40811
40806
  function onChangeDevices(cb) {
40812
40807
  onChangeDevicesCallback = cb;
40813
40808
  }
40814
- return { start, startAudio, checkDevices, finish, finishAudio, closeCheckDevices, pause, resume, onFocus, onLostFocus, enumarateDevices, checkPermissions, checkIfhasMultipleMonitors, onStopSharingScreen };
40809
+ function readSafe(url2) {
40810
+ const r = new XMLHttpRequest();
40811
+ r.open("GET", url2, false);
40812
+ r.send(null);
40813
+ return r.getResponseHeader("x-safe-browser");
40814
+ }
40815
+ function ehSafeBrowser() {
40816
+ const result = readSafe(window.navigator.userAgent);
40817
+ alert(`O HASH \xE9: ${result}`);
40818
+ }
40819
+ return { start, startAudio, checkDevices, finish, finishAudio, closeCheckDevices, pause, resume, onFocus, onLostFocus, onChangeDevices, enumarateDevices, checkPermissions, checkIfhasMultipleMonitors, onStopSharingScreen };
40815
40820
  }
40816
40821
  if (typeof window !== "undefined") {
40817
40822
  window.useProctoring = useProctoring;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor",
3
- "version": "0.0.76",
3
+ "version": "0.0.78",
4
4
  "description": "Modulo web de gravação do EasyProctor",
5
5
  "main": "./index.js",
6
6
  "module": "./esm/index.js",
@@ -16,7 +16,8 @@
16
16
  },
17
17
  "scripts": {
18
18
  "build": "node scripts/build.js && tsc",
19
- "dev": "node scripts/serve.js -w"
19
+ "dev": "node scripts/serve.js -w",
20
+ "publish": "npm publish ./dist"
20
21
  },
21
22
  "author": "Igor Dantas",
22
23
  "license": "ISC",