easyproctor 2.1.0 → 2.2.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.
- package/README.md +10 -0
- package/errors/errors.d.ts +1 -0
- package/esm/index.js +856 -148
- package/index.js +856 -148
- package/interfaces/ParamsConfig.d.ts +3 -0
- package/modules/SpyCam.d.ts +31 -0
- package/new-flow/backend/BackendService.d.ts +3 -1
- package/new-flow/backend/SpyCamBackendService.d.ts +27 -0
- package/new-flow/checkers/DeviceCheckerService.d.ts +6 -1
- package/new-flow/checkers/DeviceCheckerUI.d.ts +2 -0
- package/new-flow/proctoring/ProctoringSession.d.ts +12 -2
- package/new-flow/recorders/CameraRecorder.d.ts +8 -2
- package/new-flow/recorders/IRecorder.d.ts +3 -1
- package/package.json +2 -2
- package/plugins/insights.d.ts +3 -2
- package/plugins/recorder.d.ts +4 -1
- package/proctoring/SignTerm.d.ts +15 -0
- package/proctoring/options/ProctoringOptions.d.ts +1 -0
- package/proctoring/options/ProctoringVideoOptions.d.ts +1 -0
- package/proctoring/proctoring.d.ts +2 -1
- package/proctoring/useProctoring.d.ts +3 -2
- package/unpkg/easyproctor.min.js +34 -25
|
@@ -23,9 +23,12 @@ export type VideoBehaviourParameters = {
|
|
|
23
23
|
detectCellPhone?: boolean;
|
|
24
24
|
detectNoise?: boolean;
|
|
25
25
|
detectSpeech?: boolean;
|
|
26
|
+
retryEnabled?: boolean;
|
|
27
|
+
maxRetries?: number;
|
|
26
28
|
};
|
|
27
29
|
export default interface IParamsConfig {
|
|
28
30
|
audioBehaviourParameters?: AudioBehaviourParameters;
|
|
29
31
|
imageBehaviourParameters?: ImageBehaviourParameters;
|
|
30
32
|
videoBehaviourParameters?: VideoBehaviourParameters;
|
|
33
|
+
spyScanInterval?: number;
|
|
31
34
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DevicesInterface } from "../new-flow/backend/SpyCamBackendService";
|
|
2
|
+
import { ProctoringContext } from "../proctoring/proctoring";
|
|
3
|
+
export interface SpyCamDevice {
|
|
4
|
+
macAddress: string;
|
|
5
|
+
destinationsCount: number;
|
|
6
|
+
totalPackages: number;
|
|
7
|
+
packageRate: number;
|
|
8
|
+
rssi: number;
|
|
9
|
+
deviceType: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class SpyCam {
|
|
12
|
+
private backendService;
|
|
13
|
+
private readonly context;
|
|
14
|
+
private readonly backend;
|
|
15
|
+
private proctoringId;
|
|
16
|
+
private scanInterval;
|
|
17
|
+
private startTime;
|
|
18
|
+
private checkSpyCam;
|
|
19
|
+
private currentIsPlugged;
|
|
20
|
+
private options;
|
|
21
|
+
constructor(context: ProctoringContext, options: {
|
|
22
|
+
onRealtimeAlertsCallback?: (response: any) => void;
|
|
23
|
+
});
|
|
24
|
+
setProctoringId(proctoringId: string): void;
|
|
25
|
+
isPluggedIn(sendEvent?: boolean): Promise<boolean>;
|
|
26
|
+
isAlive(): Promise<boolean>;
|
|
27
|
+
connectAndScan(): Promise<any>;
|
|
28
|
+
devices({ deviceType, rssiThreshold, packageRateThreshold }: DevicesInterface): Promise<SpyCamDevice[]>;
|
|
29
|
+
startCheckSpyCam(spyScanInterval: number, { deviceType, rssiThreshold, packageRateThreshold }: DevicesInterface): Promise<void>;
|
|
30
|
+
stopCheckSpyCam(): void;
|
|
31
|
+
}
|
|
@@ -20,11 +20,13 @@ export declare class BackendService {
|
|
|
20
20
|
getParamsConfig(proctoringOptions: ProctoringContext): Promise<IParamsConfig>;
|
|
21
21
|
getSignedUrlImage(token: string, body: any): Promise<string[]>;
|
|
22
22
|
getSignedUrl(token: string, file: File, proctoringId?: string): Promise<string>;
|
|
23
|
-
|
|
23
|
+
saveAlerts(proctoringOptions: ProctoringContext, proctoringSession: ProctoringSession): Promise<void>;
|
|
24
24
|
finishAndSendUrls(proctoringOptions: ProctoringContext, proctoringSession: ProctoringSession): Promise<void>;
|
|
25
25
|
log(eventName: string, properties?: {
|
|
26
26
|
[key: string]: any;
|
|
27
27
|
}): Promise<string>;
|
|
28
|
+
signTerm(): Promise<string>;
|
|
29
|
+
signTermUrl(): Promise<string>;
|
|
28
30
|
getServerHour(token: string): Promise<string>;
|
|
29
31
|
private makeRequest;
|
|
30
32
|
makeRequestAxios<R>(data: {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SpyCamDevice } from "../../modules/SpyCam";
|
|
2
|
+
export declare enum DeviceTypeEnum {
|
|
3
|
+
UNKNOWN = 0,
|
|
4
|
+
ROUTER = 1,
|
|
5
|
+
CLIENT_DEVICE = 2,
|
|
6
|
+
POTENCIAL_CAMERA = 3
|
|
7
|
+
}
|
|
8
|
+
export interface DevicesInterface {
|
|
9
|
+
deviceType?: DeviceTypeEnum;
|
|
10
|
+
rssiThreshold?: number;
|
|
11
|
+
packageRateThreshold?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class SpyCamBackendService {
|
|
14
|
+
private readonly baseUrl;
|
|
15
|
+
token: string;
|
|
16
|
+
constructor();
|
|
17
|
+
isAlive(): Promise<boolean>;
|
|
18
|
+
isPluggedIn(): Promise<boolean>;
|
|
19
|
+
ConnectAndScan(): Promise<any>;
|
|
20
|
+
Devices({ deviceType, rssiThreshold, packageRateThreshold, }: DevicesInterface): Promise<SpyCamDevice[]>;
|
|
21
|
+
makeRequestAxios<R>(data: {
|
|
22
|
+
path: string;
|
|
23
|
+
method: "GET" | "POST" | "PUT";
|
|
24
|
+
body?: any;
|
|
25
|
+
jwt: string;
|
|
26
|
+
}): Promise<R>;
|
|
27
|
+
}
|
|
@@ -9,6 +9,7 @@ export interface checkDevicesReturn {
|
|
|
9
9
|
allowedAmbient?: boolean;
|
|
10
10
|
allowedPositionFace?: boolean;
|
|
11
11
|
allowedMicrophone?: boolean;
|
|
12
|
+
allowedSpyScan?: boolean | null;
|
|
12
13
|
result: boolean;
|
|
13
14
|
faceDetectionAlerts?: {
|
|
14
15
|
status: string;
|
|
@@ -32,14 +33,17 @@ export declare class DeviceCheckerService {
|
|
|
32
33
|
private allowedAmbient;
|
|
33
34
|
private allowedPositionFace;
|
|
34
35
|
private allowedMicrophone;
|
|
36
|
+
private allowedSpyScan;
|
|
35
37
|
private readonly backend;
|
|
36
38
|
private readonly context;
|
|
37
39
|
private noiseLimit;
|
|
38
40
|
private onUpdateCb;
|
|
41
|
+
private spycam;
|
|
42
|
+
private spydevices;
|
|
39
43
|
constructor(context: ProctoringContext);
|
|
40
44
|
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>;
|
|
41
45
|
private onUpdateCallback;
|
|
42
|
-
checkDevices(options
|
|
46
|
+
checkDevices(options?: ProctoringSessionOptions, _videoOptions?: ProctoringVideoOptions): Promise<checkDevicesReturn>;
|
|
43
47
|
private isUnderResolution;
|
|
44
48
|
private realtimeAlerts;
|
|
45
49
|
private videoDeviceInterface;
|
|
@@ -51,4 +55,5 @@ export declare class DeviceCheckerService {
|
|
|
51
55
|
cameraStream: MediaStream;
|
|
52
56
|
}>;
|
|
53
57
|
closeCheckDevices(): Promise<void>;
|
|
58
|
+
private checkSpyScan;
|
|
54
59
|
}
|
|
@@ -38,6 +38,8 @@ export declare class DeviceCheckerUI {
|
|
|
38
38
|
description: string;
|
|
39
39
|
type?: string;
|
|
40
40
|
}): void;
|
|
41
|
+
waitingSpyDevices(waiting: boolean): void;
|
|
42
|
+
isSpyDevicesUI(allowedDevices: boolean): void;
|
|
41
43
|
isUnderResolutionUI(allowedResolution: boolean): void;
|
|
42
44
|
videoDeviceInterfaceUI(stream: MediaStream): void;
|
|
43
45
|
audioDeviceInterfaceUIAllowedAmbient(allowedAmbient: boolean): void;
|
|
@@ -15,13 +15,23 @@ export declare enum RecordingOrigin {
|
|
|
15
15
|
Mic = "Mic",
|
|
16
16
|
Camera = "Camera"
|
|
17
17
|
}
|
|
18
|
+
export declare enum AlertCategory {
|
|
19
|
+
LostFocus = 25,
|
|
20
|
+
PotentialCamera = 32,
|
|
21
|
+
SpyDeviceDisconnected = 33
|
|
22
|
+
}
|
|
18
23
|
export declare enum AlertType {
|
|
19
|
-
|
|
24
|
+
Audio = 1,
|
|
25
|
+
Video = 2,
|
|
26
|
+
Screen = 3,
|
|
27
|
+
Image = 4,
|
|
28
|
+
Environment = 5
|
|
20
29
|
}
|
|
21
30
|
export interface Alert {
|
|
22
31
|
begin: number;
|
|
23
32
|
end: number;
|
|
24
|
-
alert:
|
|
33
|
+
alert: AlertCategory;
|
|
34
|
+
type: AlertType;
|
|
25
35
|
}
|
|
26
36
|
export interface Recording {
|
|
27
37
|
origin: RecordingOrigin;
|
|
@@ -23,6 +23,7 @@ export declare class CameraRecorder implements IRecorder {
|
|
|
23
23
|
backend: BackendService | undefined;
|
|
24
24
|
backendToken: string | undefined;
|
|
25
25
|
proctoringId: string | undefined;
|
|
26
|
+
private recorderOptions;
|
|
26
27
|
upload: UploadService | undefined;
|
|
27
28
|
video: HTMLVideoElement;
|
|
28
29
|
canvas: HTMLCanvasElement;
|
|
@@ -35,7 +36,7 @@ export declare class CameraRecorder implements IRecorder {
|
|
|
35
36
|
cameraId?: string;
|
|
36
37
|
microphoneId?: string;
|
|
37
38
|
onBufferSizeError?: boolean;
|
|
38
|
-
onBufferSizeErrorCallback: () => void;
|
|
39
|
+
onBufferSizeErrorCallback: (cameraStream?: any) => void;
|
|
39
40
|
proctoringType?: "VIDEO" | "IMAGE" | "REALTIME";
|
|
40
41
|
onChangeDevicesCallback?: (devices: DevicesChanged) => void;
|
|
41
42
|
onRealtimeAlertsCallback?: (response: any) => void;
|
|
@@ -45,10 +46,15 @@ export declare class CameraRecorder implements IRecorder {
|
|
|
45
46
|
recordingStop: () => any;
|
|
46
47
|
recordingPause: () => any;
|
|
47
48
|
recordingResume: () => any;
|
|
49
|
+
getBufferSize: () => any;
|
|
48
50
|
setProctoringId(proctoringId: string): void;
|
|
49
51
|
initializeDetectors(): Promise<void>;
|
|
50
52
|
configImageCapture(): void;
|
|
51
|
-
|
|
53
|
+
currentRetries: number;
|
|
54
|
+
bufferError(e: any): Promise<void>;
|
|
55
|
+
startRecording(options?: {
|
|
56
|
+
retry?: boolean;
|
|
57
|
+
}): Promise<void>;
|
|
52
58
|
stopRecording(): Promise<void>;
|
|
53
59
|
pauseRecording(): Promise<void>;
|
|
54
60
|
resumeRecording(): Promise<void>;
|
|
@@ -2,7 +2,9 @@ import { ProctoringSession } from "../proctoring/ProctoringSession";
|
|
|
2
2
|
export declare enum RecordingType {
|
|
3
3
|
}
|
|
4
4
|
export interface IRecorder {
|
|
5
|
-
startRecording(
|
|
5
|
+
startRecording(options?: {
|
|
6
|
+
retry?: boolean;
|
|
7
|
+
}): Promise<void>;
|
|
6
8
|
pauseRecording(): Promise<void>;
|
|
7
9
|
resumeRecording(): Promise<void>;
|
|
8
10
|
stopRecording(): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easyproctor",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Modulo web de gravação do EasyProctor",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dev": "node scripts/serve.js -w",
|
|
20
20
|
"publish": "npm publish ./dist"
|
|
21
21
|
},
|
|
22
|
-
"author": "
|
|
22
|
+
"author": "IARIS",
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/dom-mediacapture-record": "^1.0.11",
|
package/plugins/insights.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DevicesChanged } from '../interfaces/Devices';
|
|
2
1
|
import { ServiceType } from '../proctoring/proctoring';
|
|
3
2
|
import { BackendService } from '../new-flow/backend/BackendService';
|
|
4
3
|
declare const init: (backend: BackendService) => BackendService;
|
|
@@ -9,10 +8,12 @@ declare const trackers: {
|
|
|
9
8
|
registerBrowserNotSupported: (proctoringId: string, description: string) => Promise<string>;
|
|
10
9
|
registerUpload: (proctoringId: string, success: boolean, description: string, serviceType: ServiceType, uploadTime?: number) => Promise<string>;
|
|
11
10
|
registerUploadFile: (proctoringId: string, description: string, fileType: string) => Promise<string>;
|
|
12
|
-
registerChangeDevice: (proctoringId: string, inOrOut: string,
|
|
11
|
+
registerChangeDevice: (proctoringId: string, inOrOut: string, description: string) => Promise<string>;
|
|
13
12
|
registerStopSharingScreen: (proctoringId: string, description: string) => Promise<string>;
|
|
14
13
|
registerErrorRecorderRTC: (proctoringId: string, description: string) => Promise<string>;
|
|
14
|
+
registerDownloadFile: (proctoringId: string, description: string) => Promise<string>;
|
|
15
15
|
registerOnBufferSizeError: (proctoringId: string, description: string) => Promise<string>;
|
|
16
16
|
registerAnotherStream: (proctoringId: string, description: string) => Promise<string>;
|
|
17
|
+
registerSaveOnSession: (proctoringId: string, description: string) => Promise<string>;
|
|
17
18
|
};
|
|
18
19
|
export { trackers, init };
|
package/plugins/recorder.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function setRecorderProctoringId(id: string): void;
|
|
2
|
+
export default function recorder(stream: MediaStream, buffer: Blob[], onBufferSizeError?: boolean, onBufferSizeErrorCallback?: (e?: any) => void, audio?: boolean): {
|
|
2
3
|
startRecording: () => Promise<void>;
|
|
3
4
|
stopRecording: () => Promise<void>;
|
|
4
5
|
pauseRecording: () => Promise<void>;
|
|
5
6
|
resumeRecording: () => Promise<void>;
|
|
7
|
+
recorderOptions: MediaRecorderOptions;
|
|
8
|
+
getBufferSize: () => number;
|
|
6
9
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProctoringContext } from "./proctoring";
|
|
2
|
+
export interface SignTermInterface {
|
|
3
|
+
cameraId: string;
|
|
4
|
+
microphoneId: string;
|
|
5
|
+
result: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class SignTerm {
|
|
8
|
+
private static isModalOpen;
|
|
9
|
+
private readonly backend;
|
|
10
|
+
constructor(context: ProctoringContext);
|
|
11
|
+
signInTerms(): Promise<any>;
|
|
12
|
+
private openModal;
|
|
13
|
+
closeModal(): Promise<void>;
|
|
14
|
+
applyStyles(element: any, styles: any): void;
|
|
15
|
+
}
|
|
@@ -50,6 +50,7 @@ export declare class Proctoring {
|
|
|
50
50
|
private serviceType;
|
|
51
51
|
private recorder;
|
|
52
52
|
private allRecorders;
|
|
53
|
+
private spyCam;
|
|
53
54
|
private onStopSharingScreenCallback;
|
|
54
55
|
setOnStopSharingScreenCallback(cb: () => void): void;
|
|
55
56
|
private onLostFocusCallback;
|
|
@@ -61,7 +62,7 @@ export declare class Proctoring {
|
|
|
61
62
|
private onRealtimeAlertsCallback;
|
|
62
63
|
onRealtimeAlerts(options?: ProctoringRealtimeAlertsOptions): Promise<void>;
|
|
63
64
|
private onBufferSizeErrorCallback;
|
|
64
|
-
setOnBufferSizeErrorCallback(cb: () => void): void;
|
|
65
|
+
setOnBufferSizeErrorCallback(cb: (cameraStream?: any) => void): void;
|
|
65
66
|
constructor(context: ProctoringContext);
|
|
66
67
|
private createRecorders;
|
|
67
68
|
login(): Promise<void>;
|
|
@@ -8,9 +8,9 @@ export declare function useProctoring(proctoringOptions: ProctoringContext, envi
|
|
|
8
8
|
onFocus: (cb: () => void) => void;
|
|
9
9
|
onLostFocus: (cb: () => void) => void;
|
|
10
10
|
onChangeDevices: (options?: import("./proctoring").ProctoringChangeDevicesOptions) => Promise<void>;
|
|
11
|
-
onBufferSizeError: (cb: () => void) => void;
|
|
11
|
+
onBufferSizeError: (cb: (cameraStream?: any) => void) => void;
|
|
12
12
|
onRealtimeAlerts: (options?: import("./proctoring").ProctoringRealtimeAlertsOptions) => Promise<void>;
|
|
13
|
-
checkDevices: (options
|
|
13
|
+
checkDevices: (options?: import("./options/ProctoringOptions").ProctoringSessionOptions, _videoOptions?: import("./options/ProctoringVideoOptions").ProctoringVideoOptions) => Promise<import("../new-flow/checkers/DeviceCheckerService").checkDevicesReturn>;
|
|
14
14
|
runCheckDevicesFlow: (options: import("./options/ProctoringOptions").ProctoringSessionOptions, _videoOptions: Partial<import("./options/ProctoringVideoOptions").ProctoringVideoOptions>, onModalConfirm: (resolve: (cameraId: string, microphoneId: string) => void) => void, onModalCancel: (reject: (error: Error) => void) => void, onUpdate: (feedback: any) => void) => Promise<any>;
|
|
15
15
|
changeSelectedDevice: ({ cameraId, microphoneId }: any) => Promise<{
|
|
16
16
|
cameraStream: MediaStream;
|
|
@@ -20,4 +20,5 @@ export declare function useProctoring(proctoringOptions: ProctoringContext, envi
|
|
|
20
20
|
checkPermissions: typeof checkPermissions;
|
|
21
21
|
checkIfhasMultipleMonitors: typeof checkIfhasMultipleMonitors;
|
|
22
22
|
onStopSharingScreen: (cb: () => void) => void;
|
|
23
|
+
signInTerms: () => Promise<any>;
|
|
23
24
|
};
|