@myinterview/widget-react 1.0.61-experimental → 1.0.61
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/dist/cjs/components/CountDown.d.ts +1 -3
- package/dist/cjs/components/Errors.d.ts +2 -2
- package/dist/cjs/components/Explanation.d.ts +1 -2
- package/dist/cjs/components/Question.d.ts +3 -2
- package/dist/cjs/components/QuestionItem.d.ts +2 -2
- package/dist/cjs/components/QuestionsList.d.ts +2 -2
- package/dist/cjs/components/RecorderModal.d.ts +4 -2
- package/dist/cjs/components/VideoCamera.d.ts +2 -3
- package/dist/cjs/components/ui/StartRecordingButton.d.ts +0 -1
- package/dist/cjs/i18n/config.d.ts +0 -28
- package/dist/cjs/index.js +11865 -2251
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces/candidateSessionInterface.d.ts +1 -1
- package/dist/cjs/interfaces/configInterface.d.ts +6 -6
- package/dist/cjs/interfaces/jobInterface.d.ts +3 -43
- package/dist/cjs/interfaces/recorderInterface.d.ts +2 -6
- package/dist/cjs/interfaces/uploaderInterface.d.ts +3 -5
- package/dist/cjs/interfaces/videoInterface.d.ts +1 -25
- package/dist/cjs/interfaces/widgetInterface.d.ts +10 -22
- package/dist/cjs/services/session.service.d.ts +1 -1
- package/dist/cjs/services/video.service.d.ts +3 -3
- package/dist/cjs/utils/constants.utils.d.ts +0 -1
- package/dist/cjs/utils/device.utils.d.ts +1 -1
- package/dist/cjs/utils/formatters.utils.d.ts +1 -1
- package/dist/esm/components/CountDown.d.ts +1 -3
- package/dist/esm/components/Errors.d.ts +2 -2
- package/dist/esm/components/Explanation.d.ts +1 -2
- package/dist/esm/components/Question.d.ts +3 -2
- package/dist/esm/components/QuestionItem.d.ts +2 -2
- package/dist/esm/components/QuestionsList.d.ts +2 -2
- package/dist/esm/components/RecorderModal.d.ts +4 -2
- package/dist/esm/components/VideoCamera.d.ts +2 -3
- package/dist/esm/components/ui/StartRecordingButton.d.ts +0 -1
- package/dist/esm/i18n/config.d.ts +0 -28
- package/dist/esm/index.js +11865 -2251
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces/candidateSessionInterface.d.ts +1 -1
- package/dist/esm/interfaces/configInterface.d.ts +6 -6
- package/dist/esm/interfaces/jobInterface.d.ts +3 -43
- package/dist/esm/interfaces/recorderInterface.d.ts +2 -6
- package/dist/esm/interfaces/uploaderInterface.d.ts +3 -5
- package/dist/esm/interfaces/videoInterface.d.ts +1 -25
- package/dist/esm/interfaces/widgetInterface.d.ts +10 -22
- package/dist/esm/services/session.service.d.ts +1 -1
- package/dist/esm/services/video.service.d.ts +3 -3
- package/dist/esm/utils/constants.utils.d.ts +0 -1
- package/dist/esm/utils/device.utils.d.ts +1 -1
- package/dist/esm/utils/formatters.utils.d.ts +1 -1
- package/dist/index.d.ts +9 -68
- package/package.json +9 -9
- package/dist/cjs/components/AnswerInstructions.d.ts +0 -7
- package/dist/cjs/components/AssessmentController.d.ts +0 -12
- package/dist/cjs/components/AssessmentFreeText.d.ts +0 -8
- package/dist/cjs/components/AssessmentMultiSelect.d.ts +0 -9
- package/dist/cjs/components/AssessmentSingleSelect.d.ts +0 -9
- package/dist/cjs/components/CharactersLimit.d.ts +0 -7
- package/dist/cjs/components/QuestionParamaters.d.ts +0 -9
- package/dist/cjs/components/ui/DotSeparator.d.ts +0 -2
- package/dist/cjs/interfaces/countDownInterface.d.ts +0 -23
- package/dist/cjs/machines/acceleratorMachines/counterMachine.d.ts +0 -5
- package/dist/esm/components/AnswerInstructions.d.ts +0 -7
- package/dist/esm/components/AssessmentController.d.ts +0 -12
- package/dist/esm/components/AssessmentFreeText.d.ts +0 -8
- package/dist/esm/components/AssessmentMultiSelect.d.ts +0 -9
- package/dist/esm/components/AssessmentSingleSelect.d.ts +0 -9
- package/dist/esm/components/CharactersLimit.d.ts +0 -7
- package/dist/esm/components/QuestionParamaters.d.ts +0 -9
- package/dist/esm/components/ui/DotSeparator.d.ts +0 -2
- package/dist/esm/interfaces/countDownInterface.d.ts +0 -23
- package/dist/esm/machines/acceleratorMachines/counterMachine.d.ts +0 -5
|
@@ -31,7 +31,7 @@ export declare const enum CandidateSessionWarnings {
|
|
|
31
31
|
OverconstrainedError = "OverconstrainedError",
|
|
32
32
|
SecurityError = "SecurityError"
|
|
33
33
|
}
|
|
34
|
-
export
|
|
34
|
+
export type CandidateSessionSourceType = 'direct' | 'email' | 'sms' | 'email_reminder' | 'sms_reminder';
|
|
35
35
|
export declare const enum CandidateSessionSourceMap {
|
|
36
36
|
direct_start_inter = "direct",
|
|
37
37
|
reminder_start_inter = "email_reminder",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { ICandidate } from './candidateInterface';
|
|
3
3
|
import { ICompany } from './companyInterface';
|
|
4
|
-
import {
|
|
4
|
+
import { IClientJob, IClientQuestion, IJob, IQuestion } from './jobInterface';
|
|
5
5
|
import { IVideo } from './videoInterface';
|
|
6
|
-
export
|
|
6
|
+
export type IMessageType = 'completed' | 'deadline' | 'applied' | 'inactiveJob';
|
|
7
7
|
export interface IOnFinish {
|
|
8
8
|
redirectUrl?: string;
|
|
9
9
|
video_id: string;
|
|
@@ -11,7 +11,7 @@ export interface IOnFinish {
|
|
|
11
11
|
export interface IOnError {
|
|
12
12
|
messageType: IMessageType;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type IEnv = 'dev' | 'staging' | 'production' | 'development' | 'local';
|
|
15
15
|
interface IConfig {
|
|
16
16
|
auth: string;
|
|
17
17
|
onWidgetClicked?: () => void;
|
|
@@ -20,7 +20,7 @@ interface IConfig {
|
|
|
20
20
|
onWidgetClose?: () => void;
|
|
21
21
|
openAnimation?: boolean;
|
|
22
22
|
debug?: boolean;
|
|
23
|
-
practiceQuestions?:
|
|
23
|
+
practiceQuestions?: IQuestion[];
|
|
24
24
|
overlay?: string;
|
|
25
25
|
introVideo?: string;
|
|
26
26
|
welcomeTitle?: string;
|
|
@@ -31,7 +31,7 @@ interface IConfig {
|
|
|
31
31
|
hideIntercom?: boolean;
|
|
32
32
|
disablePractice?: boolean;
|
|
33
33
|
}
|
|
34
|
-
export
|
|
34
|
+
export type IClientConfig = Omit<IConfig, 'practiceQuestions'> & {
|
|
35
35
|
practiceQuestions?: IClientQuestion[];
|
|
36
36
|
};
|
|
37
37
|
export interface IWidgetConfig {
|
|
@@ -47,7 +47,7 @@ export interface IWidgetConfig {
|
|
|
47
47
|
styleUrls?: string | string[];
|
|
48
48
|
fontsUrls?: string | string[];
|
|
49
49
|
}
|
|
50
|
-
export
|
|
50
|
+
export type IClientWidgetConfig = Omit<IWidgetConfig, 'job' | 'config'> & {
|
|
51
51
|
job: IClientJob;
|
|
52
52
|
config: IClientConfig;
|
|
53
53
|
};
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export declare const enum ANSWER_TYPES {
|
|
2
|
-
VIDEO = "video",
|
|
3
|
-
TEXT = "text",
|
|
4
|
-
MULTIPLE = "multiple_choice",
|
|
5
|
-
SINGLE = "single_choice"
|
|
6
|
-
}
|
|
7
1
|
export interface IQuestion {
|
|
8
2
|
question: string;
|
|
9
3
|
numOfRetakes: number;
|
|
@@ -13,44 +7,11 @@ export interface IQuestion {
|
|
|
13
7
|
videoQuestion?: string;
|
|
14
8
|
description?: string;
|
|
15
9
|
}
|
|
16
|
-
export
|
|
17
|
-
answerType?: `${ANSWER_TYPES.VIDEO}`;
|
|
18
|
-
}
|
|
19
|
-
export interface IQuestionTextAnswer extends IQuestion {
|
|
20
|
-
answerType: `${ANSWER_TYPES.TEXT}`;
|
|
21
|
-
config?: {
|
|
22
|
-
minChars: number;
|
|
23
|
-
maxChars?: number;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export interface IMultipleChoiceOptionDefinition {
|
|
27
|
-
id: string;
|
|
28
|
-
label: string;
|
|
29
|
-
}
|
|
30
|
-
export interface IQuestionChoiceAnswer extends IQuestion {
|
|
31
|
-
config?: {
|
|
32
|
-
shuffle?: boolean;
|
|
33
|
-
answers: IMultipleChoiceOptionDefinition[];
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export interface IQuestionMultipleAnswer extends IQuestionChoiceAnswer {
|
|
37
|
-
answerType: `${ANSWER_TYPES.MULTIPLE}`;
|
|
38
|
-
config?: {
|
|
39
|
-
minAnswers?: number;
|
|
40
|
-
maxAnswers?: number;
|
|
41
|
-
} & IQuestionChoiceAnswer['config'];
|
|
42
|
-
}
|
|
43
|
-
export interface IQuestionSingleAnswer extends IQuestionChoiceAnswer {
|
|
44
|
-
answerType: `${ANSWER_TYPES.SINGLE}`;
|
|
45
|
-
}
|
|
46
|
-
declare type leanQuestion<T> = Omit<T, 'numOfRetakes' | 'partDuration' | 'thinkingTime'> & {
|
|
10
|
+
export type IClientQuestion = Omit<IQuestion, 'numOfRetakes' | 'partDuration' | 'thinkingTime'> & {
|
|
47
11
|
attempts?: number;
|
|
48
12
|
duration?: number;
|
|
49
13
|
thinkingTime?: number;
|
|
50
14
|
};
|
|
51
|
-
export declare type ALL_JOB_QUESTIONS_TYPE = IQuestionDefault | IQuestionTextAnswer | IQuestionMultipleAnswer | IQuestionSingleAnswer;
|
|
52
|
-
export declare type ASSESSMENT_QUESTIONS_TYPE = Exclude<ALL_JOB_QUESTIONS_TYPE, IQuestionDefault>;
|
|
53
|
-
export declare type IClientQuestion = leanQuestion<IQuestionDefault> | leanQuestion<IQuestionTextAnswer> | leanQuestion<IQuestionMultipleAnswer> | leanQuestion<IQuestionSingleAnswer>;
|
|
54
15
|
export interface IJob {
|
|
55
16
|
language?: string;
|
|
56
17
|
transcriptLanguage?: string;
|
|
@@ -58,7 +19,7 @@ export interface IJob {
|
|
|
58
19
|
company?: string;
|
|
59
20
|
job_id?: string;
|
|
60
21
|
logo?: string;
|
|
61
|
-
questions?:
|
|
22
|
+
questions?: IQuestion[];
|
|
62
23
|
old_jobID?: string;
|
|
63
24
|
termsUrl?: string;
|
|
64
25
|
privacyUrl?: string;
|
|
@@ -66,7 +27,6 @@ export interface IJob {
|
|
|
66
27
|
company_id?: string;
|
|
67
28
|
jobID?: string;
|
|
68
29
|
}
|
|
69
|
-
export
|
|
30
|
+
export type IClientJob = Omit<IJob, 'questions'> & {
|
|
70
31
|
questions?: IClientQuestion[];
|
|
71
32
|
};
|
|
72
|
-
export {};
|
|
@@ -5,8 +5,8 @@ export declare const enum SPEED_TEST_LEVEL {
|
|
|
5
5
|
MEDIUM = 1,
|
|
6
6
|
HIGH = 2
|
|
7
7
|
}
|
|
8
|
-
export
|
|
9
|
-
|
|
8
|
+
export type mediaDeviceType = 'video' | 'audio';
|
|
9
|
+
type ConstrainProps = {
|
|
10
10
|
video: {
|
|
11
11
|
width: {
|
|
12
12
|
min?: number;
|
|
@@ -23,7 +23,6 @@ interface FacingMode {
|
|
|
23
23
|
export interface RecorderInterface {
|
|
24
24
|
facingMode: FacingMode;
|
|
25
25
|
microphoneRef: ActorRef<DoneInvokeEvent<any>> | null;
|
|
26
|
-
countDownRef: ActorRef<DoneInvokeEvent<any>> | null;
|
|
27
26
|
mediaStream?: MediaStream;
|
|
28
27
|
mediaRecorder?: MediaRecorder;
|
|
29
28
|
videoDevices: MediaDeviceInfo[];
|
|
@@ -61,8 +60,6 @@ export declare const enum STATES {
|
|
|
61
60
|
RECORDER_SENDING_BLOBS = "recorderSendingBlobs"
|
|
62
61
|
}
|
|
63
62
|
export declare const enum ACTIONS {
|
|
64
|
-
STOP_COUNT_DOWN_ACTOR = "STOP_COUNT_DOWN_ACTOR",
|
|
65
|
-
INIT_COUNT_DOWN_ACTOR = "INIT_COUNT_DOWN_ACTOR",
|
|
66
63
|
SESSION_EVENT = "SESSION_EVENT",
|
|
67
64
|
SENTRY = "SENTRY",
|
|
68
65
|
CONSOLE_LOG = "CONSOLE_LOG",
|
|
@@ -96,7 +93,6 @@ export declare const enum ACTIONS {
|
|
|
96
93
|
SET_MIC_ERROR = "SET_MIC_ERROR"
|
|
97
94
|
}
|
|
98
95
|
export declare const enum EVENTS {
|
|
99
|
-
SEND_RECORDER_TO_WAITING_STATE = "SEND_RECORDER_TO_WAITING_STATE",
|
|
100
96
|
CHANGE_VIDEO_DEVICE = "CHANGE_VIDEO_DEVICE",
|
|
101
97
|
CHANGE_AUDIO_DEVICE = "CHANGE_AUDIO_DEVICE",
|
|
102
98
|
START_RECORDING = "START_RECORDING",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IVideoFile } from './videoInterface';
|
|
2
2
|
interface ILastUploadChunkl {
|
|
3
3
|
loaded: number;
|
|
4
4
|
timeStamp: number;
|
|
@@ -11,11 +11,10 @@ export interface InitialState {
|
|
|
11
11
|
uploadSpeed: number;
|
|
12
12
|
lastUploadChunk: ILastUploadChunkl;
|
|
13
13
|
videoId: string;
|
|
14
|
-
videoFile:
|
|
14
|
+
videoFile: IVideoFile;
|
|
15
15
|
}
|
|
16
16
|
export declare const enum STATES {
|
|
17
17
|
IDLE = "idle",
|
|
18
|
-
UPLOAD_CONTROLLER = "uploadController",
|
|
19
18
|
UPLOADING = "uploading",
|
|
20
19
|
GET_SIGNED_URL = "getSignedUrl",
|
|
21
20
|
UPLOAD_TO_S3 = "uploadToS3",
|
|
@@ -35,7 +34,6 @@ export declare const enum ACTIONS {
|
|
|
35
34
|
SENTRY = "sentry"
|
|
36
35
|
}
|
|
37
36
|
export declare const enum GUARDS {
|
|
38
|
-
CAN_UPLOAD = "canUplaod"
|
|
39
|
-
IS_ASSESSMENT_QUESTION = "isAssessmentQuestion"
|
|
37
|
+
CAN_UPLOAD = "canUplaod"
|
|
40
38
|
}
|
|
41
39
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ANSWER_TYPES } from './jobInterface';
|
|
2
1
|
export interface IVideoPlatformOS {
|
|
3
2
|
architecture: number;
|
|
4
3
|
family: string;
|
|
@@ -26,29 +25,6 @@ export interface IVideoFile {
|
|
|
26
25
|
question?: string;
|
|
27
26
|
selectedTake?: number;
|
|
28
27
|
}
|
|
29
|
-
export interface IVideoFileDefault extends IVideoFile {
|
|
30
|
-
answerType?: ANSWER_TYPES.VIDEO;
|
|
31
|
-
}
|
|
32
|
-
export interface IMultipleAnswer {
|
|
33
|
-
id: string;
|
|
34
|
-
label: string;
|
|
35
|
-
selected: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface IVideoFileTextAnswer extends IVideoFile {
|
|
38
|
-
answerType: ANSWER_TYPES.TEXT;
|
|
39
|
-
answer: string;
|
|
40
|
-
}
|
|
41
|
-
export interface IVideoFileMultipleAnswer extends IVideoFile {
|
|
42
|
-
answerType: ANSWER_TYPES.MULTIPLE;
|
|
43
|
-
answer: IMultipleAnswer[];
|
|
44
|
-
}
|
|
45
|
-
export interface IVideoFileSingleAnswer extends IVideoFile {
|
|
46
|
-
answerType: ANSWER_TYPES.SINGLE;
|
|
47
|
-
answer: IMultipleAnswer[];
|
|
48
|
-
}
|
|
49
|
-
export declare type ALL_VIDEO_FILE_TYPES = IVideoFileDefault | IVideoFileTextAnswer | IVideoFileMultipleAnswer | IVideoFileSingleAnswer;
|
|
50
|
-
export declare type ASSESSMENT_VIDEO_FILE_TYPES = Exclude<ALL_VIDEO_FILE_TYPES, IVideoFileDefault>;
|
|
51
|
-
export declare type CURRENT_QUESTION_ANSWER_TYPES = ASSESSMENT_VIDEO_FILE_TYPES['answer'];
|
|
52
28
|
export interface IVideo {
|
|
53
29
|
video_id?: string;
|
|
54
30
|
bandwidth?: string;
|
|
@@ -61,7 +37,7 @@ export interface IVideo {
|
|
|
61
37
|
quality?: string;
|
|
62
38
|
referrer?: string;
|
|
63
39
|
cvUrl?: string;
|
|
64
|
-
videos?:
|
|
40
|
+
videos?: IVideoFile[];
|
|
65
41
|
processTime?: number;
|
|
66
42
|
files?: string[];
|
|
67
43
|
personalInfo?: Record<string, string>;
|
|
@@ -3,9 +3,9 @@ import { ActorRef, BaseActionObject, DoneInvokeEvent, Event, EventData, ResolveT
|
|
|
3
3
|
import { IWidgetConfig } from './configInterface';
|
|
4
4
|
import { CAMERA_STATES_MESSAGES, INTERNET_STATES_MESSAGES, MICROPHONE_STATES_MESSAGES } from '../utils/messages.utils';
|
|
5
5
|
import { TAKE_TYPES } from './storageInterface';
|
|
6
|
-
import {
|
|
6
|
+
import { IQuestion } from './jobInterface';
|
|
7
7
|
import { IVideoError } from '../utils/errors.utils';
|
|
8
|
-
|
|
8
|
+
type IUploaderRef = {
|
|
9
9
|
[uploaderRef: string]: ActorRef<DoneInvokeEvent<any>>;
|
|
10
10
|
};
|
|
11
11
|
export declare const VIDEO_ERROR_MESSAGES: {
|
|
@@ -13,10 +13,10 @@ export declare const VIDEO_ERROR_MESSAGES: {
|
|
|
13
13
|
REDIRECT: "REDIRECT";
|
|
14
14
|
NO_ERROR: "";
|
|
15
15
|
};
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
16
|
+
export type ICameraStateKey = keyof typeof CAMERA_STATES_MESSAGES;
|
|
17
|
+
export type IMicrophoneStateKey = keyof typeof MICROPHONE_STATES_MESSAGES;
|
|
18
|
+
export type IInternetStateKey = keyof typeof INTERNET_STATES_MESSAGES;
|
|
19
|
+
export type IVideoCorruptedMessagesKey = keyof typeof VIDEO_ERROR_MESSAGES;
|
|
20
20
|
export declare const CAMERA_STATES: {
|
|
21
21
|
[K in ICameraStateKey]: K;
|
|
22
22
|
};
|
|
@@ -47,7 +47,7 @@ interface IChecksMessage {
|
|
|
47
47
|
export interface InitialState {
|
|
48
48
|
speedTestResult: number;
|
|
49
49
|
widgetConfig: IWidgetConfig;
|
|
50
|
-
questions:
|
|
50
|
+
questions: IQuestion[];
|
|
51
51
|
isConnected: boolean;
|
|
52
52
|
videoRef: RefObject<HTMLVideoElement>;
|
|
53
53
|
networkRef: ActorRef<DoneInvokeEvent<any>> | null;
|
|
@@ -55,8 +55,6 @@ export interface InitialState {
|
|
|
55
55
|
storageRef: ActorRef<DoneInvokeEvent<any>> | null;
|
|
56
56
|
previewRef: ActorRef<DoneInvokeEvent<any>> | null;
|
|
57
57
|
uploaderRefs: IUploaderRef;
|
|
58
|
-
countDownRef: ActorRef<DoneInvokeEvent<any>> | null;
|
|
59
|
-
timer: number;
|
|
60
58
|
currentQuestion: number;
|
|
61
59
|
currentTake: number;
|
|
62
60
|
selectedTake: number | null;
|
|
@@ -73,6 +71,7 @@ export interface InitialState {
|
|
|
73
71
|
error: IVideoError | null;
|
|
74
72
|
failedRecordingAttempts: number;
|
|
75
73
|
failedRecordingMessage: IVideoCorruptedMessagesKey;
|
|
74
|
+
isResumed: boolean;
|
|
76
75
|
}
|
|
77
76
|
export interface IWidgetMachineProps {
|
|
78
77
|
widgetMachine: State<InitialState, DoneInvokeEvent<any>, any, {
|
|
@@ -105,11 +104,8 @@ export declare const enum STATES {
|
|
|
105
104
|
INTERVIEW__EXPLANATION = "interviewExplanation",
|
|
106
105
|
INTERVIEW__QUESTION = "interviewQuestion",
|
|
107
106
|
INTERVIEW__VIDEO_QUESTION = "interviewVideoQuestion",
|
|
108
|
-
INTERVIEW__ANSWER_SELECTOR = "interviewAnswerSelector",
|
|
109
|
-
INTERVIEW__ASSESSMENT = "interviewAssessment",
|
|
110
107
|
INTERVIEW__RECORDING = "interviewRecording",
|
|
111
108
|
PREVIEW = "preview",
|
|
112
|
-
NEXT_QUESTION_MIDDLEWARE = "nextQuestionMiddleware",
|
|
113
109
|
RE_INIT_RECORDER = "reInitRecorder",
|
|
114
110
|
RE_INIT_RECORDER__NEXT_RETAKE = "reInitRecorderNextRetake",
|
|
115
111
|
RE_INIT_RECORDER__NEXT_QUESTION = "reInitRecorderNextQuestion",
|
|
@@ -133,10 +129,8 @@ export declare const enum ACTIONS {
|
|
|
133
129
|
SPAWN_UPLOADER = "spawnUploader",
|
|
134
130
|
SPAWN_STORAGE = "spawnStorage",
|
|
135
131
|
SPAWN_PREVIEW = "spawnPreview",
|
|
136
|
-
SPAWN_COUNT_DOWN = "spawnCountDown",
|
|
137
132
|
STOP_RECORDER = "stopRecorder",
|
|
138
133
|
STOP_PREVIEW = "stopPreview",
|
|
139
|
-
STOP_COUNT_DOWN = "stopCountDown",
|
|
140
134
|
STORE_TAKE = "storeTake",
|
|
141
135
|
GET_TAKE = "getTake",
|
|
142
136
|
GET_TAKES = "getTakes",
|
|
@@ -146,10 +140,8 @@ export declare const enum ACTIONS {
|
|
|
146
140
|
UPDATE_TOTAL_UPLOADED_FILES_SIZE = "updateTotalUploadedFileSize",
|
|
147
141
|
UPDATE_QUESTION_NUMBER = "updateQuestionNumber",
|
|
148
142
|
UPDATE_RETAKES_NUMBER = "updateRetakesNumber",
|
|
149
|
-
UPDATE_TIMER = "updateTimer",
|
|
150
143
|
UPDATE_AXION_AUTH = "updateAxiosAuth",
|
|
151
144
|
RECORDER_RE_INIT = "recorderReInit",
|
|
152
|
-
DEACTIVATE_RECORDER = "deactivateRecorder",
|
|
153
145
|
RECORDER_RE_INIT_AUTO_START = "recorderReInitAutoStart",
|
|
154
146
|
UPDATE_RECORDER_PARAMS = "updateRecorderParams",
|
|
155
147
|
UPDATE_TOTAL_UPLOADED = "updateTotalUploaded",
|
|
@@ -184,8 +176,7 @@ export declare const enum EVENTS {
|
|
|
184
176
|
UPLOADER_PROGRESS = "UPLOADER_PROGRESS",
|
|
185
177
|
UPLOADER_FINISHED = "UPLOADER_FINISHED",
|
|
186
178
|
RECORDER_ERROR = "RECORDER_ERROR",
|
|
187
|
-
RETRY = "RETRY"
|
|
188
|
-
UPDATE_TIMER = "UPDATE_TIMER"
|
|
179
|
+
RETRY = "RETRY"
|
|
189
180
|
}
|
|
190
181
|
export declare const enum SERVICES {
|
|
191
182
|
UPDATE_VIDEO_OBJECT_CALL = "updateVideoObjectCall",
|
|
@@ -209,10 +200,7 @@ export declare const enum GUARDS {
|
|
|
209
200
|
IS_NO_SOUND_ERROR = "isNoSoundError",
|
|
210
201
|
IS_VIDEO_CORRUPTED = "isVideoCorrupted",
|
|
211
202
|
IS_AUDIO_ERROR = "isAudioError",
|
|
212
|
-
IS_VIDEO_ERROR = "isVideoError"
|
|
213
|
-
THERE_ARE_NO_VIDEO_QUESTIONS_TYPE = "thereAreNoVideoQuestionType",
|
|
214
|
-
IS_RECORDER_READY = "isRecorderReady",
|
|
215
|
-
IS_ASSESSMENT_QUESTION = "isAssessmentQuestion"
|
|
203
|
+
IS_VIDEO_ERROR = "isVideoError"
|
|
216
204
|
}
|
|
217
205
|
export declare const enum TAGS {
|
|
218
206
|
SETUP = "setup",
|
|
@@ -27,7 +27,7 @@ export declare function getSessionIdFromCache(): string | undefined | null;
|
|
|
27
27
|
*/
|
|
28
28
|
export declare function deleteSession(): void;
|
|
29
29
|
/** ehehehe this is a type that takes 2 types and matches all the keys of type V from type K */
|
|
30
|
-
|
|
30
|
+
type KeysMatching<T, V> = {
|
|
31
31
|
[K in keyof T]-?: T[K] extends (V | undefined) ? K : never;
|
|
32
32
|
}[keyof T];
|
|
33
33
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IWidgetConfigRequest, IWidgetConfigResponse } from '../interfaces/configInterface';
|
|
2
|
-
import { IVideo,
|
|
2
|
+
import { IVideo, IVideoFile } from '../interfaces/videoInterface';
|
|
3
3
|
export declare const createVideo: (widgetConfig: IWidgetConfigRequest) => Promise<IWidgetConfigResponse>;
|
|
4
4
|
export declare const getVideo: (videoId: string) => Promise<IWidgetConfigResponse>;
|
|
5
|
-
export declare const updateVideo: ({ video_id,
|
|
6
|
-
export declare const updateVideoFile: (videoId: string, videoFile:
|
|
5
|
+
export declare const updateVideo: ({ video_id, completed, uploaded, bandwidth }: IVideo) => Promise<IWidgetConfigResponse>;
|
|
6
|
+
export declare const updateVideoFile: (videoId: string, videoFile: IVideoFile) => Promise<IWidgetConfigResponse>;
|
|
7
7
|
export declare const getUploadUrl: (videoId: string, fileName: string, typeExtension: string) => Promise<IWidgetConfigResponse>;
|
|
@@ -11,5 +11,4 @@ export declare const VIDEO_INACTIVE_TIMEOUT = 2000;
|
|
|
11
11
|
export declare const MICROPHONE_NO_SOUND_ERROR_CODE = 777;
|
|
12
12
|
export declare const MAX_FAILED_RECORDING_ATTEMPTS = 2;
|
|
13
13
|
export declare const MICROPHONE_RETAKE_COUNT = 100;
|
|
14
|
-
export declare const SECONDS_LEFT_HIGHLIGHT = 10;
|
|
15
14
|
export declare const FONT_URL = "https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700&display=swap";
|
|
@@ -4,7 +4,7 @@ export declare const isSupportedIosDevice: boolean;
|
|
|
4
4
|
export declare const isSupportedDevice: boolean;
|
|
5
5
|
declare const PLATFORMS_OPTIONS: readonly ["ANDROID", "IOS", "MACBOOK", "WINDOWS"];
|
|
6
6
|
declare const BROWSERS_OPTIONS: readonly ["CHROME", "SAFARI", "FIREFOX", "SAMSUNG"];
|
|
7
|
-
|
|
7
|
+
type DEVICE_TYPE = {
|
|
8
8
|
PLATFORM: typeof PLATFORMS_OPTIONS[number];
|
|
9
9
|
BROWSER: typeof BROWSERS_OPTIONS[number];
|
|
10
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const twoDigitsNumber: (num: number) => string;
|
|
2
2
|
export declare const timeFormatter: (number: number) => string;
|
|
3
3
|
export declare const timeLeftInMinutesFormatter: (number: number) => string;
|
|
4
|
-
export declare const timerCountDown: (number: number) => string
|
|
4
|
+
export declare const timerCountDown: (number: number) => string;
|
|
5
5
|
export declare const formattedDuration: (number: number) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,12 +20,6 @@ interface ICompany {
|
|
|
20
20
|
shouldShowWaterMark: boolean;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
declare const enum ANSWER_TYPES {
|
|
24
|
-
VIDEO = "video",
|
|
25
|
-
TEXT = "text",
|
|
26
|
-
MULTIPLE = "multiple_choice",
|
|
27
|
-
SINGLE = "single_choice"
|
|
28
|
-
}
|
|
29
23
|
interface IQuestion {
|
|
30
24
|
question: string;
|
|
31
25
|
numOfRetakes: number;
|
|
@@ -35,43 +29,11 @@ interface IQuestion {
|
|
|
35
29
|
videoQuestion?: string;
|
|
36
30
|
description?: string;
|
|
37
31
|
}
|
|
38
|
-
|
|
39
|
-
answerType?: `${ANSWER_TYPES.VIDEO}`;
|
|
40
|
-
}
|
|
41
|
-
interface IQuestionTextAnswer extends IQuestion {
|
|
42
|
-
answerType: `${ANSWER_TYPES.TEXT}`;
|
|
43
|
-
config?: {
|
|
44
|
-
minChars: number;
|
|
45
|
-
maxChars?: number;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
interface IMultipleChoiceOptionDefinition {
|
|
49
|
-
id: string;
|
|
50
|
-
label: string;
|
|
51
|
-
}
|
|
52
|
-
interface IQuestionChoiceAnswer extends IQuestion {
|
|
53
|
-
config?: {
|
|
54
|
-
shuffle?: boolean;
|
|
55
|
-
answers: IMultipleChoiceOptionDefinition[];
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
interface IQuestionMultipleAnswer extends IQuestionChoiceAnswer {
|
|
59
|
-
answerType: `${ANSWER_TYPES.MULTIPLE}`;
|
|
60
|
-
config?: {
|
|
61
|
-
minAnswers?: number;
|
|
62
|
-
maxAnswers?: number;
|
|
63
|
-
} & IQuestionChoiceAnswer['config'];
|
|
64
|
-
}
|
|
65
|
-
interface IQuestionSingleAnswer extends IQuestionChoiceAnswer {
|
|
66
|
-
answerType: `${ANSWER_TYPES.SINGLE}`;
|
|
67
|
-
}
|
|
68
|
-
declare type leanQuestion<T> = Omit<T, 'numOfRetakes' | 'partDuration' | 'thinkingTime'> & {
|
|
32
|
+
type IClientQuestion = Omit<IQuestion, 'numOfRetakes' | 'partDuration' | 'thinkingTime'> & {
|
|
69
33
|
attempts?: number;
|
|
70
34
|
duration?: number;
|
|
71
35
|
thinkingTime?: number;
|
|
72
36
|
};
|
|
73
|
-
declare type ALL_JOB_QUESTIONS_TYPE = IQuestionDefault | IQuestionTextAnswer | IQuestionMultipleAnswer | IQuestionSingleAnswer;
|
|
74
|
-
declare type IClientQuestion = leanQuestion<IQuestionDefault> | leanQuestion<IQuestionTextAnswer> | leanQuestion<IQuestionMultipleAnswer> | leanQuestion<IQuestionSingleAnswer>;
|
|
75
37
|
interface IJob {
|
|
76
38
|
language?: string;
|
|
77
39
|
transcriptLanguage?: string;
|
|
@@ -79,7 +41,7 @@ interface IJob {
|
|
|
79
41
|
company?: string;
|
|
80
42
|
job_id?: string;
|
|
81
43
|
logo?: string;
|
|
82
|
-
questions?:
|
|
44
|
+
questions?: IQuestion[];
|
|
83
45
|
old_jobID?: string;
|
|
84
46
|
termsUrl?: string;
|
|
85
47
|
privacyUrl?: string;
|
|
@@ -87,7 +49,7 @@ interface IJob {
|
|
|
87
49
|
company_id?: string;
|
|
88
50
|
jobID?: string;
|
|
89
51
|
}
|
|
90
|
-
|
|
52
|
+
type IClientJob = Omit<IJob, 'questions'> & {
|
|
91
53
|
questions?: IClientQuestion[];
|
|
92
54
|
};
|
|
93
55
|
|
|
@@ -118,27 +80,6 @@ interface IVideoFile {
|
|
|
118
80
|
question?: string;
|
|
119
81
|
selectedTake?: number;
|
|
120
82
|
}
|
|
121
|
-
interface IVideoFileDefault extends IVideoFile {
|
|
122
|
-
answerType?: ANSWER_TYPES.VIDEO;
|
|
123
|
-
}
|
|
124
|
-
interface IMultipleAnswer {
|
|
125
|
-
id: string;
|
|
126
|
-
label: string;
|
|
127
|
-
selected: boolean;
|
|
128
|
-
}
|
|
129
|
-
interface IVideoFileTextAnswer extends IVideoFile {
|
|
130
|
-
answerType: ANSWER_TYPES.TEXT;
|
|
131
|
-
answer: string;
|
|
132
|
-
}
|
|
133
|
-
interface IVideoFileMultipleAnswer extends IVideoFile {
|
|
134
|
-
answerType: ANSWER_TYPES.MULTIPLE;
|
|
135
|
-
answer: IMultipleAnswer[];
|
|
136
|
-
}
|
|
137
|
-
interface IVideoFileSingleAnswer extends IVideoFile {
|
|
138
|
-
answerType: ANSWER_TYPES.SINGLE;
|
|
139
|
-
answer: IMultipleAnswer[];
|
|
140
|
-
}
|
|
141
|
-
declare type ALL_VIDEO_FILE_TYPES = IVideoFileDefault | IVideoFileTextAnswer | IVideoFileMultipleAnswer | IVideoFileSingleAnswer;
|
|
142
83
|
interface IVideo {
|
|
143
84
|
video_id?: string;
|
|
144
85
|
bandwidth?: string;
|
|
@@ -151,7 +92,7 @@ interface IVideo {
|
|
|
151
92
|
quality?: string;
|
|
152
93
|
referrer?: string;
|
|
153
94
|
cvUrl?: string;
|
|
154
|
-
videos?:
|
|
95
|
+
videos?: IVideoFile[];
|
|
155
96
|
processTime?: number;
|
|
156
97
|
files?: string[];
|
|
157
98
|
personalInfo?: Record<string, string>;
|
|
@@ -163,7 +104,7 @@ interface IVideo {
|
|
|
163
104
|
};
|
|
164
105
|
}
|
|
165
106
|
|
|
166
|
-
|
|
107
|
+
type IMessageType = 'completed' | 'deadline' | 'applied' | 'inactiveJob';
|
|
167
108
|
interface IOnFinish {
|
|
168
109
|
redirectUrl?: string;
|
|
169
110
|
video_id: string;
|
|
@@ -171,7 +112,7 @@ interface IOnFinish {
|
|
|
171
112
|
interface IOnError {
|
|
172
113
|
messageType: IMessageType;
|
|
173
114
|
}
|
|
174
|
-
|
|
115
|
+
type IEnv = 'dev' | 'staging' | 'production' | 'development' | 'local';
|
|
175
116
|
interface IConfig {
|
|
176
117
|
auth: string;
|
|
177
118
|
onWidgetClicked?: () => void;
|
|
@@ -180,7 +121,7 @@ interface IConfig {
|
|
|
180
121
|
onWidgetClose?: () => void;
|
|
181
122
|
openAnimation?: boolean;
|
|
182
123
|
debug?: boolean;
|
|
183
|
-
practiceQuestions?:
|
|
124
|
+
practiceQuestions?: IQuestion[];
|
|
184
125
|
overlay?: string;
|
|
185
126
|
introVideo?: string;
|
|
186
127
|
welcomeTitle?: string;
|
|
@@ -191,7 +132,7 @@ interface IConfig {
|
|
|
191
132
|
hideIntercom?: boolean;
|
|
192
133
|
disablePractice?: boolean;
|
|
193
134
|
}
|
|
194
|
-
|
|
135
|
+
type IClientConfig = Omit<IConfig, 'practiceQuestions'> & {
|
|
195
136
|
practiceQuestions?: IClientQuestion[];
|
|
196
137
|
};
|
|
197
138
|
interface IWidgetConfig {
|
|
@@ -207,7 +148,7 @@ interface IWidgetConfig {
|
|
|
207
148
|
styleUrls?: string | string[];
|
|
208
149
|
fontsUrls?: string | string[];
|
|
209
150
|
}
|
|
210
|
-
|
|
151
|
+
type IClientWidgetConfig = Omit<IWidgetConfig, 'job' | 'config'> & {
|
|
211
152
|
job: IClientJob;
|
|
212
153
|
config: IClientConfig;
|
|
213
154
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myinterview/widget-react",
|
|
3
|
-
"version": "1.0.61
|
|
3
|
+
"version": "1.0.61",
|
|
4
4
|
"description": "myInterview widget v3",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@cloudflare/stream-react": "^1.8.0",
|
|
13
|
-
"@myinterview/component-library": "^1.0.
|
|
13
|
+
"@myinterview/component-library": "^1.0.36",
|
|
14
14
|
"@sentry/react": "^7.7.0",
|
|
15
15
|
"@sentry/tracing": "^7.7.0",
|
|
16
16
|
"@xstate/react": "^3.0.1",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"xstate": "^4.33.2"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
|
-
"start": "REACT_APP_ENV=local HTTPS=true node scripts/start.js",
|
|
55
|
-
"start-prod": "REACT_APP_ENV=prod HTTPS=true node scripts/start.js",
|
|
56
|
-
"start-staging": "REACT_APP_ENV=staging HTTPS=true node scripts/start.js",
|
|
54
|
+
"start": "REACT_APP_RELEASE=$npm_package_version REACT_APP_ENV=local HTTPS=true node scripts/start.js",
|
|
55
|
+
"start-prod": "REACT_APP_RELEASE=$npm_package_version REACT_APP_ENV=prod HTTPS=true node scripts/start.js",
|
|
56
|
+
"start-staging": "REACT_APP_RELEASE=$npm_package_version REACT_APP_ENV=staging HTTPS=true node scripts/start.js",
|
|
57
57
|
"build": "node scripts/build.js",
|
|
58
|
-
"publish-prod": "REACT_APP_ENV=prod rollup -c && npm publish",
|
|
59
|
-
"publish-staging": "REACT_APP_ENV=staging rollup -c && npm publish --tag beta",
|
|
60
|
-
"publish-experimental": "REACT_APP_ENV=staging rollup -c && npm publish --tag experimental",
|
|
58
|
+
"publish-prod": "REACT_APP_RELEASE=$npm_package_version REACT_APP_ENV=prod rollup -c && npm publish",
|
|
59
|
+
"publish-staging": "REACT_APP_RELEASE=$npm_package_version REACT_APP_ENV=staging rollup -c && npm publish --tag beta",
|
|
60
|
+
"publish-experimental": "REACT_APP_RELEASE=$npm_package_version REACT_APP_ENV=staging rollup -c && npm publish --tag experimental",
|
|
61
61
|
"test": "node scripts/test.js"
|
|
62
62
|
},
|
|
63
63
|
"eslintConfig": {
|
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
"@typescript-eslint/eslint-plugin": "^5.19.0",
|
|
101
101
|
"@typescript-eslint/parser": "^5.30.0",
|
|
102
102
|
"babel-jest": "^27.4.2",
|
|
103
|
+
"babel-loader": "^8.3.0",
|
|
103
104
|
"babel-preset-react-app": "^10.0.1",
|
|
104
105
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
|
105
106
|
"classnames": "^2.3.1",
|
|
@@ -140,7 +141,6 @@
|
|
|
140
141
|
"webpack-manifest-plugin": "^4.0.2"
|
|
141
142
|
},
|
|
142
143
|
"peerDependencies": {
|
|
143
|
-
"babel-loader": "> =8.0.0",
|
|
144
144
|
"react": ">= 16.8.0",
|
|
145
145
|
"react-dom": ">= 16.8.0"
|
|
146
146
|
},
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ASSESSMENT_QUESTIONS_TYPE } from '../interfaces/jobInterface';
|
|
3
|
-
import { IMultipleAnswer } from '../interfaces/videoInterface';
|
|
4
|
-
interface IProps {
|
|
5
|
-
currentQuestionObj: ASSESSMENT_QUESTIONS_TYPE;
|
|
6
|
-
currentQuestion: number;
|
|
7
|
-
numberOfQuestions: number;
|
|
8
|
-
timer: number;
|
|
9
|
-
onSubmitAssessment: (answer: IMultipleAnswer[] | string) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const AssessmentController: React.FC<IProps>;
|
|
12
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IMultipleChoiceOptionDefinition } from '../interfaces/jobInterface';
|
|
3
|
-
import { IMultipleAnswer } from '../interfaces/videoInterface';
|
|
4
|
-
interface IProps {
|
|
5
|
-
answerOptions: IMultipleChoiceOptionDefinition[];
|
|
6
|
-
onAnswer: (answers: IMultipleAnswer[]) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare const AssessmentMultiSelect: React.FC<IProps>;
|
|
9
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IMultipleChoiceOptionDefinition } from '../interfaces/jobInterface';
|
|
3
|
-
import { IMultipleAnswer } from '../interfaces/videoInterface';
|
|
4
|
-
interface IProps {
|
|
5
|
-
answerOptions: IMultipleChoiceOptionDefinition[];
|
|
6
|
-
onAnswer: (answer: IMultipleAnswer[]) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare const AssessmentSingleSelect: React.FC<IProps>;
|
|
9
|
-
export {};
|