shared-ritm 1.2.104 → 1.2.106

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.
@@ -0,0 +1,18 @@
1
+ import ApiService from '../settings/ApiService';
2
+ import { Api_Brigade, Api_Brigade_Create, Api_Brigade_Search } from '../types/Api_Brigades';
3
+ import { ResponseApi } from '../types/Api_Service';
4
+ declare class BrigadesService extends ApiService {
5
+ fetchBrigades(params: any): Promise<ResponseApi<Api_Brigade_Search[]>>;
6
+ editBrigade({ id, model }: {
7
+ id: string;
8
+ model: Partial<Api_Brigade_Create>;
9
+ }): Promise<Api_Brigade>;
10
+ getBrigade(id: string): Promise<Api_Brigade>;
11
+ createBrigade(model: Api_Brigade_Create): Promise<Api_Brigade>;
12
+ deleteBrigade(id: string): Promise<{
13
+ data: boolean;
14
+ status: number;
15
+ }>;
16
+ }
17
+ export default function useBrigadesService(): BrigadesService;
18
+ export {};
@@ -0,0 +1,31 @@
1
+ import { Api_User, Api_User_Team_Search } from '@/api/types/Api_User';
2
+ import { Api_Tasks_Position_Dto } from '@/api/types/Api_Tasks';
3
+ export type Api_Brigade_Master = {
4
+ id: string;
5
+ full_name: string;
6
+ email: string;
7
+ };
8
+ export type Api_Brigade_Position = {
9
+ id: string;
10
+ user: Pick<Api_User, 'id' | 'first_name' | 'last_name' | 'patronymic' | 'email' | 'full_name'> | null;
11
+ position: Api_Tasks_Position_Dto;
12
+ };
13
+ export type Api_Brigade = {
14
+ id: string;
15
+ name: string;
16
+ task_master: Api_Brigade_Master;
17
+ teams: Api_User_Team_Search[];
18
+ positions: Api_Brigade_Position[];
19
+ };
20
+ export type Api_Brigade_Create = Pick<Api_Brigade, 'name' | 'teams'> & {
21
+ positions?: Api_Brigade_Position[];
22
+ task_master_user_id: string;
23
+ };
24
+ export type Api_Brigade_Search = {
25
+ id: string;
26
+ name: string;
27
+ created_at: string;
28
+ updated_at: string;
29
+ task_master: Api_Brigade_Master;
30
+ teams: Api_User_Team_Search[];
31
+ };
@@ -168,6 +168,7 @@ export type Api_Tasks_Task_Dto = {
168
168
  is_critical_task: boolean;
169
169
  usage_users: boolean;
170
170
  usage_warehouses: boolean;
171
+ is_detach_video_source_work_zone?: number;
171
172
  subtasks: Api_Tasks_Task_Dto[];
172
173
  status: Api_Tasks_Status_Dto;
173
174
  project: Api_Tasks_Project_Dto;
@@ -39,9 +39,10 @@ import useControlsService from './api/services/ControlsService';
39
39
  import useSearchService from './api/services/SearchService';
40
40
  import useCommentsService from './api/services/CommentsService';
41
41
  import useEquipmentService from './api/services/EquipmentService';
42
+ import useBrigadesService from '@/api/services/BrigadesService';
42
43
  import useFaceApiHelper from './utils/faceApiHelper';
43
44
  export { AppButton, AppCheckbox, AppDatepicker, AppDatePicker, AppInput, AppInputNew, AppInputSearch, AppLayout, AppLayoutHeader, AppLayoutPage, AppLoader, AppSelect, AppSheet, AppSheetNew, AppSidebar, AppToggle, AppWrapper, AppConfirmDialog, AppDropdown, AppTablePagination, AppTableSearch, AppTableModal, AppTable, AppTableLayout, AppModalSelect, };
44
- export { ApiService, useAuthService, useGanttService, useMetricsService, useProjectsService, useRepairsService, useTasksService, useFileService, useControlsService, useVideoService, useUserService, useInstrumentsService, useSearchService, useCommentsService, useFaceApiHelper, useEquipmentService, };
45
+ export { ApiService, useAuthService, useGanttService, useMetricsService, useProjectsService, useRepairsService, useTasksService, useFileService, useControlsService, useVideoService, useUserService, useInstrumentsService, useSearchService, useCommentsService, useFaceApiHelper, useEquipmentService, useBrigadesService, };
45
46
  export { useBaseTable } from './common/app-table/controllers/useBaseTable';
46
47
  export { useTableModel } from './common/app-table/controllers/useTableModel';
47
48
  export { useColumnSelector } from './common/app-table/controllers/useColumnSelector';
@@ -61,3 +62,4 @@ export * from './api/types/Api_Comment';
61
62
  export * from './api/types/Api_Files';
62
63
  export * from './api/types/Api_Video';
63
64
  export * from './api/types/Api_Equipment';
65
+ export * from './api/types/Api_Brigades';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.2.104",
3
+ "version": "1.2.106",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -0,0 +1,32 @@
1
+ import ApiService from '../settings/ApiService'
2
+ import { Api_Brigade, Api_Brigade_Create, Api_Brigade_Search } from '../types/Api_Brigades'
3
+ import { ResponseApi } from '../types/Api_Service'
4
+
5
+ class BrigadesService extends ApiService {
6
+ public fetchBrigades(params: any): Promise<ResponseApi<Api_Brigade_Search[]>> {
7
+ return this.get<ResponseApi<Api_Brigade_Search[]>>('/search/brigades', { params })
8
+ }
9
+
10
+ public editBrigade({ id, model }: { id: string; model: Partial<Api_Brigade_Create> }): Promise<Api_Brigade> {
11
+ return this.put<Partial<Api_Brigade_Create>, Api_Brigade>(`/brigades/${id}`, model)
12
+ }
13
+
14
+ public getBrigade(id: string): Promise<Api_Brigade> {
15
+ return this.get<Api_Brigade>(`/brigades/${id}`)
16
+ }
17
+
18
+ public createBrigade(model: Api_Brigade_Create): Promise<Api_Brigade> {
19
+ return this.post<Api_Brigade_Create, Api_Brigade>('/brigades', model)
20
+ }
21
+
22
+ public deleteBrigade(id: string): Promise<{ data: boolean; status: number }> {
23
+ return this.delete(`/brigades/${id}`)
24
+ }
25
+ }
26
+
27
+ let api: BrigadesService
28
+
29
+ export default function useBrigadesService() {
30
+ if (!api) api = new BrigadesService()
31
+ return api
32
+ }
@@ -69,6 +69,9 @@ export default class ApiService {
69
69
  try {
70
70
  const response: AxiosResponse<T> = await this.axiosInstance.get<T>(url, options)
71
71
  if (response?.data === false) return false as unknown as T
72
+
73
+ if (Array.isArray(response?.data)) return response as unknown as T
74
+
72
75
  return response?.data ?? (response as unknown as T)
73
76
  } catch (error) {
74
77
  const axiosError = error as AxiosError
@@ -0,0 +1,36 @@
1
+ import { Api_User, Api_User_Team_Search } from '@/api/types/Api_User'
2
+ import { Api_Tasks_Position_Dto } from '@/api/types/Api_Tasks'
3
+
4
+ export type Api_Brigade_Master = {
5
+ id: string
6
+ full_name: string
7
+ email: string
8
+ }
9
+
10
+ export type Api_Brigade_Position = {
11
+ id: string
12
+ user: Pick<Api_User, 'id' | 'first_name' | 'last_name' | 'patronymic' | 'email' | 'full_name'> | null
13
+ position: Api_Tasks_Position_Dto
14
+ }
15
+
16
+ export type Api_Brigade = {
17
+ id: string
18
+ name: string
19
+ task_master: Api_Brigade_Master
20
+ teams: Api_User_Team_Search[]
21
+ positions: Api_Brigade_Position[]
22
+ }
23
+
24
+ export type Api_Brigade_Create = Pick<Api_Brigade, 'name' | 'teams'> & {
25
+ positions?: Api_Brigade_Position[]
26
+ task_master_user_id: string
27
+ }
28
+
29
+ export type Api_Brigade_Search = {
30
+ id: string
31
+ name: string
32
+ created_at: string
33
+ updated_at: string
34
+ task_master: Api_Brigade_Master
35
+ teams: Api_User_Team_Search[]
36
+ }
@@ -184,6 +184,7 @@ export type Api_Tasks_Task_Dto = {
184
184
  is_critical_task: boolean
185
185
  usage_users: boolean
186
186
  usage_warehouses: boolean
187
+ is_detach_video_source_work_zone?: number
187
188
  subtasks: Api_Tasks_Task_Dto[]
188
189
  status: Api_Tasks_Status_Dto
189
190
  project: Api_Tasks_Project_Dto
package/src/index.ts CHANGED
@@ -40,6 +40,7 @@ import useControlsService from './api/services/ControlsService'
40
40
  import useSearchService from './api/services/SearchService'
41
41
  import useCommentsService from './api/services/CommentsService'
42
42
  import useEquipmentService from './api/services/EquipmentService'
43
+ import useBrigadesService from '@/api/services/BrigadesService'
43
44
 
44
45
  import useFaceApiHelper from './utils/faceApiHelper'
45
46
 
@@ -88,6 +89,7 @@ export {
88
89
  useCommentsService,
89
90
  useFaceApiHelper,
90
91
  useEquipmentService,
92
+ useBrigadesService,
91
93
  }
92
94
 
93
95
  export { useBaseTable } from './common/app-table/controllers/useBaseTable'
@@ -113,4 +115,5 @@ export * from './api/types/Api_Comment'
113
115
  export * from './api/types/Api_Files'
114
116
  export * from './api/types/Api_Video'
115
117
  export * from './api/types/Api_Equipment'
118
+ export * from './api/types/Api_Brigades'
116
119
  // export * from '../types/Api_Metrics'