easyproctor 2.3.5 → 2.5.0

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.
@@ -8,4 +8,5 @@ export default interface Devices {
8
8
  }
9
9
  export interface DevicesChanged extends Devices {
10
10
  status: string;
11
+ isActiveDevice: boolean;
11
12
  }
@@ -17,6 +17,7 @@ export declare class BaseDetection {
17
17
  detectorType: string;
18
18
  modelAssetPath: string;
19
19
  createdVideo: boolean;
20
+ startTime: Date | undefined;
20
21
  constructor(detectorType: any, modelAssetPath: string, options?: {
21
22
  onRealtimeAlertsCallback?: (response: any) => void;
22
23
  }, paramsConfig?: IParamsConfig, classVideo?: string, classDiv?: string);
@@ -4,11 +4,13 @@ export declare class FaceDetection extends BaseDetection {
4
4
  constructor(options?: {
5
5
  onRealtimeAlertsCallback?: (response: any) => void;
6
6
  }, paramsConfig?: IParamsConfig, classVideo?: string, classDiv?: string);
7
+ stopDetection(): void;
7
8
  displayVideoDetections(result: {
8
9
  detections: any;
9
10
  }): void;
10
11
  numFacesSent: number;
11
12
  emmitedPositionAlert: boolean;
13
+ emmitedFaceAlert: boolean;
12
14
  verify(result: {
13
15
  detections: any;
14
16
  }): void;
@@ -4,6 +4,7 @@ export declare class ObjectDetection extends BaseDetection {
4
4
  constructor(options?: {
5
5
  onRealtimeAlertsCallback?: (response: any) => void;
6
6
  }, paramsConfig?: IParamsConfig, classVideo?: string, classDiv?: string);
7
+ stopDetection(): void;
7
8
  displayVideoDetections(result: {
8
9
  detections: any;
9
10
  }): void;
@@ -1,9 +1,12 @@
1
1
  import { ISessionRepository } from "../new-flow/repository/ISessionRepository";
2
+ import { ProctoringSessionOptions } from "../proctoring/options/ProctoringOptions";
2
3
  import { ProctoringChangeDevicesOptions } from "../proctoring/proctoring";
3
4
  export declare class onChangeDevices {
4
5
  private repositoryDevices;
5
6
  private proctoringId;
6
- constructor(repositoryDevices: ISessionRepository, proctoringId: string);
7
+ private sessionOptions;
8
+ private allRecorders;
9
+ constructor(repositoryDevices: ISessionRepository, proctoringId: string, sessionOptions: ProctoringSessionOptions, allRecorders: any);
7
10
  startRecording(options: ProctoringChangeDevicesOptions): void;
8
11
  onChangeDevices(options: ProctoringChangeDevicesOptions): Promise<void>;
9
12
  }
@@ -2,6 +2,7 @@ import StartProctoringResponse from "../../dtos/StartProctoringResponse";
2
2
  import { ProctoringSession } from "../proctoring/ProctoringSession";
3
3
  import { ProctoringContext } from "../../proctoring/proctoring";
4
4
  import IParamsConfig from "../../interfaces/ParamsConfig";
5
+ import { ProctoringSessionOptions } from "../../proctoring/options/ProctoringOptions";
5
6
  export declare class BackendService {
6
7
  private readonly options;
7
8
  private readonly baseUrl;
@@ -17,22 +18,28 @@ export declare class BackendService {
17
18
  externalCameraCheckTransmission(externalSessionId: string): Promise<any>;
18
19
  externalCameraStartTransmission(externalSessionId: string, proctoringId: string): Promise<any>;
19
20
  externalCameraStartSession(): Promise<any>;
21
+ goToExternalCameraPositionStep(externalSessionId: string): Promise<any>;
20
22
  externalCameraFinish(externalSessionId: string): Promise<any>;
21
23
  confirmStart(proctoringOptions: {
22
24
  examId: any;
23
25
  clientId: any;
24
26
  token: any;
25
- }, proctoringType: string, latitude?: number, longitude?: number): Promise<StartProctoringResponse>;
27
+ }, sessionOptions: ProctoringSessionOptions, latitude?: number, longitude?: number): Promise<StartProctoringResponse>;
26
28
  getParamsConfig(proctoringOptions: ProctoringContext): Promise<IParamsConfig>;
27
29
  getSignedUrlImage(token: string, body: any): Promise<string[]>;
28
30
  getSignedUrl(token: string, file: File, proctoringId?: string): Promise<string>;
29
31
  saveAlerts(proctoringOptions: ProctoringContext, proctoringSession: ProctoringSession): Promise<void>;
30
- finishAndSendUrls(proctoringOptions: ProctoringContext, proctoringSession: ProctoringSession): Promise<void>;
32
+ finishAndSendUrls(proctoringOptions: ProctoringContext): Promise<any>;
31
33
  log(eventName: string, properties?: {
32
34
  [key: string]: any;
33
35
  }): Promise<string>;
34
36
  signTerm(): Promise<string>;
35
37
  signTermUrl(): Promise<string>;
38
+ startChallenge(body: any): Promise<any>;
39
+ stopChallenge(challengeId: string, body: any): Promise<any>;
40
+ startRealtimeAlert(body: any): Promise<any>;
41
+ stopRealtimeAlert(body: any): Promise<any>;
42
+ verifyFace(proctoringId: any, faceImage: any): Promise<any>;
36
43
  getServerHour(token: string): Promise<string>;
37
44
  private makeRequest;
38
45
  makeRequestAxios<R>(data: {
@@ -17,6 +17,7 @@ export interface checkDevicesReturn {
17
17
  };
18
18
  }
19
19
  export declare class DeviceCheckerService {
20
+ private deviceCheckResult;
20
21
  private static isModalOpen;
21
22
  private options;
22
23
  private videoOptions;
@@ -41,6 +42,7 @@ export declare class DeviceCheckerService {
41
42
  private spycam;
42
43
  private spydevices;
43
44
  constructor(context: ProctoringContext);
45
+ getDeviceCheckResult(): any;
44
46
  runCheckDevicesFlow(options: ProctoringSessionOptions, _videoOptions: Partial<ProctoringVideoOptions>, onModalConfirm: (resolve: (cameraId: string, microphoneId: string) => void) => void, onModalCancel: (reject: (error: Error) => void) => void, onUpdate: (feedback: any) => void): Promise<any>;
45
47
  private onUpdateCallback;
46
48
  checkDevices(options?: ProctoringSessionOptions, _videoOptions?: ProctoringVideoOptions): Promise<checkDevicesReturn>;
@@ -16,9 +16,19 @@ export declare enum RecordingOrigin {
16
16
  Camera = "Camera"
17
17
  }
18
18
  export declare enum AlertCategory {
19
+ NoFace = 1,
20
+ MultipleFaces = 2,
19
21
  LostFocus = 25,
22
+ EnvironmentMultiplePeople = 28,
23
+ EnvironmentNoPeople = 29,
20
24
  PotentialCamera = 32,
21
- SpyDeviceDisconnected = 33
25
+ SpyDeviceDisconnected = 33,
26
+ StopSharingScreen = 34,
27
+ ChangeDevices = 39
28
+ }
29
+ export declare enum FinishRealtimeWarningCategory {
30
+ Face = 0,
31
+ People = 1
22
32
  }
23
33
  export declare enum AlertType {
24
34
  Audio = 1,
@@ -1,5 +1,5 @@
1
1
  import { ProctoringSessionOptions } from "../../proctoring/options/ProctoringOptions";
2
- import { ProctoringSession } from "../proctoring/ProctoringSession";
2
+ import { AlertCategory, AlertType, ProctoringSession } from "../proctoring/ProctoringSession";
3
3
  import { IRecorder } from "./IRecorder";
4
4
  export declare class AlertRecorder implements IRecorder {
5
5
  private alerts;
@@ -18,4 +18,8 @@ export declare class AlertRecorder implements IRecorder {
18
18
  saveOnSession(session: ProctoringSession): Promise<void>;
19
19
  private onLostFocus;
20
20
  private onReturnFocus;
21
+ addAlert({ alert, type }: {
22
+ alert: AlertCategory;
23
+ type: AlertType;
24
+ }): void;
21
25
  }
@@ -32,6 +32,10 @@ export declare class CameraRecorder implements IRecorder {
32
32
  filesToUpload: File[];
33
33
  private intervalNoiseDetection;
34
34
  private volumeMeter;
35
+ private animationFrameId;
36
+ private isCanvasLoopActive;
37
+ private hardwareStream;
38
+ private internalClonedStream;
35
39
  constructor(options: {
36
40
  cameraId?: string;
37
41
  microphoneId?: string;
@@ -59,6 +63,7 @@ export declare class CameraRecorder implements IRecorder {
59
63
  pauseRecording(): Promise<void>;
60
64
  resumeRecording(): Promise<void>;
61
65
  photoShotsCycle(): void;
66
+ getCurrentImageBase64(): Promise<string>;
62
67
  captureFrame(): void;
63
68
  sendFrame(): void;
64
69
  download(file: File): void;
@@ -66,4 +71,5 @@ export declare class CameraRecorder implements IRecorder {
66
71
  getFile(file: string, name: string, type: string): Promise<File>;
67
72
  noiseWait: number;
68
73
  private onNoiseDetected;
74
+ private createRotatedStream;
69
75
  }
@@ -12,6 +12,10 @@ export declare class ScreenRecorder implements IRecorder {
12
12
  constructor(options: {
13
13
  allowOnlyFirstMonitor: boolean;
14
14
  allowMultipleMonitors: boolean;
15
+ screenRecorderOptions: {
16
+ width: number;
17
+ height: number;
18
+ };
15
19
  onStopSharingScreenCallback: () => void;
16
20
  onBufferSizeError?: boolean;
17
21
  onBufferSizeErrorCallback: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor",
3
- "version": "2.3.5",
3
+ "version": "2.5.0",
4
4
  "description": "Modulo web de gravação do EasyProctor",
5
5
  "main": "./index.js",
6
6
  "module": "./esm/index.js",
@@ -2,6 +2,7 @@ import { ServiceType } from '../proctoring/proctoring';
2
2
  import { BackendService } from '../new-flow/backend/BackendService';
3
3
  declare const init: (backend: BackendService) => BackendService;
4
4
  declare const trackers: {
5
+ registerDevicesChecked: (proctoringId: string, success: boolean, description: string) => Promise<string>;
5
6
  registerStart: (proctoringId: string, success: boolean, description: string) => Promise<string>;
6
7
  registerFinish: (proctoringId: string, success: boolean, description: string) => Promise<string>;
7
8
  registerError: (proctoringId: string, description: string) => Promise<string>;
@@ -11,5 +11,10 @@ export interface ProctoringSessionOptions {
11
11
  useGeolocation?: boolean;
12
12
  useSpyScan?: boolean;
13
13
  useExternalCamera?: boolean;
14
+ useChallenge?: boolean;
15
+ screenRecorderOptions?: {
16
+ width: number;
17
+ height: number;
18
+ };
14
19
  }
15
20
  export declare const getDefaultProctoringOptions: ProctoringSessionOptions;
@@ -15,6 +15,7 @@ export interface ProctoringContext {
15
15
  }
16
16
  export interface ProctoringFinisherOptions {
17
17
  onProgress?: (percentage: number) => void;
18
+ onFinish?: (score: number, approved: boolean) => void;
18
19
  }
19
20
  export interface ProctoringChangeDevicesOptions {
20
21
  status?: (devices: DevicesChanged) => void;
@@ -40,6 +41,7 @@ export declare class Proctoring {
40
41
  private readonly repository;
41
42
  private readonly repositoryDevices;
42
43
  private extension;
44
+ private deviceData;
43
45
  private paramsConfig;
44
46
  private proctoringId;
45
47
  private insights?;
@@ -61,10 +63,13 @@ export declare class Proctoring {
61
63
  setOnFocusCallback(cb: () => void): void;
62
64
  private onChangeDevicesCallback;
63
65
  onChangeDevices(options?: ProctoringChangeDevicesOptions): Promise<void>;
66
+ private convertRealtimeCategoryToAlertCategory;
67
+ private convertRealtimeTypeToWarningType;
64
68
  private onRealtimeAlertsCallback;
65
69
  onRealtimeAlerts(options?: ProctoringRealtimeAlertsOptions): Promise<void>;
66
70
  private onBufferSizeErrorCallback;
67
71
  setOnBufferSizeErrorCallback(cb: (cameraStream?: any) => void): void;
72
+ setDeviceCheckData(data: any): void;
68
73
  constructor(context: ProctoringContext);
69
74
  private createRecorders;
70
75
  login(): Promise<void>;
@@ -3,7 +3,7 @@ import enumarateDevices from "../modules/enumarateDevices";
3
3
  import { ProctoringContext } from "./proctoring";
4
4
  export declare function useProctoring(proctoringOptions: ProctoringContext, enviromentConfig?: string): {
5
5
  login: () => Promise<void>;
6
- start: (options?: import("./options/ProctoringOptions").ProctoringSessionOptions, _videoOptions?: Partial<import("./options/ProctoringVideoOptions").ProctoringVideoOptions>) => Promise<import("../dtos/StartProctoringResponse").default>;
6
+ start: (parameters: any) => Promise<import("../dtos/StartProctoringResponse").default>;
7
7
  finish: (options?: import("./proctoring").ProctoringFinisherOptions) => Promise<void>;
8
8
  onFocus: (cb: () => void) => void;
9
9
  onLostFocus: (cb: () => void) => void;