shared-ritm 1.3.69 → 1.3.71

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 (72) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared-ritm.es.js +3565 -3544
  3. package/dist/shared-ritm.umd.js +144 -144
  4. package/dist/types/api/services/AuthService.d.ts +1 -0
  5. package/dist/types/api/services/UserService.d.ts +2 -1
  6. package/dist/types/api/settings/ApiService.d.ts +6 -2
  7. package/dist/types/api/types/Api_Auth.d.ts +15 -0
  8. package/dist/types/api/types/Api_User.d.ts +9 -0
  9. package/package.json +70 -70
  10. package/src/App.vue +2461 -2461
  11. package/src/api/services/AuthService.ts +67 -53
  12. package/src/api/services/ControlsService.ts +96 -96
  13. package/src/api/services/EquipmentService.ts +29 -29
  14. package/src/api/services/GanttService.ts +23 -23
  15. package/src/api/services/MetricsService.ts +127 -127
  16. package/src/api/services/RepairsService.ts +111 -111
  17. package/src/api/services/UserService.ts +129 -123
  18. package/src/api/services/VideoService.ts +118 -118
  19. package/src/api/settings/ApiService.ts +184 -124
  20. package/src/api/types/Api_Auth.ts +121 -105
  21. package/src/api/types/Api_Metrics.ts +26 -26
  22. package/src/api/types/Api_Repairs.ts +186 -186
  23. package/src/api/types/Api_Tasks.ts +376 -376
  24. package/src/api/types/Api_User.ts +156 -146
  25. package/src/api/types/Api_Video.ts +244 -244
  26. package/src/common/app-button/Button.stories.ts +369 -369
  27. package/src/common/app-checkbox/AppCheckbox.vue +31 -33
  28. package/src/common/app-checkbox/Checkbox.stories.ts +252 -252
  29. package/src/common/app-date-picker/DatePicker.stories.ts +66 -66
  30. package/src/common/app-datepicker/Datepicker.stories.ts +145 -145
  31. package/src/common/app-dialogs/AppConfirmDialog.vue +109 -109
  32. package/src/common/app-dialogs/Confirm.stories.ts +93 -93
  33. package/src/common/app-dropdown/Dropdown.stories.ts +94 -94
  34. package/src/common/app-file/File.stories.ts +104 -104
  35. package/src/common/app-icon/AppIcon.vue +108 -108
  36. package/src/common/app-icon/Icon.stories.ts +91 -91
  37. package/src/common/app-input/Input.stories.ts +160 -160
  38. package/src/common/app-input-new/InputNew.stories.ts +240 -240
  39. package/src/common/app-input-search/InputSearch.stories.ts +149 -149
  40. package/src/common/app-layout/components/AppLayoutHeader.vue +289 -289
  41. package/src/common/app-loader/Loader.stories.ts +114 -114
  42. package/src/common/app-select/AppSelect.vue +159 -159
  43. package/src/common/app-select/Select.stories.ts +155 -155
  44. package/src/common/app-sidebar/AppSidebar.vue +174 -174
  45. package/src/common/app-table/AppTable.vue +313 -313
  46. package/src/common/app-table/components/ModalSelect.stories.ts +323 -323
  47. package/src/common/app-table/components/ModalSelect.vue +302 -302
  48. package/src/common/app-table/components/TableModal.vue +367 -367
  49. package/src/common/app-table/controllers/useColumnSelector.ts +45 -45
  50. package/src/common/app-table/controllers/useTableModel.ts +97 -97
  51. package/src/common/app-toggle/AppToggle.vue +12 -14
  52. package/src/common/app-toggle/Toggle.stories.ts +245 -245
  53. package/src/common/app-wrapper/AppWrapper.vue +31 -31
  54. package/src/configs/storybook.ts +14 -14
  55. package/src/index.ts +131 -131
  56. package/src/shared/styles/general.css +140 -140
  57. package/src/styles/variables.sass +12 -12
  58. package/src/utils/helpers.ts +59 -59
  59. package/dist/types/api/services/PhotoService.d.ts +0 -40
  60. package/dist/types/stories/Button.stories.d.ts +0 -13
  61. package/dist/types/stories/Checkbox.stories.d.ts +0 -7
  62. package/dist/types/stories/Confirm.stories.d.ts +0 -8
  63. package/dist/types/stories/DatePicker.stories.d.ts +0 -8
  64. package/dist/types/stories/Dropdown.stories.d.ts +0 -8
  65. package/dist/types/stories/File.stories.d.ts +0 -8
  66. package/dist/types/stories/Icon.stories.d.ts +0 -7
  67. package/dist/types/stories/Input.stories.d.ts +0 -11
  68. package/dist/types/stories/InputNew.stories.d.ts +0 -12
  69. package/dist/types/stories/InputSearch.stories.d.ts +0 -10
  70. package/dist/types/stories/Loader.stories.d.ts +0 -8
  71. package/dist/types/stories/Select.stories.d.ts +0 -7
  72. package/dist/types/stories/Toggle.stories.d.ts +0 -8
@@ -1,123 +1,129 @@
1
- import ApiService from '../settings/ApiService'
2
- import {
3
- Api_User,
4
- Api_User_Create,
5
- Api_User_Delete_Body,
6
- Api_User_Delete_Photos_Body,
7
- Api_User_Position,
8
- Api_User_Role,
9
- Api_User_Team,
10
- Api_User_Team_Search,
11
- Api_User_Warehouse,
12
- } from '../types/Api_User'
13
- import { ResponseApi } from '../types/Api_Service'
14
-
15
- class UserService extends ApiService {
16
- public async editUser({ id, model }: { id: string; model: any }): Promise<Api_User> {
17
- return await this.put<Partial<Api_User>, Api_User>(`/admin/users/${id}`, model)
18
- }
19
-
20
- public async getUser(id: string): Promise<Api_User> {
21
- return await this.get<Api_User>(`/admin/users/${id}`)
22
- }
23
-
24
- public async getUserWarehouses(params: {
25
- user_id: string
26
- page?: number
27
- }): Promise<ResponseApi<Api_User_Warehouse[]>> {
28
- return await this.get<ResponseApi<Api_User_Warehouse[]>>(`users/get_warehouse_list_by_user`, { params })
29
- }
30
-
31
- public async createUser(model: Api_User_Create): Promise<Api_User> {
32
- return await this.post<Api_User_Create, Api_User>('/admin/users', model)
33
- }
34
-
35
- public async deleteUser({
36
- user_id,
37
- archive_reason,
38
- }: Api_User_Delete_Body): Promise<{ data: boolean; status: number }> {
39
- return await this.post(`/users/archive_user`, { user_id, archive_reason })
40
- }
41
-
42
- public async deleteUserPhotos({
43
- user_id,
44
- photos,
45
- }: Api_User_Delete_Photos_Body): Promise<{ data: boolean; status: number }> {
46
- return await this.post(`/users/photos/delete`, { user_id, photos })
47
- }
48
-
49
- public async restoreUser(user_id: string): Promise<{ data: boolean; status: number }> {
50
- return await this.post(`/users/restore_user`, { user_id })
51
- }
52
-
53
- public async getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
54
- return await this.get<ResponseApi<Api_User_Role[]>>('/search/roles', { params })
55
- }
56
-
57
- public async getPositions(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Position[]>> {
58
- return await this.get<ResponseApi<Api_User_Position[]>>('/search/positions', { params })
59
- }
60
-
61
- public async createPosition(body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
62
- return await this.post<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>('/admin/positions', body)
63
- }
64
-
65
- public async editPosition(id: string, body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
66
- return await this.put<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>(`/admin/positions/${id}`, body)
67
- }
68
-
69
- public async deletePosition(id: string): Promise<{ data: boolean; status: number }> {
70
- return await this.delete(`/admin/positions/${id}`)
71
- }
72
-
73
- public async getTeams(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Team_Search[]>> {
74
- return await this.get<ResponseApi<Api_User_Team_Search[]>>('/search/teams', { params })
75
- }
76
-
77
- public async createTeam(body: Partial<Api_User_Team_Search>): Promise<ResponseApi<Api_User_Team>> {
78
- return await this.post<Partial<Api_User_Team_Search>, ResponseApi<Api_User_Team>>('/teams', body)
79
- }
80
-
81
- public async editTeam(id: string, body: Partial<Api_User_Team_Search>): Promise<{ data: boolean; status: number }> {
82
- return await this.patch<Partial<Api_User_Team_Search>, { data: boolean; status: number }>(`/teams/${id}`, body)
83
- }
84
-
85
- public async deleteTeam(id: string): Promise<{ data: boolean; status: number }> {
86
- return await this.delete(`/teams/${id}`)
87
- }
88
-
89
- public async checkUserVectors(id: string): Promise<{ count: number }> {
90
- return await this.get(`/user/get-vectors/${id}`)
91
- }
92
-
93
- public async checkArchiveUserVectors(id: string): Promise<{ count: number }> {
94
- return await this.get(`/users/get_vector_count_by_user?user_id=${id}`)
95
- }
96
-
97
- public async addUserVectors(formData: FormData): Promise<{ response: string }> {
98
- return await this.post(`/user/add-vector`, formData, {
99
- headers: { 'Content-Type': 'multipart/form-data' },
100
- })
101
- }
102
-
103
- public async removeUserVectors(id: string): Promise<unknown> {
104
- return await this.delete(`/user/delete-vectors/${id}`)
105
- }
106
-
107
- public async deleteUserPasses(body: {
108
- personnel_number: number
109
- }): Promise<{ delete_passes: boolean; user: Partial<Api_User> }> {
110
- return await this.post('admin/delete/passes', body)
111
- }
112
-
113
- public async checkUserBeforeArchive(body: { user_id: string }): Promise<any> {
114
- return await this.post('users/check_user_before_archive', body)
115
- }
116
- }
117
-
118
- let api: UserService
119
-
120
- export default function useUserService() {
121
- if (!api) api = new UserService()
122
- return api
123
- }
1
+ import ApiService from '../settings/ApiService'
2
+ import {
3
+ Api_User,
4
+ Api_User_Create,
5
+ Api_User_Delete_Body,
6
+ Api_User_Delete_Photos_Body,
7
+ Api_User_Position,
8
+ Api_User_Role,
9
+ Api_User_Team,
10
+ Api_User_Team_Search,
11
+ Api_User_Warehouse,
12
+ Api_User_Change_Password_Payload,
13
+ } from '../types/Api_User'
14
+
15
+ import { ResponseApi } from '../types/Api_Service'
16
+
17
+ class UserService extends ApiService {
18
+ public async editUser({ id, model }: { id: string; model: any }): Promise<Api_User> {
19
+ return await this.put<Partial<Api_User>, Api_User>(`/admin/users/${id}`, model)
20
+ }
21
+
22
+ public async getUser(id: string): Promise<Api_User> {
23
+ return await this.get<Api_User>(`/admin/users/${id}`)
24
+ }
25
+
26
+ public async changeUserPassword(payload: Api_User_Change_Password_Payload): Promise<Api_User> {
27
+ return await this.patch<Api_User_Change_Password_Payload, Api_User>(`/v2/auth/users/password`, payload)
28
+ }
29
+
30
+ public async getUserWarehouses(params: {
31
+ user_id: string
32
+ page?: number
33
+ }): Promise<ResponseApi<Api_User_Warehouse[]>> {
34
+ return await this.get<ResponseApi<Api_User_Warehouse[]>>(`users/get_warehouse_list_by_user`, { params })
35
+ }
36
+
37
+ public async createUser(model: Api_User_Create): Promise<Api_User> {
38
+ return await this.post<Api_User_Create, Api_User>('/admin/users', model)
39
+ }
40
+
41
+ public async deleteUser({
42
+ user_id,
43
+ archive_reason,
44
+ }: Api_User_Delete_Body): Promise<{ data: boolean; status: number }> {
45
+ return await this.post(`/users/archive_user`, { user_id, archive_reason })
46
+ }
47
+
48
+ public async deleteUserPhotos({
49
+ user_id,
50
+ photos,
51
+ }: Api_User_Delete_Photos_Body): Promise<{ data: boolean; status: number }> {
52
+ return await this.post(`/users/photos/delete`, { user_id, photos })
53
+ }
54
+
55
+ public async restoreUser(user_id: string): Promise<{ data: boolean; status: number }> {
56
+ return await this.post(`/users/restore_user`, { user_id })
57
+ }
58
+
59
+ public async getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
60
+ return await this.get<ResponseApi<Api_User_Role[]>>('/search/roles', { params })
61
+ }
62
+
63
+ public async getPositions(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Position[]>> {
64
+ return await this.get<ResponseApi<Api_User_Position[]>>('/search/positions', { params })
65
+ }
66
+
67
+ public async createPosition(body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
68
+ return await this.post<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>('/admin/positions', body)
69
+ }
70
+
71
+ public async editPosition(id: string, body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
72
+ return await this.put<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>(`/admin/positions/${id}`, body)
73
+ }
74
+
75
+ public async deletePosition(id: string): Promise<{ data: boolean; status: number }> {
76
+ return await this.delete(`/admin/positions/${id}`)
77
+ }
78
+
79
+ public async getTeams(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Team_Search[]>> {
80
+ return await this.get<ResponseApi<Api_User_Team_Search[]>>('/search/teams', { params })
81
+ }
82
+
83
+ public async createTeam(body: Partial<Api_User_Team_Search>): Promise<ResponseApi<Api_User_Team>> {
84
+ return await this.post<Partial<Api_User_Team_Search>, ResponseApi<Api_User_Team>>('/teams', body)
85
+ }
86
+
87
+ public async editTeam(id: string, body: Partial<Api_User_Team_Search>): Promise<{ data: boolean; status: number }> {
88
+ return await this.patch<Partial<Api_User_Team_Search>, { data: boolean; status: number }>(`/teams/${id}`, body)
89
+ }
90
+
91
+ public async deleteTeam(id: string): Promise<{ data: boolean; status: number }> {
92
+ return await this.delete(`/teams/${id}`)
93
+ }
94
+
95
+ public async checkUserVectors(id: string): Promise<{ count: number }> {
96
+ return await this.get(`/user/get-vectors/${id}`)
97
+ }
98
+
99
+ public async checkArchiveUserVectors(id: string): Promise<{ count: number }> {
100
+ return await this.get(`/users/get_vector_count_by_user?user_id=${id}`)
101
+ }
102
+
103
+ public async addUserVectors(formData: FormData): Promise<{ response: string }> {
104
+ return await this.post(`/user/add-vector`, formData, {
105
+ headers: { 'Content-Type': 'multipart/form-data' },
106
+ })
107
+ }
108
+
109
+ public async removeUserVectors(id: string): Promise<unknown> {
110
+ return await this.delete(`/user/delete-vectors/${id}`)
111
+ }
112
+
113
+ public async deleteUserPasses(body: {
114
+ personnel_number: number
115
+ }): Promise<{ delete_passes: boolean; user: Partial<Api_User> }> {
116
+ return await this.post('admin/delete/passes', body)
117
+ }
118
+
119
+ public async checkUserBeforeArchive(body: { user_id: string }): Promise<any> {
120
+ return await this.post('users/check_user_before_archive', body)
121
+ }
122
+ }
123
+
124
+ let api: UserService
125
+
126
+ export default function useUserService() {
127
+ if (!api) api = new UserService()
128
+ return api
129
+ }
@@ -1,118 +1,118 @@
1
- import ApiService from '../settings/ApiService'
2
- import { ResponseApi } from '@/api/types/Api_Service'
3
- import {
4
- Api_Video_Combination,
5
- Api_Video_Source_By_Repair,
6
- Api_Video_Source_Create,
7
- Api_Video_Source_Economics,
8
- Api_Video_Source_Search,
9
- Api_Video_Training_Status,
10
- Api_Work_Zone,
11
- Api_Work_Zone_Search,
12
- } from '@/api/types/Api_Video'
13
-
14
- class VideoService extends ApiService {
15
- public async startVideoAnalytics(): Promise<boolean> {
16
- return await this.post('/statanly/start', null)
17
- }
18
-
19
- public reloadVideoAnalytics(ids: string[]): Promise<any> {
20
- return this.post('/horizon/video-source/reload', { video_source_ids: ids })
21
- }
22
-
23
- public hardReloadStream(): Promise<any> {
24
- return this.post('horizon/video-source/streams/add', null)
25
- }
26
-
27
- public async fetchWorkZones(params?: any): Promise<ResponseApi<Api_Work_Zone_Search[]>> {
28
- return await this.get('/search/work_zones', { params })
29
- }
30
-
31
- public async fetchWorkZone(id: string): Promise<ResponseApi<Api_Work_Zone>> {
32
- return await this.get(`/work_zone/get_work_zone/${id}`)
33
- }
34
-
35
- public async editWorkZone(id: string, body: { title: string }): Promise<{ data: Api_Work_Zone; status: number }> {
36
- return await this.put(`/admin/work-zones/${id}`, body)
37
- }
38
-
39
- public async deleteWorkZone(id: string): Promise<{ data: boolean; status: number }> {
40
- return await this.delete(`/admin/work-zones/${id}`)
41
- }
42
-
43
- public async fetchVideoSources(params?: any): Promise<ResponseApi<Api_Video_Source_Search[]>> {
44
- return await this.get('/search/video_sources/list', { params })
45
- }
46
-
47
- public async fetchVideoSourceEconomics(params?: any): Promise<ResponseApi<Api_Video_Source_Economics>> {
48
- return await this.get('horizon/video-source/economics', { params })
49
- }
50
-
51
- public async createVideoSource(body: Api_Video_Source_Create): Promise<Api_Video_Source_Search> {
52
- return await this.post('horizon/video-source', body)
53
- }
54
-
55
- public async editVideoSource(id: string, body: Partial<Api_Video_Source_Create>): Promise<Api_Video_Source_Search> {
56
- return await this.put(`/horizon/video-source/${id}`, body)
57
- }
58
-
59
- public async deleteVideoSource(id: string): Promise<void> {
60
- await this.delete(`/horizon/video-source/${id}`)
61
- }
62
-
63
- public async fetchListRepairsVideoSource(params?: any): Promise<Api_Video_Source_By_Repair[]> {
64
- return await this.get('work_zone/get_list_video_source_by_repair', { params })
65
- }
66
-
67
- public async sendCombination(body: { cameras_id: string[] }): Promise<any> {
68
- return await this.post('horizon/video-source/training', body)
69
- }
70
-
71
- public async saveCombination(body: any): Promise<any> {
72
- return await this.post('horizon/video-source/bind', body)
73
- }
74
-
75
- public async fetchCombination(params?: Record<string, string>): Promise<Api_Video_Combination> {
76
- return await this.get('horizon/video-source/bind/show', { params })
77
- }
78
-
79
- public async startTraining(body: { cameras_id: string[] }): Promise<any> {
80
- return await this.post('horizon/video-source/training/start', body)
81
- }
82
-
83
- public async stopTraining(body: { cameras_id: string[] }): Promise<any> {
84
- return await this.post('horizon/video-source/training/stop', body)
85
- }
86
-
87
- public async fetchTrainingInfo(params?: Record<string, string>): Promise<any> {
88
- return await this.get('horizon/video-source/training/info', { params })
89
- }
90
-
91
- public async fetchTrainingStatus(params?: Record<string, string>): Promise<Api_Video_Training_Status> {
92
- return await this.get('horizon/video-source/training/status', { params })
93
- }
94
-
95
- public async fetchVisualizationDataLink(params?: Record<string, string>): Promise<string> {
96
- return await this.get('horizon/video-source/link/video/training', { params })
97
- }
98
-
99
- public async updateVisualizationData(params?: Record<string, string>): Promise<number> {
100
- return await this.get('horizon/video-source/download/video/training', { params })
101
- }
102
-
103
- public async deleteFrameFromVideo(id: string): Promise<void> {
104
- await this.delete(`horizon/video-source/delete/fragment/video/training/${id}`)
105
- }
106
-
107
- // Для тестирования ws видеостены
108
- public async sendEvent(params?: Record<string, any>): Promise<number> {
109
- return await this.post('alerts_callback_url', params)
110
- }
111
- }
112
-
113
- let api: VideoService
114
-
115
- export default function useVideoService() {
116
- if (!api) api = new VideoService()
117
- return api
118
- }
1
+ import ApiService from '../settings/ApiService'
2
+ import { ResponseApi } from '@/api/types/Api_Service'
3
+ import {
4
+ Api_Video_Combination,
5
+ Api_Video_Source_By_Repair,
6
+ Api_Video_Source_Create,
7
+ Api_Video_Source_Economics,
8
+ Api_Video_Source_Search,
9
+ Api_Video_Training_Status,
10
+ Api_Work_Zone,
11
+ Api_Work_Zone_Search,
12
+ } from '@/api/types/Api_Video'
13
+
14
+ class VideoService extends ApiService {
15
+ public async startVideoAnalytics(): Promise<boolean> {
16
+ return await this.post('/statanly/start', null)
17
+ }
18
+
19
+ public reloadVideoAnalytics(ids: string[]): Promise<any> {
20
+ return this.post('/horizon/video-source/reload', { video_source_ids: ids })
21
+ }
22
+
23
+ public hardReloadStream(): Promise<any> {
24
+ return this.post('horizon/video-source/streams/add', null)
25
+ }
26
+
27
+ public async fetchWorkZones(params?: any): Promise<ResponseApi<Api_Work_Zone_Search[]>> {
28
+ return await this.get('/search/work_zones', { params })
29
+ }
30
+
31
+ public async fetchWorkZone(id: string): Promise<ResponseApi<Api_Work_Zone>> {
32
+ return await this.get(`/work_zone/get_work_zone/${id}`)
33
+ }
34
+
35
+ public async editWorkZone(id: string, body: { title: string }): Promise<{ data: Api_Work_Zone; status: number }> {
36
+ return await this.put(`/admin/work-zones/${id}`, body)
37
+ }
38
+
39
+ public async deleteWorkZone(id: string): Promise<{ data: boolean; status: number }> {
40
+ return await this.delete(`/admin/work-zones/${id}`)
41
+ }
42
+
43
+ public async fetchVideoSources(params?: any): Promise<ResponseApi<Api_Video_Source_Search[]>> {
44
+ return await this.get('/search/video_sources/list', { params })
45
+ }
46
+
47
+ public async fetchVideoSourceEconomics(params?: any): Promise<ResponseApi<Api_Video_Source_Economics>> {
48
+ return await this.get('horizon/video-source/economics', { params })
49
+ }
50
+
51
+ public async createVideoSource(body: Api_Video_Source_Create): Promise<Api_Video_Source_Search> {
52
+ return await this.post('horizon/video-source', body)
53
+ }
54
+
55
+ public async editVideoSource(id: string, body: Partial<Api_Video_Source_Create>): Promise<Api_Video_Source_Search> {
56
+ return await this.put(`/horizon/video-source/${id}`, body)
57
+ }
58
+
59
+ public async deleteVideoSource(id: string): Promise<void> {
60
+ await this.delete(`/horizon/video-source/${id}`)
61
+ }
62
+
63
+ public async fetchListRepairsVideoSource(params?: any): Promise<Api_Video_Source_By_Repair[]> {
64
+ return await this.get('work_zone/get_list_video_source_by_repair', { params })
65
+ }
66
+
67
+ public async sendCombination(body: { cameras_id: string[] }): Promise<any> {
68
+ return await this.post('horizon/video-source/training', body)
69
+ }
70
+
71
+ public async saveCombination(body: any): Promise<any> {
72
+ return await this.post('horizon/video-source/bind', body)
73
+ }
74
+
75
+ public async fetchCombination(params?: Record<string, string>): Promise<Api_Video_Combination> {
76
+ return await this.get('horizon/video-source/bind/show', { params })
77
+ }
78
+
79
+ public async startTraining(body: { cameras_id: string[] }): Promise<any> {
80
+ return await this.post('horizon/video-source/training/start', body)
81
+ }
82
+
83
+ public async stopTraining(body: { cameras_id: string[] }): Promise<any> {
84
+ return await this.post('horizon/video-source/training/stop', body)
85
+ }
86
+
87
+ public async fetchTrainingInfo(params?: Record<string, string>): Promise<any> {
88
+ return await this.get('horizon/video-source/training/info', { params })
89
+ }
90
+
91
+ public async fetchTrainingStatus(params?: Record<string, string>): Promise<Api_Video_Training_Status> {
92
+ return await this.get('horizon/video-source/training/status', { params })
93
+ }
94
+
95
+ public async fetchVisualizationDataLink(params?: Record<string, string>): Promise<string> {
96
+ return await this.get('horizon/video-source/link/video/training', { params })
97
+ }
98
+
99
+ public async updateVisualizationData(params?: Record<string, string>): Promise<number> {
100
+ return await this.get('horizon/video-source/download/video/training', { params })
101
+ }
102
+
103
+ public async deleteFrameFromVideo(id: string): Promise<void> {
104
+ await this.delete(`horizon/video-source/delete/fragment/video/training/${id}`)
105
+ }
106
+
107
+ // Для тестирования ws видеостены
108
+ public async sendEvent(params?: Record<string, any>): Promise<number> {
109
+ return await this.post('alerts_callback_url', params)
110
+ }
111
+ }
112
+
113
+ let api: VideoService
114
+
115
+ export default function useVideoService() {
116
+ if (!api) api = new VideoService()
117
+ return api
118
+ }