@myinterview/widget-react 1.0.311 → 1.1.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.
Files changed (166) hide show
  1. package/dist/cjs/App.d.ts +3 -0
  2. package/dist/cjs/components/AnswerInstructions.d.ts +7 -0
  3. package/dist/cjs/components/AssessmentController.d.ts +12 -0
  4. package/dist/cjs/components/AssessmentFreeText.d.ts +7 -0
  5. package/dist/cjs/components/AssessmentMultiSelect.d.ts +9 -0
  6. package/dist/cjs/components/AssessmentSingleSelect.d.ts +9 -0
  7. package/dist/cjs/components/CharactersLimit.d.ts +7 -0
  8. package/dist/cjs/components/CountDown.d.ts +8 -0
  9. package/dist/cjs/components/Counter.d.ts +8 -0
  10. package/dist/cjs/components/DeviceSelector.d.ts +11 -0
  11. package/dist/cjs/components/DeviceSelectorList.d.ts +9 -0
  12. package/dist/cjs/components/DeviceSelectorListNative.d.ts +6 -0
  13. package/dist/cjs/components/Error.d.ts +8 -0
  14. package/dist/cjs/components/ErrorBoundaries.d.ts +9 -0
  15. package/dist/cjs/components/Errors.d.ts +12 -0
  16. package/dist/cjs/components/Explanation.d.ts +8 -0
  17. package/dist/cjs/components/Footer.d.ts +2 -0
  18. package/dist/cjs/components/Header.d.ts +10 -0
  19. package/dist/cjs/components/InnerView.d.ts +15 -0
  20. package/dist/cjs/components/Main.d.ts +11 -0
  21. package/dist/cjs/components/OuterView.d.ts +8 -0
  22. package/dist/cjs/components/PermissionSteps.d.ts +6 -0
  23. package/dist/cjs/components/PracticeModeInfo.d.ts +2 -0
  24. package/dist/cjs/components/PreviewItem.d.ts +20 -0
  25. package/dist/cjs/components/PreviewList.d.ts +18 -0
  26. package/dist/cjs/components/Question.d.ts +8 -0
  27. package/dist/cjs/components/QuestionItem.d.ts +12 -0
  28. package/dist/cjs/components/QuestionParamaters.d.ts +9 -0
  29. package/dist/cjs/components/QuestionsList.d.ts +11 -0
  30. package/dist/cjs/components/RecorderModal.d.ts +13 -0
  31. package/dist/cjs/components/Setup.d.ts +7 -0
  32. package/dist/cjs/components/SetupChecks.d.ts +14 -0
  33. package/dist/cjs/components/SliderModal.d.ts +8 -0
  34. package/dist/cjs/components/TopTips.d.ts +2 -0
  35. package/dist/cjs/components/Upload.d.ts +13 -0
  36. package/dist/cjs/components/VideoCamera.d.ts +31 -0
  37. package/dist/cjs/components/VideoQuestion.d.ts +10 -0
  38. package/dist/cjs/components/VideoTimeBar.d.ts +9 -0
  39. package/dist/cjs/components/WelcomePage.d.ts +16 -0
  40. package/dist/cjs/components/Widget.d.ts +3 -0
  41. package/dist/cjs/components/icons/ClockIcon.d.ts +2 -0
  42. package/dist/cjs/components/icons/Loading.d.ts +2 -0
  43. package/dist/cjs/components/icons/NoCameraMic.d.ts +2 -0
  44. package/dist/cjs/components/icons/PlayIcon.d.ts +6 -0
  45. package/dist/cjs/components/icons/Retake.d.ts +2 -0
  46. package/dist/cjs/components/icons/RotateScreenIcon.d.ts +2 -0
  47. package/dist/cjs/components/ui/DotSeparator.d.ts +2 -0
  48. package/dist/cjs/components/ui/Loader.d.ts +2 -0
  49. package/dist/cjs/components/ui/MicrophoneIndicator.d.ts +7 -0
  50. package/dist/cjs/components/ui/MinimizeButton.d.ts +6 -0
  51. package/dist/cjs/components/ui/PracticeMode.d.ts +2 -0
  52. package/dist/cjs/components/ui/Progress.d.ts +6 -0
  53. package/dist/cjs/components/ui/QuestionDuration.d.ts +6 -0
  54. package/dist/cjs/components/ui/QuestionNumber.d.ts +7 -0
  55. package/dist/cjs/components/ui/RecordingButton.d.ts +6 -0
  56. package/dist/cjs/components/ui/RotateScreen.d.ts +2 -0
  57. package/dist/cjs/components/ui/Signal.d.ts +9 -0
  58. package/dist/cjs/components/ui/StartNowButton.d.ts +6 -0
  59. package/dist/cjs/components/ui/StartRecordingButton.d.ts +11 -0
  60. package/dist/cjs/components/ui/StopRecordingButton.d.ts +7 -0
  61. package/dist/cjs/components/ui/UnsupportedModal.d.ts +6 -0
  62. package/dist/cjs/config/index.d.ts +7 -0
  63. package/dist/cjs/config/local.env.d.ts +6 -0
  64. package/dist/cjs/config/prod.env.d.ts +6 -0
  65. package/dist/cjs/config/staging.env.d.ts +6 -0
  66. package/dist/cjs/i18n/config.d.ts +1490 -0
  67. package/dist/cjs/index.d.ts +4 -0
  68. package/dist/cjs/index.js +36599 -0
  69. package/dist/cjs/index.js.map +1 -0
  70. package/dist/cjs/interfaces/candidateInterface.d.ts +14 -0
  71. package/dist/cjs/interfaces/candidateSessionInterface.d.ts +83 -0
  72. package/dist/cjs/interfaces/companyInterface.d.ts +4 -0
  73. package/dist/cjs/interfaces/configInterface.d.ts +64 -0
  74. package/dist/cjs/interfaces/countDownInterface.d.ts +23 -0
  75. package/dist/cjs/interfaces/jobInterface.d.ts +72 -0
  76. package/dist/cjs/interfaces/microphoneInterface.d.ts +41 -0
  77. package/dist/cjs/interfaces/networkInterface.d.ts +9 -0
  78. package/dist/cjs/interfaces/previewInterface.d.ts +14 -0
  79. package/dist/cjs/interfaces/recorderInterface.d.ts +203 -0
  80. package/dist/cjs/interfaces/storageInterface.d.ts +29 -0
  81. package/dist/cjs/interfaces/uploaderInterface.d.ts +41 -0
  82. package/dist/cjs/interfaces/videoInterface.d.ts +84 -0
  83. package/dist/cjs/interfaces/widgetInterface.d.ts +231 -0
  84. package/dist/cjs/machines/acceleratorMachines/accUploaderMachine.d.ts +6 -0
  85. package/dist/cjs/machines/acceleratorMachines/accWidgetMachine.d.ts +6 -0
  86. package/dist/cjs/machines/acceleratorMachines/counterMachine.d.ts +5 -0
  87. package/dist/cjs/machines/acceleratorMachines/microphoneMachine.d.ts +6 -0
  88. package/dist/cjs/machines/acceleratorMachines/networkMachine.d.ts +5 -0
  89. package/dist/cjs/machines/acceleratorMachines/previewMachine.d.ts +6 -0
  90. package/dist/cjs/machines/acceleratorMachines/recorderMachineV2.d.ts +6 -0
  91. package/dist/cjs/machines/acceleratorMachines/storageMachine.d.ts +6 -0
  92. package/dist/cjs/reportWebVitals.d.ts +3 -0
  93. package/dist/cjs/services/axiosInstances.service.d.ts +4 -0
  94. package/dist/cjs/services/s3.service.d.ts +1 -0
  95. package/dist/cjs/services/session.service.d.ts +57 -0
  96. package/dist/cjs/services/speedTest.service.d.ts +2 -0
  97. package/dist/cjs/services/video.service.d.ts +7 -0
  98. package/dist/cjs/setupTests.d.ts +1 -0
  99. package/dist/cjs/utils/authToken.utils.d.ts +7 -0
  100. package/dist/cjs/utils/constants.utils.d.ts +21 -0
  101. package/dist/cjs/utils/convertor.utils.d.ts +2 -0
  102. package/dist/cjs/utils/debug.utils.d.ts +19 -0
  103. package/dist/cjs/utils/device.utils.d.ts +12 -0
  104. package/dist/cjs/utils/errors.utils.d.ts +9 -0
  105. package/dist/cjs/utils/formatters.utils.d.ts +5 -0
  106. package/dist/cjs/utils/languages.utils.d.ts +1 -0
  107. package/dist/cjs/utils/messages.utils.d.ts +16 -0
  108. package/dist/cjs/utils/recorderErrors.utils.d.ts +29 -0
  109. package/dist/cjs/utils/sentry.utils.d.ts +6 -0
  110. package/dist/cjs/utils/statusCodes.utils.d.ts +13 -0
  111. package/dist/cjs/workers/microphone.worker.d.ts +2 -0
  112. package/dist/cjs/workers/worker-builder.d.ts +3 -0
  113. package/dist/esm/App.d.ts +1 -0
  114. package/dist/esm/components/AnswerInstructions.d.ts +7 -0
  115. package/dist/esm/components/AssessmentController.d.ts +12 -0
  116. package/dist/esm/components/AssessmentFreeText.d.ts +7 -0
  117. package/dist/esm/components/AssessmentMultiSelect.d.ts +9 -0
  118. package/dist/esm/components/AssessmentSingleSelect.d.ts +9 -0
  119. package/dist/esm/components/CharactersLimit.d.ts +7 -0
  120. package/dist/esm/components/CountDown.d.ts +3 -1
  121. package/dist/esm/components/DeviceSelector.d.ts +3 -2
  122. package/dist/esm/components/Errors.d.ts +2 -2
  123. package/dist/esm/components/Explanation.d.ts +2 -1
  124. package/dist/esm/components/InnerView.d.ts +1 -0
  125. package/dist/esm/components/Main.d.ts +2 -0
  126. package/dist/esm/components/PracticeModeInfo.d.ts +1 -7
  127. package/dist/esm/components/PreviewItem.d.ts +4 -0
  128. package/dist/esm/components/PreviewList.d.ts +1 -0
  129. package/dist/esm/components/Question.d.ts +2 -3
  130. package/dist/esm/components/QuestionItem.d.ts +2 -2
  131. package/dist/esm/components/QuestionParamaters.d.ts +9 -0
  132. package/dist/esm/components/QuestionsList.d.ts +2 -2
  133. package/dist/esm/components/RecorderModal.d.ts +2 -4
  134. package/dist/esm/components/Setup.d.ts +1 -0
  135. package/dist/esm/components/VideoCamera.d.ts +4 -2
  136. package/dist/esm/components/Widget.d.ts +0 -3
  137. package/dist/esm/components/ui/DotSeparator.d.ts +2 -0
  138. package/dist/esm/components/ui/StartRecordingButton.d.ts +1 -0
  139. package/dist/esm/i18n/config.d.ts +349 -0
  140. package/dist/esm/index.d.ts +2 -2
  141. package/dist/esm/index.js +6327 -12129
  142. package/dist/esm/index.js.map +1 -1
  143. package/dist/esm/interfaces/candidateSessionInterface.d.ts +1 -1
  144. package/dist/esm/interfaces/configInterface.d.ts +12 -6
  145. package/dist/esm/interfaces/countDownInterface.d.ts +23 -0
  146. package/dist/esm/interfaces/jobInterface.d.ts +43 -3
  147. package/dist/esm/interfaces/microphoneInterface.d.ts +3 -0
  148. package/dist/esm/interfaces/recorderInterface.d.ts +8 -3
  149. package/dist/esm/interfaces/uploaderInterface.d.ts +5 -3
  150. package/dist/esm/interfaces/videoInterface.d.ts +30 -1
  151. package/dist/esm/interfaces/widgetInterface.d.ts +28 -10
  152. package/dist/esm/machines/acceleratorMachines/counterMachine.d.ts +5 -0
  153. package/dist/esm/services/session.service.d.ts +1 -1
  154. package/dist/esm/services/video.service.d.ts +4 -4
  155. package/dist/esm/utils/constants.utils.d.ts +8 -0
  156. package/dist/esm/utils/convertor.utils.d.ts +2 -0
  157. package/dist/esm/utils/device.utils.d.ts +1 -1
  158. package/dist/esm/utils/formatters.utils.d.ts +1 -1
  159. package/dist/esm/utils/languages.utils.d.ts +1 -0
  160. package/dist/esm/utils/recorderErrors.utils.d.ts +1 -0
  161. package/dist/esm/utils/sentry.utils.d.ts +3 -1
  162. package/dist/esm/workers/microphone.worker.d.ts +2 -0
  163. package/dist/esm/workers/worker-builder.d.ts +3 -0
  164. package/dist/index.d.ts +82 -19
  165. package/package.json +121 -16
  166. package/dist/esm/utils/practiceQuestions.utils.d.ts +0 -2
@@ -0,0 +1,231 @@
1
+ import { RefObject } from 'react';
2
+ import { ActorRef, BaseActionObject, DoneInvokeEvent, Event, EventData, ResolveTypegenMeta, SCXML, ServiceMap, SingleOrArray, State, TypegenDisabled } from 'xstate';
3
+ import { IWidgetConfig } from './configInterface';
4
+ import { CAMERA_STATES_MESSAGES, INTERNET_STATES_MESSAGES, MICROPHONE_STATES_MESSAGES } from '../utils/messages.utils';
5
+ import { TAKE_TYPES } from './storageInterface';
6
+ import { ALL_JOB_QUESTIONS_TYPE } from './jobInterface';
7
+ import { IVideoError } from '../utils/errors.utils';
8
+ import { IVideoDimensions } from './videoInterface';
9
+ type IUploaderRef = {
10
+ [uploaderRef: string]: ActorRef<DoneInvokeEvent<any>>;
11
+ };
12
+ export declare const VIDEO_ERROR_MESSAGES: {
13
+ RETRY: "RETRY";
14
+ REDIRECT: "REDIRECT";
15
+ NO_ERROR: "";
16
+ };
17
+ export type ICameraStateKey = keyof typeof CAMERA_STATES_MESSAGES;
18
+ export type IMicrophoneStateKey = keyof typeof MICROPHONE_STATES_MESSAGES;
19
+ export type IInternetStateKey = keyof typeof INTERNET_STATES_MESSAGES;
20
+ export type IVideoCorruptedMessagesKey = keyof typeof VIDEO_ERROR_MESSAGES;
21
+ export declare const CAMERA_STATES: {
22
+ [K in ICameraStateKey]: K;
23
+ };
24
+ export declare const MICROPHONE_STATES: {
25
+ [K in IMicrophoneStateKey]: K;
26
+ };
27
+ export declare const INTERNET_STATES: {
28
+ [K in IInternetStateKey]: K;
29
+ };
30
+ export declare const VIDEO_CORRUPTED_STATES: {
31
+ [K in IVideoCorruptedMessagesKey]: K;
32
+ };
33
+ export interface IChecksMetaObj {
34
+ key: 'camera' | 'microphone' | 'internet';
35
+ state: ICameraStateKey | IMicrophoneStateKey | IInternetStateKey;
36
+ message?: string;
37
+ }
38
+ export interface IChecksState {
39
+ camera: ICameraStateKey;
40
+ microphone: IMicrophoneStateKey;
41
+ internet: IInternetStateKey;
42
+ }
43
+ interface IChecksMessage {
44
+ camera: string;
45
+ microphone: string;
46
+ internet: string;
47
+ }
48
+ export interface InitialState {
49
+ speedTestResult: number;
50
+ widgetConfig: IWidgetConfig;
51
+ questions: ALL_JOB_QUESTIONS_TYPE[];
52
+ isConnected: boolean;
53
+ videoRef: RefObject<HTMLVideoElement>;
54
+ networkRef: ActorRef<DoneInvokeEvent<any>> | null;
55
+ recorderRef: ActorRef<DoneInvokeEvent<any>> | null;
56
+ storageRef: ActorRef<DoneInvokeEvent<any>> | null;
57
+ previewRef: ActorRef<DoneInvokeEvent<any>> | null;
58
+ uploaderRefs: IUploaderRef;
59
+ countDownRef: ActorRef<DoneInvokeEvent<any>> | null;
60
+ timer: number;
61
+ currentQuestion: number;
62
+ currentTake: number;
63
+ selectedTake: number | null;
64
+ recordingType: TAKE_TYPES;
65
+ checksState: IChecksState;
66
+ checksMessage: IChecksMessage;
67
+ totalFileSize: number;
68
+ totalUploadedFilesSize: {
69
+ [questionNumber: string]: number;
70
+ };
71
+ totalUploadSpeed: {
72
+ [questionNumber: string]: number;
73
+ };
74
+ error: IVideoError | null;
75
+ failedRecordingAttempts: number;
76
+ failedRecordingMessage: IVideoCorruptedMessagesKey;
77
+ isResumed: boolean;
78
+ videoDimensions: IVideoDimensions;
79
+ }
80
+ export interface IWidgetMachineProps {
81
+ widgetMachine: State<InitialState, DoneInvokeEvent<any>, any, {
82
+ value: any;
83
+ context: InitialState;
84
+ }, ResolveTypegenMeta<TypegenDisabled, DoneInvokeEvent<any>, BaseActionObject, ServiceMap>>;
85
+ sendToWidget: (event: SCXML.Event<DoneInvokeEvent<any>> | SingleOrArray<Event<DoneInvokeEvent<any>>>, payload?: EventData | undefined) => void;
86
+ }
87
+ export declare const enum STATES {
88
+ INIT = "init",
89
+ WELCOME = "welcome",
90
+ SETUP = "setup",
91
+ SETUP__INIT_STORAGE = "initStorage",
92
+ SETUP__INIT_RECORDER = "initRecorder",
93
+ SETUP__TEST = "test",
94
+ SETUP__TEST__CAMERA = "testCamera",
95
+ SETUP__TEST__CAMERA__WAITING = "testCameraWaiting",
96
+ SETUP__TEST__CAMERA__ERROR = "testCameraError",
97
+ SETUP__TEST__CAMERA__SUCCESS = "testCameraSuccess",
98
+ SETUP__TEST__MICROPHONE = "testMicrophone",
99
+ SETUP__TEST__MICROPHONE__WAITING = "testMicrophoneWaiting",
100
+ SETUP__TEST__MICROPHONE__ERROR = "testMicrophoneError",
101
+ SETUP__TEST__MICROPHONE__SUCCESS = "testMicrophoneSuccess",
102
+ SETUP__TEST__INTERNET = "testInternet",
103
+ SETUP__TEST__INTERNET__IDLE = "testInternetIdle",
104
+ SETUP__TEST__INTERNET__TESTING = "testInternetTesting",
105
+ SETUP__TEST__INTERNET__FINISHED = "testInternetFinished",
106
+ INTERVIEW = "interview",
107
+ INTERVIEW__INIT = "interviewInit",
108
+ INTERVIEW__EXPLANATION = "interviewExplanation",
109
+ INTERVIEW__QUESTION = "interviewQuestion",
110
+ INTERVIEW__VIDEO_QUESTION = "interviewVideoQuestion",
111
+ INTERVIEW__ANSWER_SELECTOR = "interviewAnswerSelector",
112
+ INTERVIEW__ASSESSMENT = "interviewAssessment",
113
+ INTERVIEW__RECORDING = "interviewRecording",
114
+ PREVIEW = "preview",
115
+ NEXT_QUESTION_MIDDLEWARE = "nextQuestionMiddleware",
116
+ RE_INIT_RECORDER = "reInitRecorder",
117
+ RE_INIT_RECORDER__NEXT_RETAKE = "reInitRecorderNextRetake",
118
+ RE_INIT_RECORDER__NEXT_QUESTION = "reInitRecorderNextQuestion",
119
+ UPLOADING = "uploading",
120
+ CONFIRM = "confirm",
121
+ FINISHED = "finished",
122
+ ERROR = "error"
123
+ }
124
+ export declare const enum ACTIONS {
125
+ CONSOLE_LOG = "consoleLog",
126
+ CONSOLE_DEBUG = "consoleDebug",
127
+ SET_CONNECTION = "setConnection",
128
+ SET_CONFIG = "getConfig",
129
+ SET_NEXT_QUESTION = "setNextQuestion",
130
+ SET_SPEED_TEST = "setSpeedTest",
131
+ SET_CHECKS = "setChecks",
132
+ SET_PRACTICE_MODE = "setPracticeMode",
133
+ SET_QUESTION_MODE = "setQuestionMode",
134
+ SPAWN_NETWORK = "spawnNetwork",
135
+ SPAWN_RECORDER = "spawnRecorder",
136
+ SPAWN_UPLOADER = "spawnUploader",
137
+ SPAWN_STORAGE = "spawnStorage",
138
+ SPAWN_PREVIEW = "spawnPreview",
139
+ SPAWN_COUNT_DOWN = "spawnCountDown",
140
+ STOP_RECORDER = "stopRecorder",
141
+ STOP_PREVIEW = "stopPreview",
142
+ STOP_COUNT_DOWN = "stopCountDown",
143
+ STORE_TAKE = "storeTake",
144
+ GET_TAKE = "getTake",
145
+ GET_TAKES = "getTakes",
146
+ SEND_TAKES = "sendTakes",
147
+ UPDATE_VIDEO_FILE_COMPLETED = "updateVideoFileCompleted",
148
+ UPDATE_TOTAL_FILES_SIZE = "updateTotalFileSize",
149
+ UPDATE_TOTAL_UPLOADED_FILES_SIZE = "updateTotalUploadedFileSize",
150
+ UPDATE_QUESTION_NUMBER = "updateQuestionNumber",
151
+ UPDATE_RETAKES_NUMBER = "updateRetakesNumber",
152
+ UPDATE_TIMER = "updateTimer",
153
+ UPDATE_AXION_AUTH = "updateAxiosAuth",
154
+ RECORDER_RE_INIT = "recorderReInit",
155
+ DEACTIVATE_RECORDER = "deactivateRecorder",
156
+ RECORDER_RE_INIT_AUTO_START = "recorderReInitAutoStart",
157
+ UPDATE_RECORDER_PARAMS = "updateRecorderParams",
158
+ UPDATE_TOTAL_UPLOADED = "updateTotalUploaded",
159
+ SET_VIDEO_ERROR = "setVideoError",
160
+ UPDATE_RECORDER_SPEED_TEST = "updateRecorderSpeedTest",
161
+ SENTRY = "sentry",
162
+ SET_SESSION = "setSession",
163
+ SESSION_EVENT = "sessionEvent",
164
+ REVOKE_MEMORY = "revokeMemory",
165
+ UPDATE_VIDEO_OBJECT = "updateVideoObject",
166
+ UPDATE_VIDEO_PART = "updateVideoPart",
167
+ INCREASE_FAILED_RECORDING_ATTEMPTS = "increaseFailedRecordingAttempts",
168
+ RESET_FAILED_RECORDING_ATTEMPTS = "resetFailedRecordingAttempts",
169
+ CLEAR_VIDEO_ERROR = "clearVideoError",
170
+ UPDATE_VIDEO_DIMENSIONS = "updateVideoDimensions"
171
+ }
172
+ export declare const enum EVENTS {
173
+ SPAWN_UPLOADER = "SPAWN_UPLOADER",
174
+ TEST = "TEST",
175
+ PRACTICE_MODE = "PRACTICE_MODE",
176
+ QUESTION_MODE = "QUESTION_MODE",
177
+ IDLE = "IDLE",
178
+ PREVIEW = "PREVIEW",
179
+ BACK = "BACK",
180
+ STOP_RECORDING = "STOP_RECORDING",
181
+ GET_TAKES = "GET_TAKES",
182
+ TAKE_TO_UPLOAD_RECEIVED = "TAKE_TO_UPLOAD_RECEIVED",
183
+ TAKES_RECEIVED = "TAKES_RECEIVED",
184
+ NEXT_STEP = "NEXT_STEP",
185
+ NEXT_QUESTION = "NEXT_QUESTION",
186
+ NEXT_RETAKE = "NEXT_RETAKE",
187
+ READY_TO_START_RECORDING = "READY_TO_START_RECORDING",
188
+ UPLOADER_PROGRESS = "UPLOADER_PROGRESS",
189
+ UPLOADER_FINISHED = "UPLOADER_FINISHED",
190
+ RECORDER_ERROR = "RECORDER_ERROR",
191
+ RETRY = "RETRY",
192
+ UPDATE_TIMER = "UPDATE_TIMER",
193
+ UPDATE_VIDEO_DIMENSIONS = "UPDATE_VIDEO_DIMENSIONS"
194
+ }
195
+ export declare const enum SERVICES {
196
+ UPDATE_VIDEO_OBJECT_CALL = "updateVideoObjectCall",
197
+ UPDATE_VIDEO_PART_CALL = "updateVideoPartCall"
198
+ }
199
+ export declare const enum GUARDS {
200
+ NO_STORAGE = "noStorage",
201
+ NO_RECORDER = "noRecorder",
202
+ IS_THINKING_TIME = "isThinkingTime",
203
+ IS_VIDEO_QUESTION = "isVideoQuestion",
204
+ IS_QUESTION_MODE = "isQuestionMode",
205
+ IS_PRACTICE_MODE = "isPracticeMod",
206
+ IS_NOT_LAST_TAKE = "isNotLastTake",
207
+ IS_LAST_INTERVIEW_QUESTION = "isLastInterviewQuestion",
208
+ CAN_RETEST_SPEED_CONNECTION = "canRetestSpeedConnection",
209
+ IS_CONNECTED = "isConnected",
210
+ IS_DISCONNECTED = "isDisconnected",
211
+ CAN_START_INTERVIEW = "canStartInterview",
212
+ ARE_ALL_QUESTIONS_UPLOADED = "areAllQuestionsUploaded",
213
+ SHOULD_SHOW_WELCOME = "shouldShowWelcome",
214
+ IS_NO_SOUND_ERROR = "isNoSoundError",
215
+ IS_VIDEO_CORRUPTED = "isVideoCorrupted",
216
+ IS_AUDIO_ERROR = "isAudioError",
217
+ IS_VIDEO_ERROR = "isVideoError",
218
+ THERE_ARE_NO_VIDEO_QUESTIONS_TYPE = "thereAreNoVideoQuestionType",
219
+ IS_RECORDER_READY = "isRecorderReady",
220
+ IS_ASSESSMENT_QUESTION = "isAssessmentQuestion"
221
+ }
222
+ export declare const enum TAGS {
223
+ SETUP = "setup",
224
+ SHOW_CAMERA = "showCamera",
225
+ CAN_START_RECORDING = "canStartRecording",
226
+ DISPLAY_OUTER_VIEW = "displayOuterView",
227
+ DISPLAY_QUESTION = "displayQuestion",
228
+ DISPLAY_QUESTIONS_LIST = "displayQuestionsList",
229
+ LOADING = "loading"
230
+ }
231
+ export {};
@@ -0,0 +1,6 @@
1
+ import { DoneInvokeEvent } from 'xstate';
2
+ import { InitialState } from '../../interfaces/uploaderInterface';
3
+ export declare const accUploaderMachine: import("xstate").StateMachine<InitialState, any, DoneInvokeEvent<any>, {
4
+ value: any;
5
+ context: InitialState;
6
+ }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, DoneInvokeEvent<any>, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
@@ -0,0 +1,6 @@
1
+ import { DoneInvokeEvent } from 'xstate';
2
+ import { InitialState } from '../../interfaces/widgetInterface';
3
+ export declare const accWidgetMachine: import("xstate").StateMachine<InitialState, any, DoneInvokeEvent<any>, {
4
+ value: any;
5
+ context: InitialState;
6
+ }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, DoneInvokeEvent<any>, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
@@ -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>>;
@@ -0,0 +1,6 @@
1
+ import { DoneInvokeEvent } from 'xstate';
2
+ import { InitialState } from '../../interfaces/microphoneInterface';
3
+ export declare const microphoneMachine: import("xstate").StateMachine<InitialState, any, DoneInvokeEvent<any>, {
4
+ value: any;
5
+ context: InitialState;
6
+ }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, DoneInvokeEvent<any>, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
@@ -0,0 +1,5 @@
1
+ import { DoneInvokeEvent } from 'xstate';
2
+ export declare const networkMachine: import("xstate").StateMachine<{}, any, DoneInvokeEvent<any>, {
3
+ value: any;
4
+ context: {};
5
+ }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, DoneInvokeEvent<any>, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
@@ -0,0 +1,6 @@
1
+ import { DoneInvokeEvent } from 'xstate';
2
+ import { PreviewInterface } from '../../interfaces/previewInterface';
3
+ export declare const previewMachine: import("xstate").StateMachine<PreviewInterface, any, DoneInvokeEvent<any>, {
4
+ value: any;
5
+ context: PreviewInterface;
6
+ }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, DoneInvokeEvent<any>, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
@@ -0,0 +1,6 @@
1
+ import { DoneInvokeEvent } from 'xstate';
2
+ import { RecorderInterface } from '../../interfaces/recorderInterface';
3
+ export declare const recorderMachineV2: import("xstate").StateMachine<RecorderInterface, any, DoneInvokeEvent<any>, {
4
+ value: any;
5
+ context: RecorderInterface;
6
+ }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, DoneInvokeEvent<any>, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
@@ -0,0 +1,6 @@
1
+ import { DoneInvokeEvent } from 'xstate';
2
+ import { InitialState } from '../../interfaces/storageInterface';
3
+ export declare const storageMachine: import("xstate").StateMachine<InitialState, any, DoneInvokeEvent<any>, {
4
+ value: any;
5
+ context: InitialState;
6
+ }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, DoneInvokeEvent<any>, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
@@ -0,0 +1,3 @@
1
+ import { ReportHandler } from 'web-vitals';
2
+ declare const reportWebVitals: (onPerfEntry?: ReportHandler) => void;
3
+ export default reportWebVitals;
@@ -0,0 +1,4 @@
1
+ export declare const videoAxiosInstance: import("axios").AxiosInstance;
2
+ export declare const s3AxiosInstance: import("axios").AxiosInstance;
3
+ export declare const updateVideoAxiosAuth: (auth: string) => void;
4
+ export declare const updateVideoAxiosBaseURL: (url: string) => void;
@@ -0,0 +1 @@
1
+ export declare const uploadToS3: (url: string, data: File, onProgress?: ((e: any) => void) | undefined, timeout?: number) => Promise<void>;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @author tht7 ( tht7 )
3
+ * @date 10/07/12022 6:36 pm
4
+ */
5
+ import { ICandidateSession } from '../interfaces/candidateSessionInterface';
6
+ /**
7
+ * This function will update the session in the database and cache it in the window object
8
+ * it will fill in the current session over the provided object
9
+ * @param session
10
+ * @param baseURL
11
+ */
12
+ export declare function updateSession(session: Partial<ICandidateSession>, baseURL?: string): Promise<ICandidateSession | undefined>;
13
+ /**
14
+ * This function will fetch the session from the sessionStorage and server
15
+ * it will then cache the session in the window object
16
+ * @param _session - in case you want to override the session, or save a new one to the cache
17
+ * @param _session_id - in case you want to override the session_id and fetch from the server
18
+ */
19
+ export declare function getCandidateSession(_session?: ICandidateSession, _session_id?: string): Promise<ICandidateSession | undefined>;
20
+ export declare function getSessionIdFromCache(): string | undefined | null;
21
+ /**
22
+ * this will remove the session from the sessionStorage, but not the window cache
23
+ * this should signal the end of this session
24
+ * however the end of a session is when the window gets closed
25
+ * so in order to prevent a new window from (maybe) getting the stale session
26
+ * we remove it from the sessionStorage
27
+ */
28
+ export declare function deleteSession(): void;
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> = {
31
+ [K in keyof T]-?: T[K] extends (V | undefined) ? K : never;
32
+ }[keyof T];
33
+ /**
34
+ * A cute shortcut for updating a date event in the session
35
+ * just give it the key of the date event, and it will update it
36
+ * @param eventType
37
+ */
38
+ export declare function registerDateEvent(eventType: KeysMatching<ICandidateSession, Date>): Promise<ICandidateSession | undefined>;
39
+ /**
40
+ * Another cute shortcut for updating a number state of a session
41
+ * if no data is provided, it will just increment the number
42
+ * @param eventType
43
+ * @param data
44
+ */
45
+ export declare function registerCountEvent(eventType: KeysMatching<ICandidateSession, number>, data?: number): Promise<ICandidateSession | undefined>;
46
+ /**
47
+ * Another cute shortcut for updating a number state of a session
48
+ * if no data is provided, it will just increment the number
49
+ * @param warning
50
+ */
51
+ export declare function registerWarning(warning: string): Promise<ICandidateSession | undefined>;
52
+ export declare const triggerEvent: {
53
+ warning: typeof registerWarning;
54
+ date: typeof registerDateEvent;
55
+ number: typeof registerCountEvent;
56
+ };
57
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const ONE_MB_IN_BYTES = 1048576;
2
+ export declare const accSpeedTest: () => Promise<number>;
@@ -0,0 +1,7 @@
1
+ import { IWidgetConfigRequest, IWidgetConfigResponse } from '../interfaces/configInterface';
2
+ import { IVideo, ALL_VIDEO_FILE_TYPES, IVideoDimensions } from '../interfaces/videoInterface';
3
+ export declare const createVideo: (widgetConfig: IWidgetConfigRequest) => Promise<IWidgetConfigResponse>;
4
+ export declare const getVideo: (videoId: string) => 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
+ export declare const getUploadUrl: (videoId: string, fileName: string, typeExtension: string, { width, height }: IVideoDimensions) => Promise<IWidgetConfigResponse>;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,7 @@
1
+ interface IGetToken {
2
+ type: string;
3
+ value: string;
4
+ secretKey: string;
5
+ }
6
+ export declare const getToken: ({ type, value, secretKey }: IGetToken) => string;
7
+ export {};
@@ -0,0 +1,21 @@
1
+ export declare const DEFAULT_COUNT_DOWN = 3;
2
+ export declare const DEFAULT_DURATION = 60;
3
+ export declare const DEFAULT_ATTEMPTS = 3;
4
+ export declare const DEFAULT_THINKING_TIME = 0;
5
+ export declare const ENOUGH_RECORDING_TIME = 3;
6
+ export declare const SPEED_TEST_FILE_SIZE = 5;
7
+ export declare const FAST_UPLOAD_SPEED = 0.35;
8
+ export declare const SLOW_UPLOAD_SPEED = 0.1;
9
+ export declare const SPEED_TEST_TIMEOUT = 5000;
10
+ export declare const VIDEO_INACTIVE_TIMEOUT = 2000;
11
+ export declare const MICROPHONE_NO_SOUND_ERROR_CODE = 777;
12
+ export declare const MAX_FAILED_RECORDING_ATTEMPTS = 2;
13
+ export declare const MICROPHONE_RETAKE_COUNT = 100;
14
+ export declare const SECONDS_LEFT_HIGHLIGHT = 10;
15
+ export declare const DEFAULT_ASSESSMENT_MAX_CHARS = 300;
16
+ export declare const DEFAULT_ASSESSMENT_DURATION = 0;
17
+ export declare const DEFAULT_VIDEO_DIMENSIONS: {
18
+ width: number;
19
+ height: number;
20
+ };
21
+ export declare const FONT_URL = "https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700&display=swap";
@@ -0,0 +1,2 @@
1
+ import { IClientQuestion, IQuestion } from '../interfaces/jobInterface';
2
+ export declare const convertQuestions: (questions?: IClientQuestion[]) => IQuestion[];
@@ -0,0 +1,19 @@
1
+ export declare const enum DEBUG {
2
+ FETCHING_INTERVIEW = "Fetching interview data",
3
+ INTERVIEW_DATA_RECEIVED = "Interview data received",
4
+ FETCHING_INTERVIEW_ERROR = "Failed to fetch interview",
5
+ WELCOME_PAGE_STAGE = "In welcome page stage",
6
+ SETUP_STAGE = "In setup stage",
7
+ MEIDA_DEVICE_SUCCESS = "Media device available",
8
+ MEDIA_DEVICE_ERROR = "Media device error",
9
+ NO_SOUND_DETECTED = "No sound detected",
10
+ DEVICE_CHANGED = "Device changed",
11
+ SPEED_TEST_DONE = "Speed test result received",
12
+ PRACTICE_STARTED = "Practice started",
13
+ INTERVIEW_STARTED = "Interview started",
14
+ RETAKE_CLICKED = "Retake clicked",
15
+ QUESTION_SUBMITTED = "Qeustion submitted",
16
+ UPLOADING_STATE = "In uploading state",
17
+ UPLOAD_COMPLETED = "Upload completed",
18
+ INTERVIEW_SUBMITTED = "Interview submitted successfully"
19
+ }
@@ -0,0 +1,12 @@
1
+ export declare const isMobile: boolean;
2
+ export declare const isAndroid: boolean;
3
+ export declare const isSupportedIosDevice: boolean;
4
+ export declare const isSupportedDevice: boolean;
5
+ declare const PLATFORMS_OPTIONS: readonly ["ANDROID", "IOS", "MACBOOK", "WINDOWS"];
6
+ declare const BROWSERS_OPTIONS: readonly ["CHROME", "SAFARI", "FIREFOX", "SAMSUNG"];
7
+ type DEVICE_TYPE = {
8
+ PLATFORM: typeof PLATFORMS_OPTIONS[number];
9
+ BROWSER: typeof BROWSERS_OPTIONS[number];
10
+ };
11
+ export declare const DEVICE: DEVICE_TYPE;
12
+ export {};
@@ -0,0 +1,9 @@
1
+ import { STATUS_CODES } from './statusCodes.utils';
2
+ export interface IVideoError {
3
+ callId: string;
4
+ errorCode: number;
5
+ errorMessage: string;
6
+ statusCode: STATUS_CODES;
7
+ statusReason: string;
8
+ time: number;
9
+ }
@@ -0,0 +1,5 @@
1
+ export declare const twoDigitsNumber: (num: number) => string;
2
+ export declare const timeFormatter: (number: number) => string;
3
+ export declare const timeLeftInMinutesFormatter: (number: number) => string;
4
+ export declare const timerCountDown: (number: number) => string[];
5
+ export declare const formattedDuration: (number: number) => string;
@@ -0,0 +1 @@
1
+ export declare const isRtl: (language?: string) => boolean;
@@ -0,0 +1,16 @@
1
+ export declare const CAMERA_STATES_MESSAGES: {
2
+ WAITING: string;
3
+ ERROR: string;
4
+ READY: string;
5
+ };
6
+ export declare const MICROPHONE_STATES_MESSAGES: {
7
+ WAITING: string;
8
+ ERROR: string;
9
+ READY: string;
10
+ };
11
+ export declare const INTERNET_STATES_MESSAGES: {
12
+ DISCONNECTED: string;
13
+ TESTING: string;
14
+ SLOW_CONNECTION: string;
15
+ CONNECTED: string;
16
+ };
@@ -0,0 +1,29 @@
1
+ export declare const TYPES_EXPLANATION: {
2
+ VIDEO: string;
3
+ AUDIO: string;
4
+ VIDEO_AUDIO: string;
5
+ };
6
+ export declare const enum MEDIA_RECORDER_STATES {
7
+ INACTIVE = "inactive",
8
+ RECORDING = "recording",
9
+ PAUSED = "paused"
10
+ }
11
+ export declare const ERROR_ENUM: {
12
+ NotAllowedError: string;
13
+ NotFoundError: string;
14
+ NotReadableError: string;
15
+ AbortError: string;
16
+ OverconstrainedError: string;
17
+ SecurityError: string;
18
+ TypeError: string;
19
+ NoSoundError: string;
20
+ UndefinedError: string;
21
+ VideoCorrupted: string;
22
+ };
23
+ export declare const recorderErrors: {
24
+ [x: string]: {
25
+ type: string;
26
+ message: string;
27
+ name: string;
28
+ };
29
+ };
@@ -0,0 +1,6 @@
1
+ import * as Sentry from '@sentry/browser';
2
+ import { DoneInvokeEvent } from 'xstate';
3
+ import { Breadcrumb } from '@sentry/types';
4
+ export declare const SentryHub: Sentry.Hub;
5
+ export declare const SentryTrackingFn: (event: DoneInvokeEvent<any>, context: any, name: string, level: 'fatal' | 'error' | 'warning' | 'log' | 'info' | 'debug') => void;
6
+ export declare const SentryBreadcrumb: ({ type, level, event_id, category, message, data }: Breadcrumb) => void;
@@ -0,0 +1,13 @@
1
+ export declare const enum STATUS_CODES {
2
+ OK = 200,
3
+ CREATED = 201,
4
+ DELETED = 202,
5
+ BAD_REQUEST = 400,
6
+ UNAUTHORIZED = 401,
7
+ PAYMENT_REQUIRED = 402,
8
+ FORBIDDEN = 403,
9
+ NOT_FOUND = 404,
10
+ TOO_MANY_REQUESTS = 429,
11
+ SERVER_ERROR = 500,
12
+ SERVICE_UNAVAILABLE = 503
13
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: () => void;
2
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export default class Builder extends Worker {
2
+ constructor(worker: Worker);
3
+ }
package/dist/esm/App.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import React from 'react';
2
+ import './assets/styles/global.scss';
2
3
  export declare const App: React.FC;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ASSESSMENT_QUESTIONS_TYPE } from '../interfaces/jobInterface';
3
+ interface IProps {
4
+ currentQuestionObj: ASSESSMENT_QUESTIONS_TYPE;
5
+ }
6
+ export declare const AnswerInstructions: React.FC<IProps>;
7
+ export {};
@@ -0,0 +1,12 @@
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 {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ onAnswer: (answer: string) => void;
4
+ maxChars?: number;
5
+ }
6
+ export declare const AssessmentFreeText: React.FC<IProps>;
7
+ export {};
@@ -0,0 +1,9 @@
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 {};
@@ -0,0 +1,9 @@
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 {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ currentLength: number;
4
+ maxLength: number;
5
+ }
6
+ export declare const CharactersLimit: React.FC<IProps>;
7
+ export {};
@@ -1,6 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  interface CountDownProps {
3
3
  countDown: number;
4
+ forceMobileCounter?: boolean;
5
+ numberOfSecondsToHighlight?: number;
4
6
  }
5
- export declare const CountDown: ({ countDown }: CountDownProps) => JSX.Element;
7
+ export declare const CountDown: ({ countDown, forceMobileCounter, numberOfSecondsToHighlight }: CountDownProps) => JSX.Element;
6
8
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { mediaDeviceType } from '../interfaces/recorderInterface';
3
3
  export interface IDeviceSelectorProps {
4
4
  handleDeviceChange: (type?: mediaDeviceType, id?: string) => void;
@@ -6,5 +6,6 @@ export interface IDeviceSelectorProps {
6
6
  videoDevices?: MediaDeviceInfo[];
7
7
  selectedAudioDevice?: MediaDeviceInfo;
8
8
  selectedVideoDevice?: MediaDeviceInfo;
9
+ myinterviewRef: React.RefObject<HTMLDivElement>;
9
10
  }
10
- export declare const DeviceSelector: ({ handleDeviceChange, videoDevices, audioDevices, selectedAudioDevice, selectedVideoDevice, }: IDeviceSelectorProps) => JSX.Element;
11
+ export declare const DeviceSelector: ({ handleDeviceChange, videoDevices, audioDevices, selectedAudioDevice, selectedVideoDevice, myinterviewRef, }: IDeviceSelectorProps) => JSX.Element;