easyproctor-hml 2.7.13 → 2.8.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/esm/index.js +1078 -85
- package/extension/extensionEasyCatcher.d.ts +11 -0
- package/extension/{extension.d.ts → extensionEasyProctor.d.ts} +1 -1
- package/index.js +1078 -85
- package/new-flow/checkers/DeviceCheckerUI.d.ts +11 -0
- package/new-flow/chunk/BackgroundUploadService.d.ts +38 -0
- package/new-flow/chunk/ChunkStorageService.d.ts +25 -0
- package/new-flow/recorders/CameraRecorder.d.ts +23 -2
- package/package.json +1 -1
- package/proctoring/options/ProctoringOptions.d.ts +1 -0
- package/proctoring/proctoring.d.ts +5 -0
- package/proctoring/useProctoring.d.ts +2 -0
- package/unpkg/easyproctor.min.js +44 -41
|
@@ -12,6 +12,8 @@ export declare class DeviceCheckerUI {
|
|
|
12
12
|
videoOptions: ProctoringVideoOptions;
|
|
13
13
|
cameraRecorder: CameraRecorder;
|
|
14
14
|
volumeMeter: VolumeMeter | undefined;
|
|
15
|
+
private autoConfirmTimer;
|
|
16
|
+
private autoConfirmSeconds;
|
|
15
17
|
constructor(options: ProctoringSessionOptions | undefined, _videoOptions: ProctoringVideoOptions);
|
|
16
18
|
checkDevicesInterface(): void;
|
|
17
19
|
setSelectOption(options: ProctoringSessionOptions, changeSelectedDevice: (arg0: {
|
|
@@ -29,6 +31,15 @@ export declare class DeviceCheckerUI {
|
|
|
29
31
|
}): any;
|
|
30
32
|
}): Promise<void>;
|
|
31
33
|
closeModal(): void;
|
|
34
|
+
verifyAutoConfirm(status: {
|
|
35
|
+
allowedResolution: boolean;
|
|
36
|
+
allowedPositionFace: boolean;
|
|
37
|
+
allowedAmbient: boolean;
|
|
38
|
+
allowedMicrophone: boolean;
|
|
39
|
+
allowedSpyScan: boolean | null;
|
|
40
|
+
}): void;
|
|
41
|
+
private startAutoConfirm;
|
|
42
|
+
private stopAutoConfirm;
|
|
32
43
|
modalActions(closeCheckDevices: {
|
|
33
44
|
(): Promise<void>;
|
|
34
45
|
(): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BackendService } from "../backend/BackendService";
|
|
2
|
+
import { ChunkStorageService } from "./ChunkStorageService";
|
|
3
|
+
export interface BackgroundUploadConfig {
|
|
4
|
+
pollInterval?: number;
|
|
5
|
+
maxRetries?: number;
|
|
6
|
+
baseRetryDelay?: number;
|
|
7
|
+
cleanAfterUpload?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class BackgroundUploadService {
|
|
10
|
+
private readonly config;
|
|
11
|
+
private readonly chunkStorage;
|
|
12
|
+
private readonly backend;
|
|
13
|
+
private readonly proctoringId;
|
|
14
|
+
private readonly token;
|
|
15
|
+
private pollTimer;
|
|
16
|
+
private isProcessing;
|
|
17
|
+
private isRunning;
|
|
18
|
+
private retryCount;
|
|
19
|
+
private sessionUrl;
|
|
20
|
+
private currentOffset;
|
|
21
|
+
private totalBytesPurged;
|
|
22
|
+
private readonly STORAGE_KEY_PREFIX;
|
|
23
|
+
private readonly GCS_CHUNK_SIZE;
|
|
24
|
+
onChunkUploaded?: (chunkId: number, chunkIndex: number) => void;
|
|
25
|
+
onUploadError?: (chunkId: number, error: any) => void;
|
|
26
|
+
constructor(proctoringId: string, token: string, backend: BackendService, chunkStorage: ChunkStorageService, config?: BackgroundUploadConfig);
|
|
27
|
+
private loadSessionState;
|
|
28
|
+
private saveSessionState;
|
|
29
|
+
private clearSessionState;
|
|
30
|
+
start(): void;
|
|
31
|
+
stop(): void;
|
|
32
|
+
flush(): Promise<void>;
|
|
33
|
+
private syncOffset;
|
|
34
|
+
private processQueue;
|
|
35
|
+
private uploadData;
|
|
36
|
+
static recoverPendingUploads(backend: BackendService, token: string): Promise<string[]>;
|
|
37
|
+
private sleep;
|
|
38
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface VideoChunk {
|
|
2
|
+
id?: number;
|
|
3
|
+
proctoringId: string;
|
|
4
|
+
chunkIndex: number;
|
|
5
|
+
arrayBuffer: ArrayBuffer;
|
|
6
|
+
timestamp: number;
|
|
7
|
+
uploaded: number;
|
|
8
|
+
mimeType: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class ChunkStorageService {
|
|
11
|
+
private static readonly DB_NAME;
|
|
12
|
+
private static readonly DB_VERSION;
|
|
13
|
+
private static readonly STORE_NAME;
|
|
14
|
+
private db;
|
|
15
|
+
connect(): Promise<IDBDatabase>;
|
|
16
|
+
saveChunk(chunk: Omit<VideoChunk, "id">): Promise<number>;
|
|
17
|
+
getPendingChunks(proctoringId: string): Promise<VideoChunk[]>;
|
|
18
|
+
getAllChunks(proctoringId: string): Promise<VideoChunk[]>;
|
|
19
|
+
markAsUploaded(chunkId: number): Promise<void>;
|
|
20
|
+
clearUploadedChunks(proctoringId: string): Promise<void>;
|
|
21
|
+
clearAllChunks(proctoringId: string): Promise<void>;
|
|
22
|
+
hasAnyPendingChunks(): Promise<boolean>;
|
|
23
|
+
getPendingProctoringIds(): Promise<string[]>;
|
|
24
|
+
close(): void;
|
|
25
|
+
}
|
|
@@ -40,6 +40,17 @@ export declare class CameraRecorder implements IRecorder {
|
|
|
40
40
|
private videoElement;
|
|
41
41
|
private duration;
|
|
42
42
|
stopped: boolean;
|
|
43
|
+
private static readonly CHUNK_TIMESLICE_MS;
|
|
44
|
+
private static readonly LS_SESSION_KEY;
|
|
45
|
+
private chunkStorage;
|
|
46
|
+
private backgroundUpload;
|
|
47
|
+
private chunkIndex;
|
|
48
|
+
private pendingChunkSaves;
|
|
49
|
+
onSessionInterrupted?: () => void;
|
|
50
|
+
onVisibilityRestored?: () => void;
|
|
51
|
+
private boundVisibilityHandler;
|
|
52
|
+
private boundPageHideHandler;
|
|
53
|
+
private get isChunkEnabled();
|
|
43
54
|
constructor(options: {
|
|
44
55
|
cameraId?: string;
|
|
45
56
|
microphoneId?: string;
|
|
@@ -58,6 +69,17 @@ export declare class CameraRecorder implements IRecorder {
|
|
|
58
69
|
getStartTime: () => any;
|
|
59
70
|
getDuration: () => any;
|
|
60
71
|
setProctoringId(proctoringId: string): void;
|
|
72
|
+
private persistSessionState;
|
|
73
|
+
private clearSessionState;
|
|
74
|
+
static checkForActiveSession(): {
|
|
75
|
+
proctoringId: string;
|
|
76
|
+
status: string;
|
|
77
|
+
timestamp: number;
|
|
78
|
+
} | null;
|
|
79
|
+
private setupLifecycleListeners;
|
|
80
|
+
private removeLifecycleListeners;
|
|
81
|
+
private handleVisibilityChange;
|
|
82
|
+
private handlePageHide;
|
|
61
83
|
initializeDetectors(): Promise<void>;
|
|
62
84
|
configImageCapture(): void;
|
|
63
85
|
currentRetries: number;
|
|
@@ -68,6 +90,7 @@ export declare class CameraRecorder implements IRecorder {
|
|
|
68
90
|
attachAndWarmup(stream: MediaStream): Promise<void>;
|
|
69
91
|
startRecording(): Promise<void>;
|
|
70
92
|
stopRecording(): Promise<void>;
|
|
93
|
+
private handleNewChunk;
|
|
71
94
|
pauseRecording(): Promise<void>;
|
|
72
95
|
resumeRecording(): Promise<void>;
|
|
73
96
|
getCurrentImageBase64(): Promise<string>;
|
|
@@ -79,6 +102,4 @@ export declare class CameraRecorder implements IRecorder {
|
|
|
79
102
|
download(file: File): void;
|
|
80
103
|
saveOnSession(session: ProctoringSession): Promise<void>;
|
|
81
104
|
getFile(file: string, name: string, type: string): Promise<File>;
|
|
82
|
-
noiseWait: number;
|
|
83
|
-
private onNoiseDetected;
|
|
84
105
|
}
|
package/package.json
CHANGED
|
@@ -41,6 +41,7 @@ export declare class Proctoring {
|
|
|
41
41
|
private readonly repository;
|
|
42
42
|
private readonly repositoryDevices;
|
|
43
43
|
private extension;
|
|
44
|
+
private extensionEasycatcher;
|
|
44
45
|
private deviceData;
|
|
45
46
|
private paramsConfig;
|
|
46
47
|
private proctoringId;
|
|
@@ -100,4 +101,8 @@ export declare class Proctoring {
|
|
|
100
101
|
audioStream?: MediaStream;
|
|
101
102
|
_screenStream: MediaStream | undefined;
|
|
102
103
|
}>;
|
|
104
|
+
private isChallengeRunning;
|
|
105
|
+
private challengeId;
|
|
106
|
+
startChallenge(templateId: string): Promise<void>;
|
|
107
|
+
stopChallenge(): Promise<void>;
|
|
103
108
|
}
|
|
@@ -5,6 +5,8 @@ export declare function useProctoring(proctoringOptions: ProctoringContext, envi
|
|
|
5
5
|
login: () => Promise<void>;
|
|
6
6
|
start: (parameters: any, videoOptions: any) => Promise<import("../dtos/StartProctoringResponse").default>;
|
|
7
7
|
finish: (options?: import("./proctoring").ProctoringFinisherOptions) => Promise<void>;
|
|
8
|
+
startChallenge: (templateId: string) => Promise<void>;
|
|
9
|
+
stopChallenge: () => Promise<void>;
|
|
8
10
|
onFocus: (cb: () => void) => Promise<void>;
|
|
9
11
|
onLostFocus: (cb: () => void) => Promise<void>;
|
|
10
12
|
onChangeDevices: (options?: import("./proctoring").ProctoringChangeDevicesOptions) => Promise<void>;
|