easyproctor-hml 0.0.19 → 0.0.21

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.
@@ -22,7 +22,8 @@ export declare class BackendService {
22
22
  clientId: any;
23
23
  token: any;
24
24
  }): Promise<string>;
25
- getAzureSignedUrl(token: string, file: File): Promise<string>;
25
+ getAzureSignedUrl(token: string, file: File, proctoringId?: string): Promise<string>;
26
+ getAzureSignedUrlImage(token: string, file: File): Promise<string>;
26
27
  getAwsSignedUrl(token: string, file: File): Promise<string>;
27
28
  sendAwsToAzure(token: string, file: File): Promise<void>;
28
29
  saveScreenAlerts(proctoringOptions: {
@@ -1,19 +1,29 @@
1
+ /// <reference types="node" />
1
2
  import { RecordRTCPromisesHandler } from "recordrtc";
2
3
  import { ProctoringSession } from "../proctoring/ProctoringSession";
3
4
  import { IRecorder } from "./IRecorder";
5
+ import { BackendService } from "../backend/BackendService";
6
+ import { AzureUploadService } from "../upload/AzureUploadService";
4
7
  export declare class CameraRecorder implements IRecorder {
5
8
  private blobs;
6
9
  private options;
7
10
  private videoOptions;
8
11
  recorder: RecordRTCPromisesHandler;
9
12
  cameraStream: MediaStream;
13
+ imageCount: number;
14
+ imageCapture: any;
15
+ imageInterval: NodeJS.Timer;
16
+ backend: BackendService | undefined;
17
+ backendToken: string | undefined;
18
+ proctoringId: string | undefined;
19
+ azureUpload: AzureUploadService | undefined;
10
20
  constructor(options: {
11
21
  cameraId?: string;
12
22
  microphoneId?: string;
13
23
  }, videoOptions: {
14
24
  width: number;
15
25
  height: number;
16
- });
26
+ }, backend?: BackendService, backendToken?: string, proctoringId?: string);
17
27
  file?: File;
18
28
  recordingStart: () => any;
19
29
  recordingStop: () => any;
@@ -23,5 +33,6 @@ export declare class CameraRecorder implements IRecorder {
23
33
  stopRecording(): Promise<void>;
24
34
  pauseRecording(): Promise<void>;
25
35
  resumeRecording(): Promise<void>;
36
+ photoShotsCycle(): void;
26
37
  saveOnSession(session: ProctoringSession): Promise<void>;
27
38
  }
@@ -1,9 +1,12 @@
1
+ export interface VolumeMeterOptions {
2
+ setVolume?: (volume: number) => void;
3
+ }
1
4
  export declare class VolumeMeter {
2
5
  private volume;
3
6
  private stream;
4
7
  private scriptProcessor;
5
8
  constructor(stream: MediaStream);
6
- start(): Promise<any>;
9
+ start(options?: VolumeMeterOptions): Promise<any>;
7
10
  stop(): void;
8
11
  getVolume(): any;
9
12
  private setVolume;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor-hml",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "Modulo web de gravação do EasyProctor",
5
5
  "main": "./index.js",
6
6
  "module": "./esm/index.js",
@@ -25,6 +25,7 @@
25
25
  "@types/dom-mediacapture-record": "^1.0.11",
26
26
  "@types/ebml": "^3.0.2",
27
27
  "@types/recordrtc": "^5.6.8",
28
+ "@types/w3c-image-capture": "^1.0.7",
28
29
  "@typescript-eslint/eslint-plugin": "^5.8.0",
29
30
  "@typescript-eslint/parser": "^5.8.0",
30
31
  "esbuild": "^0.14.47",
@@ -0,0 +1,16 @@
1
+ export interface cameraInterface {
2
+ base64: string;
3
+ }
4
+ export declare class CapturePhoto {
5
+ private cameraRecorder;
6
+ private base64;
7
+ constructor();
8
+ takePicture(title: string, subtitle: string): Promise<cameraInterface>;
9
+ startCapture(cameraId?: string): Promise<void>;
10
+ shot(): void;
11
+ private takePictureInterface;
12
+ private setSelectOption;
13
+ private onSelectOptionChange;
14
+ private closeInterface;
15
+ private addStyleMask;
16
+ }
@@ -1,20 +1,31 @@
1
1
  import { ProctoringSessionOptions } from "./options/ProctoringOptions";
2
2
  import { ProctoringVideoOptions } from "./options/ProctoringVideoOptions";
3
+ export interface checkDevicesInterfaceReturn {
4
+ cameraId: string;
5
+ microphoneId: string;
6
+ }
7
+ export interface checkDevicesReturn {
8
+ cameraId: string;
9
+ microphoneId: string;
10
+ volumeRange: number;
11
+ }
3
12
  export declare class DeviceChecker {
4
13
  private options;
5
14
  private videoOptions;
6
15
  private cameraRecorder;
7
- private audioRecorder;
8
- private screenRecorder;
16
+ private volumeMeter;
17
+ private volumeMedia;
18
+ private volumeSum;
19
+ private volumeCounter;
9
20
  constructor();
10
- checkDevices(options?: ProctoringSessionOptions, _videoOptions?: ProctoringVideoOptions): Promise<unknown>;
21
+ checkDevices(options?: ProctoringSessionOptions, _videoOptions?: ProctoringVideoOptions): Promise<checkDevicesReturn>;
11
22
  private checkDevicesInterface;
12
- private startDevice;
13
23
  private videoDeviceInterface;
14
24
  private audioDeviceInterface;
25
+ private setSelectOption;
26
+ private onSelectOptionChange;
15
27
  startCheckDevices(options: ProctoringSessionOptions | undefined, _videoOptions: Partial<ProctoringVideoOptions>): Promise<{
16
28
  cameraStream: MediaStream;
17
- _screenStream: MediaStream | undefined;
18
29
  }>;
19
30
  closeCheckDevices(): Promise<void>;
20
31
  }
@@ -11,7 +11,8 @@ export declare function useProctoring(proctoringOptions: {
11
11
  onLostFocus: (cb: () => void) => void;
12
12
  onNoiseDetected: (cb: () => void) => void;
13
13
  onChangeDevices: (options?: import("./proctoring").ProctoringChangeDevicesOptions) => Promise<void>;
14
- checkDevices: (options?: import("./options/ProctoringOptions").ProctoringSessionOptions, _videoOptions?: import("./options/ProctoringVideoOptions").ProctoringVideoOptions) => Promise<unknown>;
14
+ checkDevices: (options?: import("./options/ProctoringOptions").ProctoringSessionOptions, _videoOptions?: import("./options/ProctoringVideoOptions").ProctoringVideoOptions) => Promise<import("./DeviceChecker").checkDevicesReturn>;
15
+ capturePhoto: (title: string, subtitle: string) => Promise<import("./CapturePhoto").cameraInterface>;
15
16
  pause: () => Promise<void>;
16
17
  resume: () => Promise<{
17
18
  cameraStream: MediaStream;