easyproctor 2.2.0 → 2.3.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.
@@ -11,7 +11,12 @@ export declare class BackendService {
11
11
  token?: string;
12
12
  });
13
13
  selectBaseUrl(type: string): "https://proctoring-api-dev.easyproctor.tech/api" | "https://proctoring-api-hml.easyproctor.tech/api" | "https://proctoring-api.easyproctor.tech/api";
14
+ getSocketUrl(): string;
14
15
  loginAuth(cpf: string, base64: string): Promise<any>;
16
+ externalCameraRegister(body: any): Promise<any>;
17
+ externalCameraStartSession(): Promise<any>;
18
+ externalCameraStart(proctoringId: string): Promise<any>;
19
+ externalCameraFinish(externalSessionId: string): Promise<any>;
15
20
  confirmStart(proctoringOptions: {
16
21
  examId: any;
17
22
  clientId: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Modulo web de gravação do EasyProctor",
5
5
  "main": "./index.js",
6
6
  "module": "./esm/index.js",
@@ -24,10 +24,11 @@
24
24
  "devDependencies": {
25
25
  "@types/dom-mediacapture-record": "^1.0.11",
26
26
  "@types/file-saver": "^2.0.7",
27
+ "@types/qrcode": "^1.5.5",
27
28
  "@types/recordrtc": "^5.6.8",
28
29
  "@typescript-eslint/eslint-plugin": "^5.8.0",
29
30
  "@typescript-eslint/parser": "^5.8.0",
30
- "esbuild": "^0.14.47",
31
+ "esbuild": "^0.25.9",
31
32
  "esbuild-serve": "^1.0.1",
32
33
  "eslint": "^8.2.0",
33
34
  "eslint-plugin-html": "^6.2.0",
@@ -36,8 +37,10 @@
36
37
  "dependencies": {
37
38
  "@mediapipe/tasks-audio": "^0.10.9",
38
39
  "@mediapipe/tasks-vision": "^0.10.9",
40
+ "@microsoft/signalr": "^9.0.6",
39
41
  "axios": "^1.1.3",
40
42
  "file-saver": "^2.0.5",
43
+ "qrcode": "^1.5.4",
41
44
  "recordrtc": "^5.6.2"
42
45
  }
43
46
  }
@@ -0,0 +1,52 @@
1
+ import { ProctoringContext } from "./proctoring";
2
+ export interface ExternalCameraCheckReturn {
3
+ result: boolean;
4
+ imageUrl?: string;
5
+ }
6
+ export declare class ActionMessage {
7
+ message?: string;
8
+ command: string;
9
+ }
10
+ export declare enum ExternalCameraStatusEnum {
11
+ WAITING = -1,
12
+ STARTED = 0,
13
+ QR_CODE = 1,
14
+ POSITION = 2,
15
+ FINISHED = 3,
16
+ ERROR = 9
17
+ }
18
+ export declare class ExternalCameraChecker {
19
+ private static isModalOpen;
20
+ private proctoringId;
21
+ private capturePhotoUrl;
22
+ private qrCodeBase64Image;
23
+ private readonly backend;
24
+ private readonly context;
25
+ private onRealtimeAlertsCallback;
26
+ private onQrCodeReadedCallback;
27
+ private onTakePictureCallback;
28
+ private waitingPositionValidation;
29
+ private externalSessionId;
30
+ private currentStep;
31
+ private resolvePromise;
32
+ private connection;
33
+ constructor(context: ProctoringContext, onRealtimeAlertsCallback: (response: any) => void);
34
+ setProctoringId(proctoringId: string): Promise<void>;
35
+ getExternalCameraSessionId(): string;
36
+ reset(): Promise<void>;
37
+ takePicture(waitingPositionValidation: boolean, onTakePictureCallback: (response: any) => void): Promise<void>;
38
+ startSession(onQrCodeReadedCallback: (response: any) => void): Promise<string>;
39
+ checkExternalCamera(): Promise<ExternalCameraCheckReturn>;
40
+ private buildInterface;
41
+ private renderCurrentStep;
42
+ private renderQRCodeStep;
43
+ private renderPhotoStep;
44
+ private renderImageStep;
45
+ private nextState;
46
+ initializeWebSocketConnection(): Promise<void>;
47
+ private handleWebSocketAction;
48
+ private handleWebSocketMessage;
49
+ disconnectWebSocket(): Promise<void>;
50
+ closeCheckExternalCamera(): void;
51
+ private applyStyles;
52
+ }
@@ -10,5 +10,6 @@ export interface ProctoringSessionOptions {
10
10
  onBufferSizeError?: boolean;
11
11
  useGeolocation?: boolean;
12
12
  useSpyScan?: boolean;
13
+ useExternalCamera?: boolean;
13
14
  }
14
15
  export declare const getDefaultProctoringOptions: ProctoringSessionOptions;
@@ -51,6 +51,7 @@ export declare class Proctoring {
51
51
  private recorder;
52
52
  private allRecorders;
53
53
  private spyCam;
54
+ private appChecker;
54
55
  private onStopSharingScreenCallback;
55
56
  setOnStopSharingScreenCallback(cb: () => void): void;
56
57
  private onLostFocusCallback;
@@ -66,6 +67,7 @@ export declare class Proctoring {
66
67
  constructor(context: ProctoringContext);
67
68
  private createRecorders;
68
69
  login(): Promise<void>;
70
+ startExternalCameraSession(cb: () => void): Promise<void>;
69
71
  start(options?: ProctoringSessionOptions, _videoOptions?: Partial<ProctoringVideoOptions>): Promise<StartProctoringResponse>;
70
72
  private cancel;
71
73
  finish(options?: ProctoringFinisherOptions): Promise<void>;
@@ -21,4 +21,8 @@ export declare function useProctoring(proctoringOptions: ProctoringContext, envi
21
21
  checkIfhasMultipleMonitors: typeof checkIfhasMultipleMonitors;
22
22
  onStopSharingScreen: (cb: () => void) => void;
23
23
  signInTerms: () => Promise<any>;
24
+ checkExternalCamera: () => Promise<import("./ExternalCameraChecker").ExternalCameraCheckReturn>;
25
+ startExternalCameraSession: (onQrCodeReadedCallback: (response: any) => void) => Promise<string>;
26
+ takeExternalCameraPicture: (waitingPositionValidation: boolean, onTakePictureCallback: (response: any) => void) => Promise<void>;
27
+ resetExternalCameraSession: () => Promise<void>;
24
28
  };