@myinterview/widget-react 1.0.60 → 1.0.61-experimental

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.
Files changed (70) hide show
  1. package/dist/cjs/components/AnswerInstructions.d.ts +7 -0
  2. package/dist/cjs/components/AssessmentController.d.ts +12 -0
  3. package/dist/cjs/components/AssessmentFreeText.d.ts +8 -0
  4. package/dist/cjs/components/AssessmentMultiSelect.d.ts +9 -0
  5. package/dist/cjs/components/AssessmentSingleSelect.d.ts +9 -0
  6. package/dist/cjs/components/CharactersLimit.d.ts +7 -0
  7. package/dist/cjs/components/CountDown.d.ts +3 -1
  8. package/dist/cjs/components/Errors.d.ts +2 -2
  9. package/dist/cjs/components/Explanation.d.ts +2 -1
  10. package/dist/cjs/components/Question.d.ts +2 -3
  11. package/dist/cjs/components/QuestionItem.d.ts +2 -2
  12. package/dist/cjs/components/QuestionParamaters.d.ts +9 -0
  13. package/dist/cjs/components/QuestionsList.d.ts +2 -2
  14. package/dist/cjs/components/RecorderModal.d.ts +2 -4
  15. package/dist/cjs/components/VideoCamera.d.ts +3 -2
  16. package/dist/cjs/components/ui/DotSeparator.d.ts +2 -0
  17. package/dist/cjs/components/ui/StartRecordingButton.d.ts +1 -0
  18. package/dist/cjs/i18n/config.d.ts +28 -0
  19. package/dist/cjs/index.js +2223 -11602
  20. package/dist/cjs/index.js.map +1 -1
  21. package/dist/cjs/interfaces/candidateSessionInterface.d.ts +1 -1
  22. package/dist/cjs/interfaces/configInterface.d.ts +6 -6
  23. package/dist/cjs/interfaces/countDownInterface.d.ts +23 -0
  24. package/dist/cjs/interfaces/jobInterface.d.ts +43 -3
  25. package/dist/cjs/interfaces/recorderInterface.d.ts +6 -2
  26. package/dist/cjs/interfaces/uploaderInterface.d.ts +5 -3
  27. package/dist/cjs/interfaces/videoInterface.d.ts +25 -1
  28. package/dist/cjs/interfaces/widgetInterface.d.ts +22 -9
  29. package/dist/cjs/machines/acceleratorMachines/counterMachine.d.ts +5 -0
  30. package/dist/cjs/services/session.service.d.ts +1 -1
  31. package/dist/cjs/services/video.service.d.ts +3 -3
  32. package/dist/cjs/utils/constants.utils.d.ts +1 -0
  33. package/dist/cjs/utils/device.utils.d.ts +1 -1
  34. package/dist/cjs/utils/formatters.utils.d.ts +1 -1
  35. package/dist/esm/components/AnswerInstructions.d.ts +7 -0
  36. package/dist/esm/components/AssessmentController.d.ts +12 -0
  37. package/dist/esm/components/AssessmentFreeText.d.ts +8 -0
  38. package/dist/esm/components/AssessmentMultiSelect.d.ts +9 -0
  39. package/dist/esm/components/AssessmentSingleSelect.d.ts +9 -0
  40. package/dist/esm/components/CharactersLimit.d.ts +7 -0
  41. package/dist/esm/components/CountDown.d.ts +3 -1
  42. package/dist/esm/components/Errors.d.ts +2 -2
  43. package/dist/esm/components/Explanation.d.ts +2 -1
  44. package/dist/esm/components/Question.d.ts +2 -3
  45. package/dist/esm/components/QuestionItem.d.ts +2 -2
  46. package/dist/esm/components/QuestionParamaters.d.ts +9 -0
  47. package/dist/esm/components/QuestionsList.d.ts +2 -2
  48. package/dist/esm/components/RecorderModal.d.ts +2 -4
  49. package/dist/esm/components/VideoCamera.d.ts +3 -2
  50. package/dist/esm/components/ui/DotSeparator.d.ts +2 -0
  51. package/dist/esm/components/ui/StartRecordingButton.d.ts +1 -0
  52. package/dist/esm/i18n/config.d.ts +28 -0
  53. package/dist/esm/index.js +2223 -11602
  54. package/dist/esm/index.js.map +1 -1
  55. package/dist/esm/interfaces/candidateSessionInterface.d.ts +1 -1
  56. package/dist/esm/interfaces/configInterface.d.ts +6 -6
  57. package/dist/esm/interfaces/countDownInterface.d.ts +23 -0
  58. package/dist/esm/interfaces/jobInterface.d.ts +43 -3
  59. package/dist/esm/interfaces/recorderInterface.d.ts +6 -2
  60. package/dist/esm/interfaces/uploaderInterface.d.ts +5 -3
  61. package/dist/esm/interfaces/videoInterface.d.ts +25 -1
  62. package/dist/esm/interfaces/widgetInterface.d.ts +22 -9
  63. package/dist/esm/machines/acceleratorMachines/counterMachine.d.ts +5 -0
  64. package/dist/esm/services/session.service.d.ts +1 -1
  65. package/dist/esm/services/video.service.d.ts +3 -3
  66. package/dist/esm/utils/constants.utils.d.ts +1 -0
  67. package/dist/esm/utils/device.utils.d.ts +1 -1
  68. package/dist/esm/utils/formatters.utils.d.ts +1 -1
  69. package/dist/index.d.ts +68 -9
  70. package/package.json +3 -3
@@ -31,7 +31,7 @@ export declare const enum CandidateSessionWarnings {
31
31
  OverconstrainedError = "OverconstrainedError",
32
32
  SecurityError = "SecurityError"
33
33
  }
34
- export type CandidateSessionSourceType = 'direct' | 'email' | 'sms' | 'email_reminder' | 'sms_reminder';
34
+ export declare 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 { IClientJob, IClientQuestion, IJob, IQuestion } from './jobInterface';
4
+ import { ALL_JOB_QUESTIONS_TYPE, IClientJob, IClientQuestion, IJob } from './jobInterface';
5
5
  import { IVideo } from './videoInterface';
6
- export type IMessageType = 'completed' | 'deadline' | 'applied' | 'inactiveJob';
6
+ export declare 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 type IEnv = 'dev' | 'staging' | 'production' | 'development' | 'local';
14
+ export declare 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?: IQuestion[];
23
+ practiceQuestions?: ALL_JOB_QUESTIONS_TYPE[];
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 type IClientConfig = Omit<IConfig, 'practiceQuestions'> & {
34
+ export declare 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 type IClientWidgetConfig = Omit<IWidgetConfig, 'job' | 'config'> & {
50
+ export declare type IClientWidgetConfig = Omit<IWidgetConfig, 'job' | 'config'> & {
51
51
  job: IClientJob;
52
52
  config: IClientConfig;
53
53
  };
@@ -0,0 +1,23 @@
1
+ export interface CounterInterface {
2
+ counterRef: any;
3
+ ms: number;
4
+ isAutoStart: boolean;
5
+ callback: string;
6
+ }
7
+ export declare const enum GUARDS {
8
+ IS_AUTO_START = "isAutoStart"
9
+ }
10
+ export declare const enum STATES {
11
+ IDLE = "idle",
12
+ COUNTING = "counting",
13
+ PAUSED = "paused"
14
+ }
15
+ export declare const enum ACTIONS {
16
+ TICK = "tick",
17
+ INIT_OBSERVER = "initObserver"
18
+ }
19
+ export declare const enum EVENTS {
20
+ TICK = "TICK",
21
+ START = "START",
22
+ PAUSE = "PAUSE"
23
+ }
@@ -1,3 +1,9 @@
1
+ export declare const enum ANSWER_TYPES {
2
+ VIDEO = "video",
3
+ TEXT = "text",
4
+ MULTIPLE = "multiple_choice",
5
+ SINGLE = "single_choice"
6
+ }
1
7
  export interface IQuestion {
2
8
  question: string;
3
9
  numOfRetakes: number;
@@ -7,11 +13,44 @@ export interface IQuestion {
7
13
  videoQuestion?: string;
8
14
  description?: string;
9
15
  }
10
- export type IClientQuestion = Omit<IQuestion, 'numOfRetakes' | 'partDuration' | 'thinkingTime'> & {
16
+ export interface IQuestionDefault extends IQuestion {
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'> & {
11
47
  attempts?: number;
12
48
  duration?: number;
13
49
  thinkingTime?: number;
14
50
  };
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>;
15
54
  export interface IJob {
16
55
  language?: string;
17
56
  transcriptLanguage?: string;
@@ -19,7 +58,7 @@ export interface IJob {
19
58
  company?: string;
20
59
  job_id?: string;
21
60
  logo?: string;
22
- questions?: IQuestion[];
61
+ questions?: ALL_JOB_QUESTIONS_TYPE[];
23
62
  old_jobID?: string;
24
63
  termsUrl?: string;
25
64
  privacyUrl?: string;
@@ -27,6 +66,7 @@ export interface IJob {
27
66
  company_id?: string;
28
67
  jobID?: string;
29
68
  }
30
- export type IClientJob = Omit<IJob, 'questions'> & {
69
+ export declare type IClientJob = Omit<IJob, 'questions'> & {
31
70
  questions?: IClientQuestion[];
32
71
  };
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 type mediaDeviceType = 'video' | 'audio';
9
- type ConstrainProps = {
8
+ export declare type mediaDeviceType = 'video' | 'audio';
9
+ declare type ConstrainProps = {
10
10
  video: {
11
11
  width: {
12
12
  min?: number;
@@ -23,6 +23,7 @@ interface FacingMode {
23
23
  export interface RecorderInterface {
24
24
  facingMode: FacingMode;
25
25
  microphoneRef: ActorRef<DoneInvokeEvent<any>> | null;
26
+ countDownRef: ActorRef<DoneInvokeEvent<any>> | null;
26
27
  mediaStream?: MediaStream;
27
28
  mediaRecorder?: MediaRecorder;
28
29
  videoDevices: MediaDeviceInfo[];
@@ -60,6 +61,8 @@ export declare const enum STATES {
60
61
  RECORDER_SENDING_BLOBS = "recorderSendingBlobs"
61
62
  }
62
63
  export declare const enum ACTIONS {
64
+ STOP_COUNT_DOWN_ACTOR = "STOP_COUNT_DOWN_ACTOR",
65
+ INIT_COUNT_DOWN_ACTOR = "INIT_COUNT_DOWN_ACTOR",
63
66
  SESSION_EVENT = "SESSION_EVENT",
64
67
  SENTRY = "SENTRY",
65
68
  CONSOLE_LOG = "CONSOLE_LOG",
@@ -93,6 +96,7 @@ export declare const enum ACTIONS {
93
96
  SET_MIC_ERROR = "SET_MIC_ERROR"
94
97
  }
95
98
  export declare const enum EVENTS {
99
+ SEND_RECORDER_TO_WAITING_STATE = "SEND_RECORDER_TO_WAITING_STATE",
96
100
  CHANGE_VIDEO_DEVICE = "CHANGE_VIDEO_DEVICE",
97
101
  CHANGE_AUDIO_DEVICE = "CHANGE_AUDIO_DEVICE",
98
102
  START_RECORDING = "START_RECORDING",
@@ -1,4 +1,4 @@
1
- import { IVideoFile } from './videoInterface';
1
+ import { ALL_VIDEO_FILE_TYPES } from './videoInterface';
2
2
  interface ILastUploadChunkl {
3
3
  loaded: number;
4
4
  timeStamp: number;
@@ -11,10 +11,11 @@ export interface InitialState {
11
11
  uploadSpeed: number;
12
12
  lastUploadChunk: ILastUploadChunkl;
13
13
  videoId: string;
14
- videoFile: IVideoFile;
14
+ videoFile: ALL_VIDEO_FILE_TYPES;
15
15
  }
16
16
  export declare const enum STATES {
17
17
  IDLE = "idle",
18
+ UPLOAD_CONTROLLER = "uploadController",
18
19
  UPLOADING = "uploading",
19
20
  GET_SIGNED_URL = "getSignedUrl",
20
21
  UPLOAD_TO_S3 = "uploadToS3",
@@ -34,6 +35,7 @@ export declare const enum ACTIONS {
34
35
  SENTRY = "sentry"
35
36
  }
36
37
  export declare const enum GUARDS {
37
- CAN_UPLOAD = "canUplaod"
38
+ CAN_UPLOAD = "canUplaod",
39
+ IS_ASSESSMENT_QUESTION = "isAssessmentQuestion"
38
40
  }
39
41
  export {};
@@ -1,3 +1,4 @@
1
+ import { ANSWER_TYPES } from './jobInterface';
1
2
  export interface IVideoPlatformOS {
2
3
  architecture: number;
3
4
  family: string;
@@ -25,6 +26,29 @@ export interface IVideoFile {
25
26
  question?: string;
26
27
  selectedTake?: number;
27
28
  }
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'];
28
52
  export interface IVideo {
29
53
  video_id?: string;
30
54
  bandwidth?: string;
@@ -37,7 +61,7 @@ export interface IVideo {
37
61
  quality?: string;
38
62
  referrer?: string;
39
63
  cvUrl?: string;
40
- videos?: IVideoFile[];
64
+ videos?: ALL_VIDEO_FILE_TYPES[];
41
65
  processTime?: number;
42
66
  files?: string[];
43
67
  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 { IQuestion } from './jobInterface';
6
+ import { ALL_JOB_QUESTIONS_TYPE } from './jobInterface';
7
7
  import { IVideoError } from '../utils/errors.utils';
8
- type IUploaderRef = {
8
+ declare 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 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;
16
+ export declare type ICameraStateKey = keyof typeof CAMERA_STATES_MESSAGES;
17
+ export declare type IMicrophoneStateKey = keyof typeof MICROPHONE_STATES_MESSAGES;
18
+ export declare type IInternetStateKey = keyof typeof INTERNET_STATES_MESSAGES;
19
+ export declare 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: IQuestion[];
50
+ questions: ALL_JOB_QUESTIONS_TYPE[];
51
51
  isConnected: boolean;
52
52
  videoRef: RefObject<HTMLVideoElement>;
53
53
  networkRef: ActorRef<DoneInvokeEvent<any>> | null;
@@ -55,6 +55,8 @@ 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;
58
60
  currentQuestion: number;
59
61
  currentTake: number;
60
62
  selectedTake: number | null;
@@ -103,8 +105,11 @@ export declare const enum STATES {
103
105
  INTERVIEW__EXPLANATION = "interviewExplanation",
104
106
  INTERVIEW__QUESTION = "interviewQuestion",
105
107
  INTERVIEW__VIDEO_QUESTION = "interviewVideoQuestion",
108
+ INTERVIEW__ANSWER_SELECTOR = "interviewAnswerSelector",
109
+ INTERVIEW__ASSESSMENT = "interviewAssessment",
106
110
  INTERVIEW__RECORDING = "interviewRecording",
107
111
  PREVIEW = "preview",
112
+ NEXT_QUESTION_MIDDLEWARE = "nextQuestionMiddleware",
108
113
  RE_INIT_RECORDER = "reInitRecorder",
109
114
  RE_INIT_RECORDER__NEXT_RETAKE = "reInitRecorderNextRetake",
110
115
  RE_INIT_RECORDER__NEXT_QUESTION = "reInitRecorderNextQuestion",
@@ -128,8 +133,10 @@ export declare const enum ACTIONS {
128
133
  SPAWN_UPLOADER = "spawnUploader",
129
134
  SPAWN_STORAGE = "spawnStorage",
130
135
  SPAWN_PREVIEW = "spawnPreview",
136
+ SPAWN_COUNT_DOWN = "spawnCountDown",
131
137
  STOP_RECORDER = "stopRecorder",
132
138
  STOP_PREVIEW = "stopPreview",
139
+ STOP_COUNT_DOWN = "stopCountDown",
133
140
  STORE_TAKE = "storeTake",
134
141
  GET_TAKE = "getTake",
135
142
  GET_TAKES = "getTakes",
@@ -139,8 +146,10 @@ export declare const enum ACTIONS {
139
146
  UPDATE_TOTAL_UPLOADED_FILES_SIZE = "updateTotalUploadedFileSize",
140
147
  UPDATE_QUESTION_NUMBER = "updateQuestionNumber",
141
148
  UPDATE_RETAKES_NUMBER = "updateRetakesNumber",
149
+ UPDATE_TIMER = "updateTimer",
142
150
  UPDATE_AXION_AUTH = "updateAxiosAuth",
143
151
  RECORDER_RE_INIT = "recorderReInit",
152
+ DEACTIVATE_RECORDER = "deactivateRecorder",
144
153
  RECORDER_RE_INIT_AUTO_START = "recorderReInitAutoStart",
145
154
  UPDATE_RECORDER_PARAMS = "updateRecorderParams",
146
155
  UPDATE_TOTAL_UPLOADED = "updateTotalUploaded",
@@ -175,7 +184,8 @@ export declare const enum EVENTS {
175
184
  UPLOADER_PROGRESS = "UPLOADER_PROGRESS",
176
185
  UPLOADER_FINISHED = "UPLOADER_FINISHED",
177
186
  RECORDER_ERROR = "RECORDER_ERROR",
178
- RETRY = "RETRY"
187
+ RETRY = "RETRY",
188
+ UPDATE_TIMER = "UPDATE_TIMER"
179
189
  }
180
190
  export declare const enum SERVICES {
181
191
  UPDATE_VIDEO_OBJECT_CALL = "updateVideoObjectCall",
@@ -199,7 +209,10 @@ export declare const enum GUARDS {
199
209
  IS_NO_SOUND_ERROR = "isNoSoundError",
200
210
  IS_VIDEO_CORRUPTED = "isVideoCorrupted",
201
211
  IS_AUDIO_ERROR = "isAudioError",
202
- IS_VIDEO_ERROR = "isVideoError"
212
+ IS_VIDEO_ERROR = "isVideoError",
213
+ THERE_ARE_NO_VIDEO_QUESTIONS_TYPE = "thereAreNoVideoQuestionType",
214
+ IS_RECORDER_READY = "isRecorderReady",
215
+ IS_ASSESSMENT_QUESTION = "isAssessmentQuestion"
203
216
  }
204
217
  export declare const enum TAGS {
205
218
  SETUP = "setup",
@@ -0,0 +1,5 @@
1
+ import { CounterInterface } from '../../interfaces/countDownInterface';
2
+ export declare const counterMachine: import("xstate").StateMachine<CounterInterface, any, import("xstate").AnyEventObject, {
3
+ value: any;
4
+ context: CounterInterface;
5
+ }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, import("xstate").AnyEventObject, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
@@ -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
- type KeysMatching<T, V> = {
30
+ declare 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, IVideoFile } from '../interfaces/videoInterface';
2
+ import { IVideo, ALL_VIDEO_FILE_TYPES } 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, completed, uploaded, bandwidth }: IVideo) => Promise<IWidgetConfigResponse>;
6
- export declare const updateVideoFile: (videoId: string, videoFile: IVideoFile) => Promise<IWidgetConfigResponse>;
5
+ export declare const updateVideo: ({ video_id, started, completed, uploaded, bandwidth }: IVideo) => Promise<IWidgetConfigResponse>;
6
+ export declare const updateVideoFile: (videoId: string, videoFile: ALL_VIDEO_FILE_TYPES) => Promise<IWidgetConfigResponse>;
7
7
  export declare const getUploadUrl: (videoId: string, fileName: string, typeExtension: string) => Promise<IWidgetConfigResponse>;
@@ -11,4 +11,5 @@ 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;
14
15
  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
- type DEVICE_TYPE = {
7
+ declare 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,6 +20,12 @@ 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
+ }
23
29
  interface IQuestion {
24
30
  question: string;
25
31
  numOfRetakes: number;
@@ -29,11 +35,43 @@ interface IQuestion {
29
35
  videoQuestion?: string;
30
36
  description?: string;
31
37
  }
32
- type IClientQuestion = Omit<IQuestion, 'numOfRetakes' | 'partDuration' | 'thinkingTime'> & {
38
+ interface IQuestionDefault extends IQuestion {
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'> & {
33
69
  attempts?: number;
34
70
  duration?: number;
35
71
  thinkingTime?: number;
36
72
  };
73
+ declare type ALL_JOB_QUESTIONS_TYPE = IQuestionDefault | IQuestionTextAnswer | IQuestionMultipleAnswer | IQuestionSingleAnswer;
74
+ declare type IClientQuestion = leanQuestion<IQuestionDefault> | leanQuestion<IQuestionTextAnswer> | leanQuestion<IQuestionMultipleAnswer> | leanQuestion<IQuestionSingleAnswer>;
37
75
  interface IJob {
38
76
  language?: string;
39
77
  transcriptLanguage?: string;
@@ -41,7 +79,7 @@ interface IJob {
41
79
  company?: string;
42
80
  job_id?: string;
43
81
  logo?: string;
44
- questions?: IQuestion[];
82
+ questions?: ALL_JOB_QUESTIONS_TYPE[];
45
83
  old_jobID?: string;
46
84
  termsUrl?: string;
47
85
  privacyUrl?: string;
@@ -49,7 +87,7 @@ interface IJob {
49
87
  company_id?: string;
50
88
  jobID?: string;
51
89
  }
52
- type IClientJob = Omit<IJob, 'questions'> & {
90
+ declare type IClientJob = Omit<IJob, 'questions'> & {
53
91
  questions?: IClientQuestion[];
54
92
  };
55
93
 
@@ -80,6 +118,27 @@ interface IVideoFile {
80
118
  question?: string;
81
119
  selectedTake?: number;
82
120
  }
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;
83
142
  interface IVideo {
84
143
  video_id?: string;
85
144
  bandwidth?: string;
@@ -92,7 +151,7 @@ interface IVideo {
92
151
  quality?: string;
93
152
  referrer?: string;
94
153
  cvUrl?: string;
95
- videos?: IVideoFile[];
154
+ videos?: ALL_VIDEO_FILE_TYPES[];
96
155
  processTime?: number;
97
156
  files?: string[];
98
157
  personalInfo?: Record<string, string>;
@@ -104,7 +163,7 @@ interface IVideo {
104
163
  };
105
164
  }
106
165
 
107
- type IMessageType = 'completed' | 'deadline' | 'applied' | 'inactiveJob';
166
+ declare type IMessageType = 'completed' | 'deadline' | 'applied' | 'inactiveJob';
108
167
  interface IOnFinish {
109
168
  redirectUrl?: string;
110
169
  video_id: string;
@@ -112,7 +171,7 @@ interface IOnFinish {
112
171
  interface IOnError {
113
172
  messageType: IMessageType;
114
173
  }
115
- type IEnv = 'dev' | 'staging' | 'production' | 'development' | 'local';
174
+ declare type IEnv = 'dev' | 'staging' | 'production' | 'development' | 'local';
116
175
  interface IConfig {
117
176
  auth: string;
118
177
  onWidgetClicked?: () => void;
@@ -121,7 +180,7 @@ interface IConfig {
121
180
  onWidgetClose?: () => void;
122
181
  openAnimation?: boolean;
123
182
  debug?: boolean;
124
- practiceQuestions?: IQuestion[];
183
+ practiceQuestions?: ALL_JOB_QUESTIONS_TYPE[];
125
184
  overlay?: string;
126
185
  introVideo?: string;
127
186
  welcomeTitle?: string;
@@ -132,7 +191,7 @@ interface IConfig {
132
191
  hideIntercom?: boolean;
133
192
  disablePractice?: boolean;
134
193
  }
135
- type IClientConfig = Omit<IConfig, 'practiceQuestions'> & {
194
+ declare type IClientConfig = Omit<IConfig, 'practiceQuestions'> & {
136
195
  practiceQuestions?: IClientQuestion[];
137
196
  };
138
197
  interface IWidgetConfig {
@@ -148,7 +207,7 @@ interface IWidgetConfig {
148
207
  styleUrls?: string | string[];
149
208
  fontsUrls?: string | string[];
150
209
  }
151
- type IClientWidgetConfig = Omit<IWidgetConfig, 'job' | 'config'> & {
210
+ declare type IClientWidgetConfig = Omit<IWidgetConfig, 'job' | 'config'> & {
152
211
  job: IClientJob;
153
212
  config: IClientConfig;
154
213
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myinterview/widget-react",
3
- "version": "1.0.60",
3
+ "version": "1.0.61-experimental",
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.36",
13
+ "@myinterview/component-library": "^1.0.43",
14
14
  "@sentry/react": "^7.7.0",
15
15
  "@sentry/tracing": "^7.7.0",
16
16
  "@xstate/react": "^3.0.1",
@@ -100,7 +100,6 @@
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",
104
103
  "babel-preset-react-app": "^10.0.1",
105
104
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
106
105
  "classnames": "^2.3.1",
@@ -141,6 +140,7 @@
141
140
  "webpack-manifest-plugin": "^4.0.2"
142
141
  },
143
142
  "peerDependencies": {
143
+ "babel-loader": "> =8.0.0",
144
144
  "react": ">= 16.8.0",
145
145
  "react-dom": ">= 16.8.0"
146
146
  },