@tagsamurai/fats-api-services 1.0.3-alpha.4 → 1.0.3-alpha.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-services.es.js +611 -487
- package/api-services.system.js +607 -487
- package/main.d.ts +5 -2
- package/package.json +1 -1
- package/src/dto/assetService.dto.d.ts +4 -16
- package/src/dto/iot.dto.d.ts +95 -0
- package/src/dto/log.dto.d.ts +13 -12
- package/src/dto/oldIOTService.dto.d.ts +17 -0
- package/src/dto/oldTrackingService.dto.d.ts +1 -3
- package/src/dto/oldTransferService.dto.d.ts +1 -3
- package/src/dto/reader.dto.d.ts +23 -0
- package/src/services/damageService.type.d.ts +5 -9
- package/src/services/iot.service.d.ts +30 -0
- package/src/services/log.service.d.ts +5 -5
- package/src/services/oldIOT.service.d.ts +5 -1
- package/src/services/oldReader.service.d.ts +12 -22
- package/src/types/asset.type.d.ts +2 -8
- package/src/types/assetDetail.type.d.ts +1 -2
- package/src/types/assignment.type.d.ts +6 -18
- package/src/types/borrow.type.d.ts +2 -6
- package/src/types/disposal/reported.type.d.ts +1 -3
- package/src/types/disposal/requestDisposal.type.d.ts +1 -3
- package/src/types/fileManager.type.d.ts +1 -3
- package/src/types/iot.type.d.ts +177 -0
- package/src/types/licenseAsset.type.d.ts +1 -3
- package/src/types/licenseConcurrent.type.d.ts +1 -3
- package/src/types/log.type.d.ts +13 -5
- package/src/types/maintenanceRoutine.type.d.ts +7 -21
- package/src/types/myAsset.type.d.ts +3 -9
- package/src/types/oldAssetService.type.d.ts +4 -12
- package/src/types/oldAuditService.type.d.ts +1 -2
- package/src/types/oldBorrowingService.type.d.ts +5 -15
- package/src/types/oldIOTService.type.d.ts +27 -0
- package/src/types/reader.type.d.ts +25 -26
- package/src/types/role.type.d.ts +3 -5
- package/src/types/settingsAssetName.type.d.ts +1 -3
- package/src/types/settingsBrand.type.d.ts +1 -3
- package/src/types/subUser.type.d.ts +1 -3
- package/src/types/transfer.type.d.ts +2 -6
- package/src/types/user.type.d.ts +3 -5
- package/src/utils/getImageURL.util.d.ts +10 -0
- package/src/utils/index.d.ts +1 -2
- package/src/services/oldLog.service.d.ts +0 -31
- package/src/utils/oldGetImageURL.util.d.ts +0 -1
package/api-services.es.js
CHANGED
|
@@ -3,6 +3,77 @@ const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "produ
|
|
|
3
3
|
const getBaseURL = (env = "APP_API") => {
|
|
4
4
|
return __vite_import_meta_env__["VITE_" + env];
|
|
5
5
|
};
|
|
6
|
+
const buildFileURL = (name, width, height) => {
|
|
7
|
+
const BASE_URL = new URL(getBaseURL("APP_API")).origin;
|
|
8
|
+
let url = name.startsWith("http") ? name : `${BASE_URL}/file-storage/api/file/${name.replace(/^\/+/, "")}`;
|
|
9
|
+
if (width || height) {
|
|
10
|
+
const params = new URLSearchParams();
|
|
11
|
+
if (width) {
|
|
12
|
+
params.set("width", width.toString());
|
|
13
|
+
params.set("height", (height == null ? void 0 : height.toString()) || width.toString());
|
|
14
|
+
}
|
|
15
|
+
url += `?${params.toString()}`;
|
|
16
|
+
}
|
|
17
|
+
return url;
|
|
18
|
+
};
|
|
19
|
+
const getAuthToken = () => {
|
|
20
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
21
|
+
return user.jwt ?? user.token ?? "";
|
|
22
|
+
};
|
|
23
|
+
const fetchBlobFile = async (url, token) => {
|
|
24
|
+
const res = await fetch(url, {
|
|
25
|
+
headers: {
|
|
26
|
+
Authorization: `Bearer ${token}`
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
if (!res.ok) {
|
|
30
|
+
throw new Error(`Image fetch failed: ${res.status} ${res.statusText}`);
|
|
31
|
+
}
|
|
32
|
+
const arrayBuffer = await res.arrayBuffer();
|
|
33
|
+
return new Blob([arrayBuffer], {
|
|
34
|
+
type: res.headers.get("Content-Type") || "image/webp"
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const downloadFile = async (fileUrl, fileName, immediateRevoke = true) => {
|
|
38
|
+
const token = getAuthToken();
|
|
39
|
+
const blob = await fetchBlobFile(fileUrl, token);
|
|
40
|
+
let objectUrl = "";
|
|
41
|
+
const isViewable = /^(image|application\/pdf)/i.test(blob.type);
|
|
42
|
+
if (isViewable) {
|
|
43
|
+
const file = new File([blob], fileName, {
|
|
44
|
+
type: blob.type
|
|
45
|
+
});
|
|
46
|
+
objectUrl = URL.createObjectURL(file);
|
|
47
|
+
window.open(objectUrl, "_blank");
|
|
48
|
+
} else {
|
|
49
|
+
objectUrl = URL.createObjectURL(blob);
|
|
50
|
+
const a = document.createElement("a");
|
|
51
|
+
a.href = objectUrl;
|
|
52
|
+
a.download = fileName;
|
|
53
|
+
document.body.appendChild(a);
|
|
54
|
+
a.click();
|
|
55
|
+
a.remove();
|
|
56
|
+
}
|
|
57
|
+
if (immediateRevoke) {
|
|
58
|
+
URL.revokeObjectURL(objectUrl);
|
|
59
|
+
}
|
|
60
|
+
return objectUrl;
|
|
61
|
+
};
|
|
62
|
+
const createBlobURL = async (rawFileUrl) => {
|
|
63
|
+
try {
|
|
64
|
+
const token = getAuthToken();
|
|
65
|
+
const blob = await fetchBlobFile(rawFileUrl, token);
|
|
66
|
+
return URL.createObjectURL(blob);
|
|
67
|
+
} catch (err) {
|
|
68
|
+
return void 0;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const getImageURL = async (name, width, height, returnURLOnly) => {
|
|
72
|
+
if (!name) return;
|
|
73
|
+
const url = buildFileURL(name, width, height);
|
|
74
|
+
if (returnURLOnly) return url;
|
|
75
|
+
return createBlobURL(url);
|
|
76
|
+
};
|
|
6
77
|
const createAxiosInstance = (config = {}, useDifferentHeaders = false) => {
|
|
7
78
|
const { env = "APP_API", prefix = "", headers = {}, ...restConfig } = config;
|
|
8
79
|
const baseURL = `${getBaseURL(env)}${prefix}`;
|
|
@@ -42,98 +113,57 @@ const queryParamsStringfy = (data) => {
|
|
|
42
113
|
});
|
|
43
114
|
return assignedData;
|
|
44
115
|
};
|
|
45
|
-
const buildImageUrl = (name, width, height) => {
|
|
46
|
-
const BASE_URL = new URL(getBaseURL("APP_API")).origin;
|
|
47
|
-
let url = name.startsWith("http") ? name : `${BASE_URL}/file-storage/api/file/${name.replace(/^\/+/, "")}`;
|
|
48
|
-
if (width || height) {
|
|
49
|
-
const params = new URLSearchParams();
|
|
50
|
-
if (width) {
|
|
51
|
-
params.set("width", width.toString());
|
|
52
|
-
params.set("height", (height == null ? void 0 : height.toString()) || width.toString());
|
|
53
|
-
}
|
|
54
|
-
url += `?${params.toString()}`;
|
|
55
|
-
}
|
|
56
|
-
return url;
|
|
57
|
-
};
|
|
58
|
-
const getAuthToken = () => {
|
|
59
|
-
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
60
|
-
return user.jwt ?? user.token ?? "";
|
|
61
|
-
};
|
|
62
|
-
const fetchImageBlob = async (url, token) => {
|
|
63
|
-
const res = await fetch(url, {
|
|
64
|
-
headers: {
|
|
65
|
-
Authorization: `Bearer ${token}`
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
if (!res.ok) {
|
|
69
|
-
throw new Error(`Image fetch failed: ${res.status} ${res.statusText}`);
|
|
70
|
-
}
|
|
71
|
-
const arrayBuffer = await res.arrayBuffer();
|
|
72
|
-
return new Blob([arrayBuffer], {
|
|
73
|
-
type: res.headers.get("Content-Type") || "image/webp"
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
const getImageURL = async (name, width, height, returnURLOnly) => {
|
|
77
|
-
if (!name) return;
|
|
78
|
-
const url = buildImageUrl(name, width, height);
|
|
79
|
-
if (returnURLOnly) return url;
|
|
80
|
-
try {
|
|
81
|
-
const token = getAuthToken();
|
|
82
|
-
const blob = await fetchImageBlob(url, token);
|
|
83
|
-
return URL.createObjectURL(blob);
|
|
84
|
-
} catch (err) {
|
|
85
|
-
return void 0;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
116
|
const getAssetsFile = async (file, type = "excel") => {
|
|
89
117
|
const response = await fetch(
|
|
90
118
|
`${getBaseURL("APP_ASSETS_URL")}/${type}/${file}`
|
|
91
119
|
);
|
|
92
120
|
return response;
|
|
93
121
|
};
|
|
94
|
-
const API$
|
|
122
|
+
const API$I = createAxiosInstance({
|
|
95
123
|
prefix: "/utility/v2"
|
|
96
124
|
});
|
|
97
|
-
const ChangelogServices
|
|
98
|
-
|
|
99
|
-
return API$
|
|
125
|
+
const ChangelogServices = {
|
|
126
|
+
getChangelogList: (params) => {
|
|
127
|
+
return API$I.get("/change-log", { params });
|
|
100
128
|
},
|
|
101
|
-
|
|
102
|
-
return API$
|
|
129
|
+
getChangelogListOptions: (params) => {
|
|
130
|
+
return API$I.get("/change-log/options", { params });
|
|
103
131
|
},
|
|
104
132
|
getSessionLogList: (params) => {
|
|
105
|
-
return API$
|
|
133
|
+
return API$I.get("/session-log", { params });
|
|
106
134
|
},
|
|
107
135
|
getSessionLogListOptions: (params) => {
|
|
108
|
-
return API$
|
|
136
|
+
return API$I.get("/session-log/options", {
|
|
137
|
+
params
|
|
138
|
+
});
|
|
109
139
|
},
|
|
110
140
|
getTransactionLog: (params) => {
|
|
111
|
-
return API$
|
|
141
|
+
return API$I.get("/transaction-log", { params });
|
|
112
142
|
},
|
|
113
143
|
/**
|
|
114
144
|
* Retrieves the transaction log options.
|
|
115
145
|
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
116
146
|
*/
|
|
117
147
|
getTransactionLogOption: (params) => {
|
|
118
|
-
return API$
|
|
148
|
+
return API$I.get("/transaction-log/options", { params });
|
|
119
149
|
},
|
|
120
150
|
getUserDetailSystemLogList: (params) => {
|
|
121
|
-
return API$
|
|
151
|
+
return API$I.get("/change-log", { params });
|
|
122
152
|
},
|
|
123
153
|
getUserDetailSystemLogOption: (params) => {
|
|
124
|
-
return API$
|
|
154
|
+
return API$I.get("/change-log/options", { params });
|
|
125
155
|
},
|
|
126
156
|
getUserDetailUserLogBorrowingList: (userId, params) => {
|
|
127
|
-
return API$
|
|
157
|
+
return API$I.get(`/borrowing-log/${userId}`, { params });
|
|
128
158
|
},
|
|
129
159
|
getUserDetailUserLogAssignmentList: (userId, params) => {
|
|
130
|
-
return API$
|
|
160
|
+
return API$I.get(`/assignment-log/${userId}`, { params });
|
|
131
161
|
},
|
|
132
162
|
getUserDetailUserLogBorrowingOption: (userId, params) => {
|
|
133
|
-
return API$
|
|
163
|
+
return API$I.get(`/borrowing-log/${userId}/options`, { params });
|
|
134
164
|
},
|
|
135
165
|
getUserDetailUserLogAssignmentOption: (userId, params) => {
|
|
136
|
-
return API$
|
|
166
|
+
return API$I.get(`/assignment-log/${userId}/options`, { params });
|
|
137
167
|
}
|
|
138
168
|
};
|
|
139
169
|
const AssetsAPIs = createAxiosInstance({
|
|
@@ -216,38 +246,38 @@ const AssetServices = {
|
|
|
216
246
|
return AssetsAPIs.delete("/attachment/bulk", { params });
|
|
217
247
|
}
|
|
218
248
|
};
|
|
219
|
-
const API$
|
|
249
|
+
const API$H = createAxiosInstance({
|
|
220
250
|
prefix: "/missing-tracking/v2"
|
|
221
251
|
});
|
|
222
252
|
const MissingServices = {
|
|
223
253
|
putFoundAsset: (body) => {
|
|
224
|
-
return API$
|
|
254
|
+
return API$H.put("/found", body);
|
|
225
255
|
},
|
|
226
256
|
putReportMissing: (id, body) => {
|
|
227
|
-
return API$
|
|
257
|
+
return API$H.put(`/${id}/report-missing`, body);
|
|
228
258
|
},
|
|
229
259
|
getData: (params) => {
|
|
230
|
-
return API$
|
|
260
|
+
return API$H.get("/", { params });
|
|
231
261
|
},
|
|
232
262
|
getDataOptions: (params) => {
|
|
233
|
-
return API$
|
|
263
|
+
return API$H.get("/options", { params });
|
|
234
264
|
},
|
|
235
265
|
getDetail: (id) => {
|
|
236
|
-
return API$
|
|
266
|
+
return API$H.get(`/${id}`);
|
|
237
267
|
}
|
|
238
268
|
};
|
|
239
|
-
const API$
|
|
269
|
+
const API$G = createAxiosInstance({
|
|
240
270
|
prefix: "/utility/v2/notification"
|
|
241
271
|
});
|
|
242
272
|
const NotificationServices = {
|
|
243
273
|
getNotifications: (params) => {
|
|
244
|
-
return API$
|
|
274
|
+
return API$G.get("/", { params });
|
|
245
275
|
},
|
|
246
276
|
readNotification: (id) => {
|
|
247
|
-
return API$
|
|
277
|
+
return API$G.put(`/${id}`);
|
|
248
278
|
}
|
|
249
279
|
};
|
|
250
|
-
const API$
|
|
280
|
+
const API$F = createAxiosInstance({
|
|
251
281
|
prefix: "/settings-user-role/v2"
|
|
252
282
|
});
|
|
253
283
|
const UserServices = {
|
|
@@ -256,19 +286,19 @@ const UserServices = {
|
|
|
256
286
|
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
257
287
|
*/
|
|
258
288
|
getUserDropdown: (params) => {
|
|
259
|
-
return API$
|
|
289
|
+
return API$F.get("/users/dropdown", { params });
|
|
260
290
|
},
|
|
261
291
|
getUserOptions: (params) => {
|
|
262
|
-
return API$
|
|
292
|
+
return API$F.get("/users/options", { params });
|
|
263
293
|
},
|
|
264
294
|
getUserList: (params) => {
|
|
265
|
-
return API$
|
|
295
|
+
return API$F.get("/users", { params });
|
|
266
296
|
},
|
|
267
297
|
getUserDetail: (id) => {
|
|
268
|
-
return API$
|
|
298
|
+
return API$F.get(`/users/${id}`);
|
|
269
299
|
},
|
|
270
300
|
putSetActiveBulk: (data) => {
|
|
271
|
-
return API$
|
|
301
|
+
return API$F.put("/users/set-active-bulk", data);
|
|
272
302
|
},
|
|
273
303
|
// User Detail
|
|
274
304
|
/**
|
|
@@ -279,96 +309,96 @@ const UserServices = {
|
|
|
279
309
|
*/
|
|
280
310
|
getUserDetailSystemRoles: (id, params, permissionType) => {
|
|
281
311
|
const additionalPath = permissionType ? `/${permissionType}/groups` : "";
|
|
282
|
-
return API$
|
|
312
|
+
return API$F.get(`/users/${id}/system-roles${additionalPath}`, {
|
|
283
313
|
params
|
|
284
314
|
});
|
|
285
315
|
},
|
|
286
316
|
getUserDetailTransactionRoleList: (id, params) => {
|
|
287
|
-
return API$
|
|
317
|
+
return API$F.get(`/users/${id}/transaction-roles`, { params });
|
|
288
318
|
},
|
|
289
319
|
postUserDetailAddTransactionRole: (userId, data) => {
|
|
290
|
-
return API$
|
|
320
|
+
return API$F.post(`/users/${userId}/add-transaction-role`, data);
|
|
291
321
|
},
|
|
292
322
|
deleteUserDetailTransactionRole: (userId, body) => {
|
|
293
|
-
return API$
|
|
323
|
+
return API$F.put(`/users/${userId}/delete-transaction-role`, body);
|
|
294
324
|
},
|
|
295
325
|
putUserDetailEditTransactionRole: (userId, data) => {
|
|
296
|
-
return API$
|
|
326
|
+
return API$F.put(`/users/${userId}/edit-transaction-role`, data);
|
|
297
327
|
},
|
|
298
328
|
putAssignGroup: (data, permissionType, id) => {
|
|
299
|
-
return API$
|
|
329
|
+
return API$F.put(`/users/${id}/system-roles/${permissionType}/groups`, data);
|
|
300
330
|
},
|
|
301
331
|
putRoleSetActive: (body, userId) => {
|
|
302
|
-
return API$
|
|
332
|
+
return API$F.put(`/users/${userId}/system-roles/set-active-bulk`, body);
|
|
303
333
|
},
|
|
304
334
|
getUserDetailTransactionAdminLogList: (userId, params) => {
|
|
305
|
-
return API$
|
|
335
|
+
return API$F.get(`/users/${userId}/transaction-log`, { params });
|
|
306
336
|
},
|
|
307
337
|
getUserDetailTransactionAdminLogOption: (userId, params) => {
|
|
308
|
-
return API$
|
|
338
|
+
return API$F.get(`/users/${userId}/transaction-log/options`, { params });
|
|
309
339
|
},
|
|
310
340
|
getUserDetailUserAssetBorrowedList: (userId, params) => {
|
|
311
|
-
return API$
|
|
341
|
+
return API$F.get(`/users/${userId}/borrowed-asset`, { params });
|
|
312
342
|
},
|
|
313
343
|
getUserDetailUserAssetAssignedList: (userId, params) => {
|
|
314
|
-
return API$
|
|
344
|
+
return API$F.get(`/users/${userId}/assigned-asset`, { params });
|
|
315
345
|
},
|
|
316
346
|
getUserDetailUserAssetBorrowedOption: (userId, params) => {
|
|
317
|
-
return API$
|
|
347
|
+
return API$F.get(`/users/${userId}/borrowed-asset/options`, { params });
|
|
318
348
|
},
|
|
319
349
|
getUserDetailUserAssetAssignedOption: (userId, params) => {
|
|
320
|
-
return API$
|
|
350
|
+
return API$F.get(`/users/${userId}/assigned-asset/options`, { params });
|
|
321
351
|
}
|
|
322
352
|
};
|
|
323
|
-
const API$
|
|
353
|
+
const API$E = createAxiosInstance({
|
|
324
354
|
prefix: "/settings-user-role/v2/users"
|
|
325
355
|
});
|
|
326
356
|
const SubUserServices = {
|
|
327
357
|
// Sub User
|
|
328
358
|
getSubUserList: (userId, params) => {
|
|
329
|
-
return API$
|
|
359
|
+
return API$E.get(`/${userId}/sub-users`, { params });
|
|
330
360
|
},
|
|
331
361
|
getSubUserOptions: (userId, params) => {
|
|
332
|
-
return API$
|
|
362
|
+
return API$E.get(`/${userId}/sub-users/option`, { params });
|
|
333
363
|
},
|
|
334
364
|
postCreateSubUser: (userId, data) => {
|
|
335
365
|
const headers = { "Content-Type": "multipart/form-data" };
|
|
336
|
-
return API$
|
|
366
|
+
return API$E.post(`/${userId}/sub-users`, data, { headers });
|
|
337
367
|
},
|
|
338
368
|
putSubUserSetActiveBulk: (userId, data) => {
|
|
339
|
-
return API$
|
|
369
|
+
return API$E.put(`/${userId}/sub-users/set-active-bulk`, data);
|
|
340
370
|
},
|
|
341
371
|
deleteSubUser: (userId, subUserIds) => {
|
|
342
|
-
return API$
|
|
372
|
+
return API$E.put(`/${userId}/sub-users/bulk`, { subUserIds });
|
|
343
373
|
},
|
|
344
374
|
putEditSubUser: (userId, subUserId, data) => {
|
|
345
375
|
const headers = { "Content-Type": "multipart/form-data" };
|
|
346
|
-
return API$
|
|
376
|
+
return API$E.put(`/${userId}/sub-users/${subUserId}`, data, {
|
|
347
377
|
headers
|
|
348
378
|
});
|
|
349
379
|
},
|
|
350
380
|
getBorrowedAsset: (userId, subUserId, params) => {
|
|
351
|
-
return API$
|
|
381
|
+
return API$E.get(`/${userId}/sub-users/${subUserId}/borrowed-asset`, {
|
|
352
382
|
params
|
|
353
383
|
});
|
|
354
384
|
},
|
|
355
385
|
getBorrowedAssetOptions: (userId, subUserId, params) => {
|
|
356
|
-
return API$
|
|
386
|
+
return API$E.get(`/${userId}/sub-users/${subUserId}/borrowed-asset/options`, {
|
|
357
387
|
params
|
|
358
388
|
});
|
|
359
389
|
},
|
|
360
390
|
getAssignedAsset: (userId, subUserId, params) => {
|
|
361
|
-
return API$
|
|
391
|
+
return API$E.get(`/${userId}/sub-users/${subUserId}/assigned-asset`, {
|
|
362
392
|
params
|
|
363
393
|
});
|
|
364
394
|
},
|
|
365
395
|
getAssignedAssetOptions: (userId, subUserId, params) => {
|
|
366
|
-
return API$
|
|
396
|
+
return API$E.get(`/${userId}/sub-users/${subUserId}/assigned-asset/options`, {
|
|
367
397
|
params
|
|
368
398
|
});
|
|
369
399
|
}
|
|
370
400
|
};
|
|
371
|
-
const API$
|
|
401
|
+
const API$D = createAxiosInstance({
|
|
372
402
|
prefix: "/utility/v2"
|
|
373
403
|
});
|
|
374
404
|
const FileManagerServices = {
|
|
@@ -378,7 +408,7 @@ const FileManagerServices = {
|
|
|
378
408
|
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
379
409
|
*/
|
|
380
410
|
getStorageInformation: () => {
|
|
381
|
-
return API$
|
|
411
|
+
return API$D.get("/files/storage");
|
|
382
412
|
},
|
|
383
413
|
/**
|
|
384
414
|
* Get file manager data.
|
|
@@ -388,7 +418,7 @@ const FileManagerServices = {
|
|
|
388
418
|
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
389
419
|
*/
|
|
390
420
|
getFileManager: (type, params) => {
|
|
391
|
-
return API$
|
|
421
|
+
return API$D.get(`/${type}`, { params });
|
|
392
422
|
},
|
|
393
423
|
/**
|
|
394
424
|
* Get file manager options.
|
|
@@ -398,7 +428,7 @@ const FileManagerServices = {
|
|
|
398
428
|
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
399
429
|
*/
|
|
400
430
|
getFileManagerOption: (type, params) => {
|
|
401
|
-
return API$
|
|
431
|
+
return API$D.get(`/${type}/options`, { params });
|
|
402
432
|
},
|
|
403
433
|
/**
|
|
404
434
|
* Recover files.
|
|
@@ -408,7 +438,7 @@ const FileManagerServices = {
|
|
|
408
438
|
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
409
439
|
*/
|
|
410
440
|
recoverFiles: (type, body) => {
|
|
411
|
-
return API$
|
|
441
|
+
return API$D.put(`/${type}/recover`, body);
|
|
412
442
|
},
|
|
413
443
|
/**
|
|
414
444
|
* Delete files.
|
|
@@ -418,7 +448,7 @@ const FileManagerServices = {
|
|
|
418
448
|
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
419
449
|
*/
|
|
420
450
|
deleteFiles: (type, params) => {
|
|
421
|
-
return API$
|
|
451
|
+
return API$D.delete(`/${type}`, { params });
|
|
422
452
|
},
|
|
423
453
|
/**
|
|
424
454
|
* Delete files permanently.
|
|
@@ -428,10 +458,10 @@ const FileManagerServices = {
|
|
|
428
458
|
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
429
459
|
*/
|
|
430
460
|
deletePermanently: (type, params) => {
|
|
431
|
-
return API$
|
|
461
|
+
return API$D.delete(`/${type}/delete-permanent`, { params });
|
|
432
462
|
}
|
|
433
463
|
};
|
|
434
|
-
const API$
|
|
464
|
+
const API$C = createAxiosInstance({
|
|
435
465
|
prefix: "/settings-user-role/v2"
|
|
436
466
|
});
|
|
437
467
|
const RoleServices = {
|
|
@@ -442,10 +472,10 @@ const RoleServices = {
|
|
|
442
472
|
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
443
473
|
*/
|
|
444
474
|
getTransactionRole: (groupId, transactionName) => {
|
|
445
|
-
return API$
|
|
475
|
+
return API$C.get(`/transaction-roles/${groupId}/${transactionName}`);
|
|
446
476
|
},
|
|
447
477
|
getTransactionRoleTypes: (groupKeys, transactionName) => {
|
|
448
|
-
return API$
|
|
478
|
+
return API$C.get(`/transaction-roles/${transactionName}/types`, {
|
|
449
479
|
params: { groupKeys }
|
|
450
480
|
});
|
|
451
481
|
},
|
|
@@ -457,7 +487,7 @@ const RoleServices = {
|
|
|
457
487
|
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
458
488
|
*/
|
|
459
489
|
putUpdateUsers: (groupId, transactionName, body) => {
|
|
460
|
-
return API$
|
|
490
|
+
return API$C.put(
|
|
461
491
|
`/transaction-roles/${groupId}/${transactionName}/update-user`,
|
|
462
492
|
body
|
|
463
493
|
);
|
|
@@ -470,7 +500,7 @@ const RoleServices = {
|
|
|
470
500
|
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
471
501
|
*/
|
|
472
502
|
putUpdateLevel: (groupId, transactionName, body) => {
|
|
473
|
-
return API$
|
|
503
|
+
return API$C.put(
|
|
474
504
|
`/transaction-roles/${groupId}/${transactionName}/update-approval-level`,
|
|
475
505
|
body
|
|
476
506
|
);
|
|
@@ -483,371 +513,371 @@ const RoleServices = {
|
|
|
483
513
|
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
484
514
|
*/
|
|
485
515
|
putUpdateGroupManage: (groupId, transactionName, body) => {
|
|
486
|
-
return API$
|
|
516
|
+
return API$C.put(
|
|
487
517
|
`/transaction-roles/${groupId}/${transactionName}/update-manage-by-parent`,
|
|
488
518
|
body
|
|
489
519
|
);
|
|
490
520
|
},
|
|
491
521
|
getUserAssignedSystemRole: (userId) => {
|
|
492
|
-
return API$
|
|
522
|
+
return API$C.get(`/system-roles/user/${userId}`);
|
|
493
523
|
},
|
|
494
524
|
getAssignedUserAmounts: () => {
|
|
495
|
-
return API$
|
|
525
|
+
return API$C.get("/system-roles/amounts");
|
|
496
526
|
},
|
|
497
527
|
getPermissionUser: (permissionType, params) => {
|
|
498
528
|
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
499
529
|
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
500
|
-
return API$
|
|
530
|
+
return API$C.get(`/system-roles/total-control-read-only/${type}`, {
|
|
501
531
|
params
|
|
502
532
|
});
|
|
503
533
|
}
|
|
504
|
-
return API$
|
|
534
|
+
return API$C.get(`/system-roles/permission/${permissionType}`, { params });
|
|
505
535
|
},
|
|
506
536
|
getPermissionUserOptions: (permissionType, params) => {
|
|
507
537
|
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
508
538
|
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
509
|
-
return API$
|
|
539
|
+
return API$C.get(`/system-roles/total-control-read-only/${type}/options`, {
|
|
510
540
|
params
|
|
511
541
|
});
|
|
512
542
|
}
|
|
513
|
-
return API$
|
|
543
|
+
return API$C.get(`/system-roles/permission/${permissionType}/options`, {
|
|
514
544
|
params
|
|
515
545
|
});
|
|
516
546
|
},
|
|
517
547
|
getUserGroups: (params, permissionType) => {
|
|
518
|
-
return API$
|
|
548
|
+
return API$C.get(`/system-roles/permission/${permissionType}/groups`, {
|
|
519
549
|
params
|
|
520
550
|
});
|
|
521
551
|
},
|
|
522
552
|
postAssignUser: (body, permissionType) => {
|
|
523
553
|
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
524
554
|
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
525
|
-
return API$
|
|
555
|
+
return API$C.post(`/system-roles/total-control-read-only/${type}`, body);
|
|
526
556
|
}
|
|
527
|
-
return API$
|
|
557
|
+
return API$C.post(`/system-roles/permission/${permissionType}`, body);
|
|
528
558
|
},
|
|
529
559
|
putEditUser: (body, roleId) => {
|
|
530
|
-
return API$
|
|
560
|
+
return API$C.put(`/system-roles/${roleId}`, body);
|
|
531
561
|
},
|
|
532
562
|
deleteRemoveUser: (body, permissionType) => {
|
|
533
563
|
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
534
564
|
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
535
|
-
return API$
|
|
565
|
+
return API$C.put(`/system-roles/total-control-read-only/${type}`, body);
|
|
536
566
|
}
|
|
537
|
-
return API$
|
|
567
|
+
return API$C.put("/system-roles", body);
|
|
538
568
|
}
|
|
539
569
|
};
|
|
540
|
-
const API$
|
|
570
|
+
const API$B = createAxiosInstance({
|
|
541
571
|
prefix: "/settings-attribute/v2/open-api"
|
|
542
572
|
});
|
|
543
573
|
const OpenAPIServices = {
|
|
544
574
|
getOpenAPIDocs: (params) => {
|
|
545
|
-
return API$
|
|
575
|
+
return API$B.get(`/${params.doc}`);
|
|
546
576
|
},
|
|
547
577
|
putGenerateToken: () => {
|
|
548
|
-
return API$
|
|
578
|
+
return API$B.put("/generate");
|
|
549
579
|
},
|
|
550
580
|
// This is if the dummy was not dummy
|
|
551
581
|
getToken: () => {
|
|
552
|
-
return API$
|
|
582
|
+
return API$B.get("");
|
|
553
583
|
},
|
|
554
584
|
putRequestOpenAPI: () => {
|
|
555
|
-
return API$
|
|
585
|
+
return API$B.put("/request");
|
|
556
586
|
},
|
|
557
587
|
putCancelRequestOpenAPI: () => {
|
|
558
|
-
return API$
|
|
588
|
+
return API$B.put("/cancel-request");
|
|
559
589
|
}
|
|
560
590
|
};
|
|
561
|
-
const API$
|
|
591
|
+
const API$A = createAxiosInstance({
|
|
562
592
|
prefix: "/import/v2"
|
|
563
593
|
});
|
|
564
594
|
const ImportServices = {
|
|
565
595
|
getImport: (importUrl, params) => {
|
|
566
|
-
return API$
|
|
596
|
+
return API$A.get(`/${importUrl}`, { params });
|
|
567
597
|
},
|
|
568
598
|
postImportTemporary: (importUrl, data) => {
|
|
569
599
|
const headers = { "Content-Type": "multipart/form-data" };
|
|
570
|
-
return API$
|
|
600
|
+
return API$A.post(`/${importUrl}/temporary`, data, { headers });
|
|
571
601
|
},
|
|
572
602
|
deleteImportTemporary: (importUrl, params) => {
|
|
573
|
-
return API$
|
|
603
|
+
return API$A.delete(`/${importUrl}/temporary`, { params });
|
|
574
604
|
},
|
|
575
605
|
postDuplicateImport: (importUrl, body) => {
|
|
576
|
-
return API$
|
|
606
|
+
return API$A.post(`/${importUrl}/duplicate`, body);
|
|
577
607
|
},
|
|
578
608
|
putEditImport: (importUrl, body) => {
|
|
579
|
-
return API$
|
|
609
|
+
return API$A.put(`/${importUrl}`, body);
|
|
580
610
|
},
|
|
581
611
|
postImport: (importUrl, controller, body) => {
|
|
582
|
-
return API$
|
|
612
|
+
return API$A.post(importUrl, body, { signal: controller.signal });
|
|
583
613
|
},
|
|
584
614
|
putImportCancelProgress: (importUrl) => {
|
|
585
|
-
return API$
|
|
615
|
+
return API$A.put(`/${importUrl}/cancel-progress`);
|
|
586
616
|
}
|
|
587
617
|
};
|
|
588
|
-
const API$
|
|
618
|
+
const API$z = createAxiosInstance({
|
|
589
619
|
env: "APP_TAGSAMURAI_API",
|
|
590
620
|
prefix: "/assignment/v2"
|
|
591
621
|
});
|
|
592
622
|
const AssignmentServices$1 = {
|
|
593
623
|
getPreListData: (params) => {
|
|
594
|
-
return API$
|
|
624
|
+
return API$z.get("/prelist", { params });
|
|
595
625
|
},
|
|
596
626
|
getPreListOptions: (params) => {
|
|
597
|
-
return API$
|
|
627
|
+
return API$z.get("/prelist/options", { params });
|
|
598
628
|
},
|
|
599
629
|
getRequestData: (params) => {
|
|
600
|
-
return API$
|
|
630
|
+
return API$z.get("/prelist/request", { params });
|
|
601
631
|
},
|
|
602
632
|
postAddPrelistData: (body) => {
|
|
603
|
-
return API$
|
|
633
|
+
return API$z.post("/prelist", body);
|
|
604
634
|
},
|
|
605
635
|
getDetailRequestData: (id, params) => {
|
|
606
|
-
return API$
|
|
636
|
+
return API$z.get(`/transaction/${id}/request`, { params });
|
|
607
637
|
},
|
|
608
638
|
getDetailRequestOption: (params, id) => {
|
|
609
|
-
return API$
|
|
639
|
+
return API$z.get(`/transaction/${id}/request/options`, { params });
|
|
610
640
|
},
|
|
611
641
|
getTransactionData: (params) => {
|
|
612
|
-
return API$
|
|
642
|
+
return API$z.get("/transaction", { params });
|
|
613
643
|
},
|
|
614
644
|
getTransactionOptions: (params) => {
|
|
615
|
-
return API$
|
|
645
|
+
return API$z.get("/transaction/options", { params });
|
|
616
646
|
},
|
|
617
647
|
getDetailTransactionData: (id) => {
|
|
618
|
-
return API$
|
|
648
|
+
return API$z.get(`/transaction/${id}`);
|
|
619
649
|
},
|
|
620
650
|
getTransactionApproval: (params) => {
|
|
621
|
-
return API$
|
|
651
|
+
return API$z.get("/approval", { params });
|
|
622
652
|
},
|
|
623
653
|
getApprovalData: (transactionId, params) => {
|
|
624
|
-
return API$
|
|
654
|
+
return API$z.get(`/approval/transaction/${transactionId}`, { params });
|
|
625
655
|
},
|
|
626
656
|
getTransactionApprovalOptions: (params) => {
|
|
627
|
-
return API$
|
|
657
|
+
return API$z.get("/approval/options", { params });
|
|
628
658
|
},
|
|
629
659
|
getApprovalOptions: (transactionId, params) => {
|
|
630
|
-
return API$
|
|
660
|
+
return API$z.get(`/approval/transaction/${transactionId}/options`, {
|
|
631
661
|
params
|
|
632
662
|
});
|
|
633
663
|
},
|
|
634
664
|
getTransactionApprovers: (id) => {
|
|
635
|
-
return API$
|
|
665
|
+
return API$z.get(`/approval/transaction/${id}/transaction`);
|
|
636
666
|
},
|
|
637
667
|
putApproveApproval: (body) => {
|
|
638
|
-
return API$
|
|
668
|
+
return API$z.put("/approval/approve", body);
|
|
639
669
|
},
|
|
640
670
|
getDetailTransactionLog: (id) => {
|
|
641
|
-
return API$
|
|
671
|
+
return API$z.get(`/transaction/request/${id}/transaction-log`);
|
|
642
672
|
},
|
|
643
673
|
getVerifyAsset: (params, id) => {
|
|
644
|
-
return API$
|
|
674
|
+
return API$z.get(`/transaction/${id}/request/scan`, { params });
|
|
645
675
|
},
|
|
646
676
|
putEditAssignedUser: (id, body) => {
|
|
647
|
-
return API$
|
|
677
|
+
return API$z.put(`/transaction/${id}/user`, body);
|
|
648
678
|
},
|
|
649
679
|
putEditEmailConfirmation: (id, body) => {
|
|
650
|
-
return API$
|
|
680
|
+
return API$z.put(`/transaction/${id}/update-email-or-assigned-user`, body);
|
|
651
681
|
},
|
|
652
682
|
postSendConfirmationEmail: (id) => {
|
|
653
|
-
return API$
|
|
683
|
+
return API$z.post(`/transaction/${id}/send-confirmation-email`);
|
|
654
684
|
},
|
|
655
685
|
postTransaction: (body) => {
|
|
656
|
-
return API$
|
|
686
|
+
return API$z.post("/transaction", body);
|
|
657
687
|
},
|
|
658
688
|
putTransactionRequest: (id, body) => {
|
|
659
|
-
return API$
|
|
689
|
+
return API$z.put(`/transaction/${id}/request`, body);
|
|
660
690
|
},
|
|
661
691
|
putCancelTransaction: (body) => {
|
|
662
|
-
return API$
|
|
692
|
+
return API$z.put("/transaction/cancel", body);
|
|
663
693
|
},
|
|
664
694
|
putCancelAssignmentRequest: (body) => {
|
|
665
|
-
return API$
|
|
695
|
+
return API$z.put("/transaction/request/cancel", body);
|
|
666
696
|
},
|
|
667
697
|
putVerifyRequest: (body, id) => {
|
|
668
|
-
return API$
|
|
698
|
+
return API$z.put(`/transaction/${id}/verify-requests`, body);
|
|
669
699
|
},
|
|
670
700
|
putVerifyToken: (body) => {
|
|
671
|
-
return API$
|
|
701
|
+
return API$z.put("/transaction/verify-token", body);
|
|
672
702
|
},
|
|
673
703
|
putHandoverConfirm: (body) => {
|
|
674
|
-
return API$
|
|
704
|
+
return API$z.put("/transaction/handover-confirmation", body);
|
|
675
705
|
},
|
|
676
706
|
putAssignHandover: (transaction) => {
|
|
677
|
-
return API$
|
|
707
|
+
return API$z.put(`/transaction/${transaction}/handover`);
|
|
678
708
|
},
|
|
679
709
|
deletePrelistData: (params) => {
|
|
680
|
-
return API$
|
|
710
|
+
return API$z.delete("/prelist", { params });
|
|
681
711
|
},
|
|
682
712
|
deleteRequestPrelistData: (body) => {
|
|
683
|
-
return API$
|
|
713
|
+
return API$z.delete("/prelist/request", { data: body });
|
|
684
714
|
},
|
|
685
715
|
getAssignedByAsset: (params) => {
|
|
686
|
-
return API$
|
|
716
|
+
return API$z.get("/transaction/request/assigned/by-asset", { params });
|
|
687
717
|
},
|
|
688
718
|
getAssignedByAssetOptions: (params) => {
|
|
689
|
-
return API$
|
|
719
|
+
return API$z.get("/transaction/request/assigned/by-asset/options", {
|
|
690
720
|
params
|
|
691
721
|
});
|
|
692
722
|
},
|
|
693
723
|
getAssignedByUser: (params) => {
|
|
694
|
-
return API$
|
|
724
|
+
return API$z.get("/transaction/request/assigned/by-user", { params });
|
|
695
725
|
},
|
|
696
726
|
getAssignedByUserOptions: (params) => {
|
|
697
|
-
return API$
|
|
727
|
+
return API$z.get("/transaction/request/assigned/by-user/options", { params });
|
|
698
728
|
},
|
|
699
729
|
postUnassignPrelistAsset: (body) => {
|
|
700
|
-
return API$
|
|
730
|
+
return API$z.post("/prelist", body);
|
|
701
731
|
},
|
|
702
732
|
postUnassignPrelistUser: (body) => {
|
|
703
|
-
return API$
|
|
733
|
+
return API$z.post("/prelist/unassign/by-user", body);
|
|
704
734
|
},
|
|
705
735
|
putUnassignRequest: (body) => {
|
|
706
|
-
return API$
|
|
736
|
+
return API$z.put("/transaction/request/unassign", body);
|
|
707
737
|
},
|
|
708
738
|
putReportDone: (id, body) => {
|
|
709
|
-
return API$
|
|
739
|
+
return API$z.put(`/transaction/${id}/confirm-report-done`, body);
|
|
710
740
|
},
|
|
711
741
|
getHistory: (type, params) => {
|
|
712
742
|
const urlType = type.split(" ").join("-").toLowerCase();
|
|
713
|
-
return API$
|
|
743
|
+
return API$z.get(`/transaction/history/${urlType}`, { params });
|
|
714
744
|
},
|
|
715
745
|
getHistoryOptions: (params) => {
|
|
716
|
-
return API$
|
|
746
|
+
return API$z.get("/transaction/history/options", { params });
|
|
717
747
|
},
|
|
718
748
|
getHistoryByTransactionOptions: (params) => {
|
|
719
|
-
return API$
|
|
749
|
+
return API$z.get("/transaction/history/by-transaction/options", { params });
|
|
720
750
|
},
|
|
721
751
|
putCancelReport: (body) => {
|
|
722
|
-
return API$
|
|
752
|
+
return API$z.put("/transaction/request/cancel-report", body);
|
|
723
753
|
},
|
|
724
754
|
getTaskAssignment: async (params) => {
|
|
725
|
-
return API$
|
|
755
|
+
return API$z.get("/transaction/my-asset/task", { params });
|
|
726
756
|
},
|
|
727
757
|
getTaskAssignmentOptions: async (params) => {
|
|
728
|
-
return API$
|
|
758
|
+
return API$z.get("/transaction/my-asset/task/options", { params });
|
|
729
759
|
},
|
|
730
760
|
getAssignedAsset: async (params) => {
|
|
731
|
-
return API$
|
|
761
|
+
return API$z.get("/transaction/my-asset/assigned-asset", { params });
|
|
732
762
|
},
|
|
733
763
|
getAssignedAssetOptions: async (params) => {
|
|
734
|
-
return API$
|
|
764
|
+
return API$z.get("/transaction/my-asset/assigned-asset/options", { params });
|
|
735
765
|
},
|
|
736
766
|
putCancelAssignment: async (body) => {
|
|
737
|
-
return API$
|
|
767
|
+
return API$z.put("/transaction/cancel", { id: body.id });
|
|
738
768
|
},
|
|
739
769
|
putCancelReportById: async (body) => {
|
|
740
|
-
return API$
|
|
770
|
+
return API$z.put(`/transaction/request/${body.id}/cancel-report`);
|
|
741
771
|
}
|
|
742
772
|
};
|
|
743
|
-
const API$
|
|
773
|
+
const API$y = createAxiosInstance({
|
|
744
774
|
prefix: "/assignment/v2"
|
|
745
775
|
});
|
|
746
776
|
const AssignmentServices = {
|
|
747
777
|
...AssignmentServices$1,
|
|
748
778
|
// Temporary inclusion of methods from OldAssignmentServices. Move individual methods here once they are refactored and ready.
|
|
749
779
|
getTransactionData: (params) => {
|
|
750
|
-
return API$
|
|
780
|
+
return API$y.get("/transaction", { params });
|
|
751
781
|
},
|
|
752
782
|
getTransactionOptions: (params) => {
|
|
753
|
-
return API$
|
|
783
|
+
return API$y.get("/transaction/options", { params });
|
|
754
784
|
},
|
|
755
785
|
getDetailTransactionLog: (id) => {
|
|
756
|
-
return API$
|
|
786
|
+
return API$y.get(`/transaction/request/${id}/transaction-log`);
|
|
757
787
|
},
|
|
758
788
|
postTransaction: (body) => {
|
|
759
|
-
return API$
|
|
789
|
+
return API$y.post("/transaction", body);
|
|
760
790
|
},
|
|
761
791
|
putTransaction: (body) => {
|
|
762
|
-
return API$
|
|
792
|
+
return API$y.put("/transaction", body);
|
|
763
793
|
},
|
|
764
794
|
putUnassignTransaction: (body) => {
|
|
765
|
-
return API$
|
|
795
|
+
return API$y.put("/transaction/unassign", body);
|
|
766
796
|
},
|
|
767
797
|
putCancelReport: (body) => {
|
|
768
|
-
return API$
|
|
798
|
+
return API$y.put("/transaction/request/cancel-report", body);
|
|
769
799
|
}
|
|
770
800
|
};
|
|
771
|
-
const API$
|
|
801
|
+
const API$x = createAxiosInstance({
|
|
772
802
|
prefix: "/license/v2"
|
|
773
803
|
});
|
|
774
804
|
const TotalLicenseServices = {
|
|
775
805
|
getTotalLicense: () => {
|
|
776
|
-
return API$
|
|
806
|
+
return API$x.get("/total-license");
|
|
777
807
|
},
|
|
778
808
|
getPurchasedData: (params) => {
|
|
779
|
-
return API$
|
|
809
|
+
return API$x.get("/purchase", { params });
|
|
780
810
|
}
|
|
781
811
|
};
|
|
782
812
|
const LicenseConcurrentServices = {
|
|
783
813
|
getConcurrentUserData: () => {
|
|
784
|
-
return API$
|
|
814
|
+
return API$x.get("/concurrent-user-data");
|
|
785
815
|
},
|
|
786
816
|
getConcurrentUserList: (params) => {
|
|
787
|
-
return API$
|
|
817
|
+
return API$x.get("/concurrent-user", { params });
|
|
788
818
|
},
|
|
789
819
|
putLogoutUsers: (body) => {
|
|
790
|
-
return API$
|
|
820
|
+
return API$x.put("/concurrent-user", body);
|
|
791
821
|
}
|
|
792
822
|
};
|
|
793
823
|
const LicenseAssetServices = {
|
|
794
824
|
getFixedAssetPerGroup: (groupId, params) => {
|
|
795
|
-
return API$
|
|
825
|
+
return API$x.get(`/${groupId}/assets`, { params });
|
|
796
826
|
},
|
|
797
827
|
deleteAssetData: (params) => {
|
|
798
|
-
return API$
|
|
828
|
+
return API$x.delete("/assets", { params });
|
|
799
829
|
}
|
|
800
830
|
};
|
|
801
831
|
const LicenseServices = {
|
|
802
832
|
getFilterOptions: (path, params) => {
|
|
803
|
-
return API$
|
|
833
|
+
return API$x.get(`/${path}`, { params });
|
|
804
834
|
},
|
|
805
835
|
...TotalLicenseServices,
|
|
806
836
|
...LicenseConcurrentServices,
|
|
807
837
|
...LicenseAssetServices
|
|
808
838
|
};
|
|
809
|
-
const API$
|
|
839
|
+
const API$w = createAxiosInstance({
|
|
810
840
|
prefix: "/damage-repair-ticketing/v2"
|
|
811
841
|
});
|
|
812
842
|
const DamageServices = {
|
|
813
843
|
getDamageReportList: (params) => {
|
|
814
|
-
return API$
|
|
844
|
+
return API$w.get("/", { params });
|
|
815
845
|
},
|
|
816
846
|
getDamageReportListFilterOptions: (params) => {
|
|
817
|
-
return API$
|
|
847
|
+
return API$w.get("/options", { params });
|
|
818
848
|
},
|
|
819
849
|
getDamageReportDetail: (reportId) => {
|
|
820
|
-
return API$
|
|
850
|
+
return API$w.get(`/${reportId}`);
|
|
821
851
|
},
|
|
822
852
|
putReportDamage: (id, body) => {
|
|
823
853
|
const headers = { "Content-Type": "multipart/form-data" };
|
|
824
|
-
return API$
|
|
854
|
+
return API$w.put(`/${id}/report-damage`, body, { headers });
|
|
825
855
|
},
|
|
826
856
|
putMarkAsRepaired: (body) => {
|
|
827
|
-
return API$
|
|
857
|
+
return API$w.put("/repair", body);
|
|
828
858
|
}
|
|
829
859
|
};
|
|
830
|
-
const API$
|
|
860
|
+
const API$v = createAxiosInstance({
|
|
831
861
|
prefix: "/assets/v2/my-assets"
|
|
832
862
|
});
|
|
833
863
|
const MyAssetServices = {
|
|
834
864
|
getAssigned: async (params) => {
|
|
835
|
-
return API$
|
|
865
|
+
return API$v.get("/assigned", { params });
|
|
836
866
|
},
|
|
837
867
|
getAssignedOptions: async (params) => {
|
|
838
|
-
return API$
|
|
868
|
+
return API$v.get("/assigned/options", { params });
|
|
839
869
|
},
|
|
840
870
|
getBorrowed: async (params) => {
|
|
841
|
-
return API$
|
|
871
|
+
return API$v.get("/borrowed", { params });
|
|
842
872
|
},
|
|
843
873
|
getBorrowedOptions: async (params) => {
|
|
844
|
-
return API$
|
|
874
|
+
return API$v.get("/borrowed/options", { params });
|
|
845
875
|
},
|
|
846
876
|
getHistory: async (params) => {
|
|
847
|
-
return API$
|
|
877
|
+
return API$v.get("/history", { params });
|
|
848
878
|
},
|
|
849
879
|
getHistoryOptions: async (params) => {
|
|
850
|
-
return API$
|
|
880
|
+
return API$v.get("/history/options", { params });
|
|
851
881
|
}
|
|
852
882
|
};
|
|
853
883
|
const PREFIX = "/transfer/v2";
|
|
@@ -975,322 +1005,322 @@ const TransferServices = {
|
|
|
975
1005
|
return ApprovalAPI$1.put("/approve", body);
|
|
976
1006
|
}
|
|
977
1007
|
};
|
|
978
|
-
const API$
|
|
1008
|
+
const API$u = createAxiosInstance({
|
|
979
1009
|
prefix: "/transfer/v2"
|
|
980
1010
|
});
|
|
981
1011
|
const TransferServicesGo = {
|
|
982
1012
|
...TransferServices,
|
|
983
1013
|
getTransactionData: (params) => {
|
|
984
|
-
return API$
|
|
1014
|
+
return API$u.get("/transaction", { params });
|
|
985
1015
|
},
|
|
986
1016
|
getTransactionOptions: (params) => {
|
|
987
|
-
return API$
|
|
1017
|
+
return API$u.get("/transaction/options", { params });
|
|
988
1018
|
},
|
|
989
1019
|
getTransactionLog: (id) => {
|
|
990
|
-
return API$
|
|
1020
|
+
return API$u.get(`/transaction/request/${id}/transaction-log`);
|
|
991
1021
|
},
|
|
992
1022
|
postCreateTransaction: (body) => {
|
|
993
|
-
return API$
|
|
1023
|
+
return API$u.post("/transaction", body);
|
|
994
1024
|
}
|
|
995
1025
|
};
|
|
996
|
-
const API$
|
|
1026
|
+
const API$t = createAxiosInstance({
|
|
997
1027
|
env: "APP_TAGSAMURAI_API",
|
|
998
1028
|
prefix: "/borrowing/v2"
|
|
999
1029
|
});
|
|
1000
1030
|
const BorrowServices = {
|
|
1001
1031
|
getTaskBorrowing: async (params) => {
|
|
1002
|
-
return API$
|
|
1032
|
+
return API$t.get("/transaction/my-asset/task", { params });
|
|
1003
1033
|
},
|
|
1004
1034
|
getTaskBorrowingOptions: async (params) => {
|
|
1005
|
-
return API$
|
|
1035
|
+
return API$t.get("/transaction/my-asset/task/options", { params });
|
|
1006
1036
|
},
|
|
1007
1037
|
getBorrowedAsset: async (params) => {
|
|
1008
|
-
return API$
|
|
1038
|
+
return API$t.get("/transaction/my-asset/borrowed-asset", { params });
|
|
1009
1039
|
},
|
|
1010
1040
|
getBorrowedOptions: async (params) => {
|
|
1011
|
-
return API$
|
|
1041
|
+
return API$t.get("/transaction/my-asset/borrowed-asset/options", { params });
|
|
1012
1042
|
},
|
|
1013
1043
|
getHistory: async (params) => {
|
|
1014
|
-
return API$
|
|
1044
|
+
return API$t.get("/transaction/my-asset/history", { params });
|
|
1015
1045
|
},
|
|
1016
1046
|
getHistoryOptions: async (params) => {
|
|
1017
|
-
return API$
|
|
1047
|
+
return API$t.get("/transaction/my-asset/history/options", { params });
|
|
1018
1048
|
},
|
|
1019
1049
|
postAddPrelistData: (body) => {
|
|
1020
|
-
return API$
|
|
1050
|
+
return API$t.post("/prelist", body);
|
|
1021
1051
|
},
|
|
1022
1052
|
putCancelBorrowing: async (body) => {
|
|
1023
|
-
return API$
|
|
1053
|
+
return API$t.put("/transaction/cancel", { id: body.id });
|
|
1024
1054
|
},
|
|
1025
1055
|
putCancelExtensionRequest: async (body) => {
|
|
1026
|
-
return API$
|
|
1056
|
+
return API$t.put(`/transaction/${body.id}/cancel-extension`);
|
|
1027
1057
|
},
|
|
1028
1058
|
putCancelRequestReport: async (body) => {
|
|
1029
|
-
return API$
|
|
1059
|
+
return API$t.put(`/transaction/request/${body.id}/cancel-report`);
|
|
1030
1060
|
},
|
|
1031
1061
|
putDeclineExtensionRequest: async (body) => {
|
|
1032
|
-
return API$
|
|
1062
|
+
return API$t.put("transaction/request/decline", body);
|
|
1033
1063
|
},
|
|
1034
1064
|
putUpdateRequestExtension: async (body) => {
|
|
1035
|
-
return API$
|
|
1065
|
+
return API$t.put("transaction/request/duration", body);
|
|
1036
1066
|
},
|
|
1037
1067
|
// ------------------------------------------------------------------------------------------------------------ //
|
|
1038
1068
|
getBorrowingPrelist: (params) => {
|
|
1039
|
-
return API$
|
|
1069
|
+
return API$t.get("/prelist", { params });
|
|
1040
1070
|
},
|
|
1041
1071
|
getBorrowingPrelistOptions: (params) => {
|
|
1042
|
-
return API$
|
|
1072
|
+
return API$t.get("/prelist/options", { params });
|
|
1043
1073
|
},
|
|
1044
1074
|
deleteBorrowingPrelist: (id) => {
|
|
1045
|
-
return API$
|
|
1075
|
+
return API$t.delete("/prelist", { data: { id } });
|
|
1046
1076
|
},
|
|
1047
1077
|
getBorrowingRequest: (params) => {
|
|
1048
|
-
return API$
|
|
1078
|
+
return API$t.get("/prelist/request", { params });
|
|
1049
1079
|
},
|
|
1050
1080
|
getBorrowingRequestOptions: (params) => {
|
|
1051
|
-
return API$
|
|
1081
|
+
return API$t.get("/prelist/request/options", { params });
|
|
1052
1082
|
},
|
|
1053
1083
|
postBorrowingRequest: (data) => {
|
|
1054
|
-
return API$
|
|
1084
|
+
return API$t.post("/prelist/request", data);
|
|
1055
1085
|
},
|
|
1056
1086
|
putBorrowingRequest: (data) => {
|
|
1057
|
-
return API$
|
|
1087
|
+
return API$t.put("/prelist/request", data);
|
|
1058
1088
|
},
|
|
1059
1089
|
deleteBorrowingRequest: (id) => {
|
|
1060
|
-
return API$
|
|
1090
|
+
return API$t.delete("/prelist/request", { data: { id } });
|
|
1061
1091
|
},
|
|
1062
1092
|
postBorrowingTransaction: (data) => {
|
|
1063
|
-
return API$
|
|
1093
|
+
return API$t.post("/transaction", data, { params: { sourceWeb: true } });
|
|
1064
1094
|
},
|
|
1065
1095
|
getBorrowingTransaction: (params) => {
|
|
1066
|
-
return API$
|
|
1096
|
+
return API$t.get("/transaction", { params });
|
|
1067
1097
|
},
|
|
1068
1098
|
getBorrowingTransactionOptions: (params) => {
|
|
1069
|
-
return API$
|
|
1099
|
+
return API$t.get("/transaction/options", { params });
|
|
1070
1100
|
},
|
|
1071
1101
|
putCancelBorrowingTransaction: (id) => {
|
|
1072
|
-
return API$
|
|
1102
|
+
return API$t.put("/transaction/cancel", { id });
|
|
1073
1103
|
},
|
|
1074
1104
|
putCancelBorrowingRequest: (id) => {
|
|
1075
|
-
return API$
|
|
1105
|
+
return API$t.put("/transaction/request/cancel", { id });
|
|
1076
1106
|
},
|
|
1077
1107
|
putCancelExtendBorrowingRequest: (id) => {
|
|
1078
|
-
return API$
|
|
1108
|
+
return API$t.put("/transaction/request/extend/cancel", { id });
|
|
1079
1109
|
},
|
|
1080
1110
|
getBorrowingTransactionDetail: (id) => {
|
|
1081
|
-
return API$
|
|
1111
|
+
return API$t.get(`/transaction/${id}`);
|
|
1082
1112
|
},
|
|
1083
1113
|
getBorrowingTransactionRequestList: (params) => {
|
|
1084
|
-
return API$
|
|
1114
|
+
return API$t.get("/transaction/request", { params });
|
|
1085
1115
|
},
|
|
1086
1116
|
getBorrowingTransactionRequest: (id, params) => {
|
|
1087
|
-
return API$
|
|
1117
|
+
return API$t.get(`/transaction/${id}/request`, { params });
|
|
1088
1118
|
},
|
|
1089
1119
|
getBorrowingTransactionRequestOptions: (id, params) => {
|
|
1090
|
-
return API$
|
|
1120
|
+
return API$t.get(`/transaction/${id}/request/options`, { params });
|
|
1091
1121
|
},
|
|
1092
1122
|
putBorrowingTransactionRequest: (id, data) => {
|
|
1093
|
-
return API$
|
|
1123
|
+
return API$t.put(`/transaction/${id}/request`, data);
|
|
1094
1124
|
},
|
|
1095
1125
|
getApprovalList: (id) => {
|
|
1096
|
-
return API$
|
|
1126
|
+
return API$t.get(`/approval/transaction/${id}/transaction`);
|
|
1097
1127
|
},
|
|
1098
1128
|
putUpdateEmailorBorrower: (id, data) => {
|
|
1099
|
-
return API$
|
|
1129
|
+
return API$t.put(`/transaction/${id}/update-email-or-borrower`, data);
|
|
1100
1130
|
},
|
|
1101
1131
|
getTransactionRequestScan: (id, tag) => {
|
|
1102
|
-
return API$
|
|
1132
|
+
return API$t.get(`/transaction/${id}/request/scan`, { params: { tag } });
|
|
1103
1133
|
},
|
|
1104
1134
|
putUpdateBorrower: (id, userId) => {
|
|
1105
|
-
return API$
|
|
1135
|
+
return API$t.put(`/transaction/${id}/user`, { user: userId });
|
|
1106
1136
|
},
|
|
1107
1137
|
postSendConfirmationEmail: (id) => {
|
|
1108
|
-
return API$
|
|
1138
|
+
return API$t.post(`/transaction/${id}/send-confirmation-email`);
|
|
1109
1139
|
},
|
|
1110
1140
|
putVerifyRequests: (id, data) => {
|
|
1111
|
-
return API$
|
|
1141
|
+
return API$t.put(`/transaction/${id}/verify-requests`, data);
|
|
1112
1142
|
},
|
|
1113
1143
|
getBorrowingTransactionHistoryByTransaction: (params) => {
|
|
1114
|
-
return API$
|
|
1144
|
+
return API$t.get("/transaction/history/by-transaction", { params });
|
|
1115
1145
|
},
|
|
1116
1146
|
getBorrowingTransactionHistoryByAsset: (params) => {
|
|
1117
|
-
return API$
|
|
1147
|
+
return API$t.get("/transaction/history/by-asset", { params });
|
|
1118
1148
|
},
|
|
1119
1149
|
getBorrowingTransactionHistoryOptions: (params) => {
|
|
1120
|
-
return API$
|
|
1150
|
+
return API$t.get("/transaction/history/options", { params });
|
|
1121
1151
|
},
|
|
1122
1152
|
putBorrowingVerifyToken: (token) => {
|
|
1123
|
-
return API$
|
|
1153
|
+
return API$t.put("/transaction/verify-token", { token });
|
|
1124
1154
|
},
|
|
1125
1155
|
putBorrowingHandoverConfirmation: (data) => {
|
|
1126
|
-
return API$
|
|
1156
|
+
return API$t.put("/transaction/handover-confirmation", data);
|
|
1127
1157
|
},
|
|
1128
1158
|
putBorrowingHandover: (id) => {
|
|
1129
|
-
return API$
|
|
1159
|
+
return API$t.put(`/transaction/${id}/handover`);
|
|
1130
1160
|
},
|
|
1131
1161
|
putBorrowingExtendRequest: (data) => {
|
|
1132
|
-
return API$
|
|
1162
|
+
return API$t.put("/transaction/request/extend", data);
|
|
1133
1163
|
},
|
|
1134
1164
|
putBorrowingExtendApproval: (data) => {
|
|
1135
|
-
return API$
|
|
1165
|
+
return API$t.put("/approval/approve/request-extension", data, {
|
|
1136
1166
|
params: { sourceWeb: true }
|
|
1137
1167
|
});
|
|
1138
1168
|
},
|
|
1139
1169
|
putBorrowingDeclineExtendRequest: (id) => {
|
|
1140
|
-
return API$
|
|
1170
|
+
return API$t.put("/transaction/request/decline", { id });
|
|
1141
1171
|
},
|
|
1142
1172
|
getBorrowingBorrowedAsset: (params) => {
|
|
1143
|
-
return API$
|
|
1173
|
+
return API$t.get("/transaction/request/borrowed/by-asset", { params });
|
|
1144
1174
|
},
|
|
1145
1175
|
getBorrowingBorrowedAssetOptions: (params) => {
|
|
1146
|
-
return API$
|
|
1176
|
+
return API$t.get("/transaction/request/borrowed/by-asset/options", {
|
|
1147
1177
|
params
|
|
1148
1178
|
});
|
|
1149
1179
|
},
|
|
1150
1180
|
getBorrowingBorrowedBorrower: (params) => {
|
|
1151
|
-
return API$
|
|
1181
|
+
return API$t.get("/transaction/request/borrowed/by-user", { params });
|
|
1152
1182
|
},
|
|
1153
1183
|
putBorrowingReportDamaged: (id, data) => {
|
|
1154
|
-
return API$
|
|
1184
|
+
return API$t.put(`/transaction/request/${id}/damaged`, data);
|
|
1155
1185
|
},
|
|
1156
1186
|
putBorrowingReportMissing: (id, data) => {
|
|
1157
|
-
return API$
|
|
1187
|
+
return API$t.put(`/transaction/request/${id}/missing`, data);
|
|
1158
1188
|
},
|
|
1159
1189
|
putBorrowingReturn: (id) => {
|
|
1160
|
-
return API$
|
|
1190
|
+
return API$t.put("/transaction/request/return", { id });
|
|
1161
1191
|
},
|
|
1162
1192
|
getBorrowingLog: (id) => {
|
|
1163
|
-
return API$
|
|
1193
|
+
return API$t.get(`/transaction/request/${id}/transaction-log`);
|
|
1164
1194
|
},
|
|
1165
1195
|
putConfirmReportDone: (id, data) => {
|
|
1166
|
-
return API$
|
|
1196
|
+
return API$t.put(`/transaction/request/${id}/confirm-report-done`, data);
|
|
1167
1197
|
},
|
|
1168
1198
|
putCancelReportBulk: (id) => {
|
|
1169
|
-
return API$
|
|
1199
|
+
return API$t.put("/transaction/request/cancel-report", {
|
|
1170
1200
|
id
|
|
1171
1201
|
});
|
|
1172
1202
|
},
|
|
1173
1203
|
putBorrowingEditExtension: (data) => {
|
|
1174
|
-
return API$
|
|
1204
|
+
return API$t.put("/transaction/request/duration", data);
|
|
1175
1205
|
},
|
|
1176
1206
|
getApproval: (params) => {
|
|
1177
|
-
return API$
|
|
1207
|
+
return API$t.get("/approval", { params });
|
|
1178
1208
|
},
|
|
1179
1209
|
getApprovalOptions: (params) => {
|
|
1180
|
-
return API$
|
|
1210
|
+
return API$t.get("/approval/options", { params });
|
|
1181
1211
|
},
|
|
1182
1212
|
getApprovalTransactionRequest: (id, params) => {
|
|
1183
|
-
return API$
|
|
1213
|
+
return API$t.get(`/approval/transaction/${id}`, { params });
|
|
1184
1214
|
},
|
|
1185
1215
|
getApprovalTransactionRequestOptions: (id, params) => {
|
|
1186
|
-
return API$
|
|
1216
|
+
return API$t.get(`/approval/transaction/${id}/options`, { params });
|
|
1187
1217
|
},
|
|
1188
1218
|
putApprovalApprove: (data) => {
|
|
1189
|
-
return API$
|
|
1219
|
+
return API$t.put("/approval/approve", data, {
|
|
1190
1220
|
params: { sourceWeb: true }
|
|
1191
1221
|
});
|
|
1192
1222
|
}
|
|
1193
1223
|
};
|
|
1194
|
-
const API$
|
|
1224
|
+
const API$s = createAxiosInstance({
|
|
1195
1225
|
prefix: "/borrowing/v2"
|
|
1196
1226
|
});
|
|
1197
1227
|
const BorrowServicesGo = {
|
|
1198
1228
|
...BorrowServices,
|
|
1199
1229
|
// Temporary inclusion of methods from OldBorrowServices. Move individual methods here once they are refactored and ready.
|
|
1200
1230
|
getTransactions: async (params) => {
|
|
1201
|
-
return API$
|
|
1231
|
+
return API$s.get("/transaction", { params });
|
|
1202
1232
|
},
|
|
1203
1233
|
getTransactionOptions: async (params) => {
|
|
1204
|
-
return API$
|
|
1234
|
+
return API$s.get("/transaction/options", { params });
|
|
1205
1235
|
},
|
|
1206
1236
|
getTransactionLog: async (id) => {
|
|
1207
|
-
return API$
|
|
1237
|
+
return API$s.get(`/transaction/request/${id}/transaction-log`);
|
|
1208
1238
|
},
|
|
1209
1239
|
postTransaction: async (body) => {
|
|
1210
|
-
return API$
|
|
1240
|
+
return API$s.post("/transaction", body);
|
|
1211
1241
|
},
|
|
1212
1242
|
putTransaction: async (body) => {
|
|
1213
|
-
return API$
|
|
1243
|
+
return API$s.put("/transaction", body);
|
|
1214
1244
|
},
|
|
1215
1245
|
putTransactionReturn: async (requestIds) => {
|
|
1216
1246
|
const body = { id: requestIds };
|
|
1217
|
-
return API$
|
|
1247
|
+
return API$s.put("/transaction/return", body);
|
|
1218
1248
|
},
|
|
1219
1249
|
putCancelReport: async (requestIds) => {
|
|
1220
1250
|
const body = { id: requestIds };
|
|
1221
|
-
return API$
|
|
1251
|
+
return API$s.put("/transaction/request/cancel-report", body);
|
|
1222
1252
|
}
|
|
1223
1253
|
};
|
|
1224
|
-
const API$
|
|
1254
|
+
const API$r = createAxiosInstance({
|
|
1225
1255
|
prefix: "/disposal/v2/"
|
|
1226
1256
|
});
|
|
1227
1257
|
const DisposalServices$1 = {
|
|
1228
1258
|
getReportedDisposal: (params) => {
|
|
1229
|
-
return API$
|
|
1259
|
+
return API$r.get("/report", { params });
|
|
1230
1260
|
},
|
|
1231
1261
|
getReportedDisposalOptions: (params) => {
|
|
1232
|
-
return API$
|
|
1262
|
+
return API$r.get("/report/options", { params });
|
|
1233
1263
|
},
|
|
1234
1264
|
postReportDisposal: (body) => {
|
|
1235
|
-
return API$
|
|
1265
|
+
return API$r.post("/report", body);
|
|
1236
1266
|
},
|
|
1237
1267
|
deleteCancelReport: (params) => {
|
|
1238
1268
|
params.isFromDisposal = "false";
|
|
1239
|
-
return API$
|
|
1269
|
+
return API$r.delete("/report/cancel-report", { params });
|
|
1240
1270
|
},
|
|
1241
1271
|
deleteDeclineReport: (params) => {
|
|
1242
1272
|
params.isFromDisposal = "true";
|
|
1243
|
-
return API$
|
|
1273
|
+
return API$r.delete("/report/cancel-report", { params });
|
|
1244
1274
|
},
|
|
1245
1275
|
getDisposalHistory: (params) => {
|
|
1246
|
-
return API$
|
|
1276
|
+
return API$r.get("/transaction", { params });
|
|
1247
1277
|
},
|
|
1248
1278
|
getHistoryByAssetOptions: (params) => {
|
|
1249
|
-
return API$
|
|
1279
|
+
return API$r.get("/transaction/options", { params });
|
|
1250
1280
|
},
|
|
1251
1281
|
getDisposalTransactionLog: (requestId) => {
|
|
1252
|
-
return API$
|
|
1282
|
+
return API$r.get(`/transaction/request/${requestId}/transaction-log`);
|
|
1253
1283
|
},
|
|
1254
1284
|
postCreateTransaction: (body) => {
|
|
1255
|
-
return API$
|
|
1285
|
+
return API$r.post("/transaction", body);
|
|
1256
1286
|
}
|
|
1257
1287
|
};
|
|
1258
|
-
const API$
|
|
1288
|
+
const API$q = createAxiosInstance({
|
|
1259
1289
|
prefix: "/report/v2/reports"
|
|
1260
1290
|
});
|
|
1261
1291
|
const ReportServices = {
|
|
1262
1292
|
getReportList: (params) => {
|
|
1263
|
-
return API$
|
|
1293
|
+
return API$q.get("/schedules", { params });
|
|
1264
1294
|
},
|
|
1265
1295
|
getReportSchedule: (scheduleId) => {
|
|
1266
|
-
return API$
|
|
1296
|
+
return API$q.get("/schedules/" + scheduleId);
|
|
1267
1297
|
},
|
|
1268
1298
|
getUniqueScheduleName: (name) => {
|
|
1269
|
-
return API$
|
|
1299
|
+
return API$q.get("/schedules/unique-name", { params: { name } });
|
|
1270
1300
|
},
|
|
1271
1301
|
getFilterOptions: (params) => {
|
|
1272
|
-
return API$
|
|
1302
|
+
return API$q.get("/schedules/options", { params });
|
|
1273
1303
|
},
|
|
1274
1304
|
putSetActive: (body) => {
|
|
1275
|
-
return API$
|
|
1305
|
+
return API$q.put("/schedules/set-active", body);
|
|
1276
1306
|
},
|
|
1277
1307
|
putEditSchedule: (id, body) => {
|
|
1278
|
-
return API$
|
|
1308
|
+
return API$q.put(`/schedules/${id}`, body);
|
|
1279
1309
|
},
|
|
1280
1310
|
deleteReports: (id) => {
|
|
1281
|
-
return API$
|
|
1311
|
+
return API$q.delete("/schedules", { params: { id } });
|
|
1282
1312
|
},
|
|
1283
1313
|
postCreateSchedule: (data) => {
|
|
1284
|
-
return API$
|
|
1314
|
+
return API$q.post("/schedules", data);
|
|
1285
1315
|
},
|
|
1286
1316
|
postDownloadReport: (data) => {
|
|
1287
|
-
return API$
|
|
1317
|
+
return API$q.post("/download", data, { responseType: "arraybuffer" });
|
|
1288
1318
|
},
|
|
1289
1319
|
postGenerateReport: (data) => {
|
|
1290
|
-
return API$
|
|
1320
|
+
return API$q.post("/generate", data);
|
|
1291
1321
|
}
|
|
1292
1322
|
};
|
|
1293
|
-
const API$
|
|
1323
|
+
const API$p = createAxiosInstance({
|
|
1294
1324
|
prefix: "/settings-attribute/v2"
|
|
1295
1325
|
});
|
|
1296
1326
|
const getEndpoint = (type) => {
|
|
@@ -1298,111 +1328,111 @@ const getEndpoint = (type) => {
|
|
|
1298
1328
|
};
|
|
1299
1329
|
const GroupCategoryServices = {
|
|
1300
1330
|
getGroupCategory: (type, params) => {
|
|
1301
|
-
return API$
|
|
1331
|
+
return API$p.get(`/${getEndpoint(type)}/tree`, { params });
|
|
1302
1332
|
},
|
|
1303
1333
|
getCategoryTree: () => {
|
|
1304
|
-
return API$
|
|
1334
|
+
return API$p.get("/category/tree");
|
|
1305
1335
|
},
|
|
1306
1336
|
getGroupTree: (params) => {
|
|
1307
|
-
return API$
|
|
1337
|
+
return API$p.get("/groups/tree", { params });
|
|
1308
1338
|
},
|
|
1309
1339
|
// Doesn't exist in company plan other than "Basic"
|
|
1310
1340
|
getGroupCategoryList: (type, groupId, params) => {
|
|
1311
|
-
return API$
|
|
1341
|
+
return API$p.get(`/${getEndpoint(type)}/${groupId}`, { params });
|
|
1312
1342
|
},
|
|
1313
1343
|
getNames: (type) => {
|
|
1314
|
-
return API$
|
|
1344
|
+
return API$p.get(`/${getEndpoint(type)}/names`);
|
|
1315
1345
|
},
|
|
1316
1346
|
getCodes: (type) => {
|
|
1317
|
-
return API$
|
|
1347
|
+
return API$p.get(`/${getEndpoint(type)}/codes`);
|
|
1318
1348
|
},
|
|
1319
1349
|
postCreateGroupCategory: (type, body) => {
|
|
1320
|
-
return API$
|
|
1350
|
+
return API$p.post(`/${getEndpoint(type)}`, body);
|
|
1321
1351
|
},
|
|
1322
1352
|
putEditGroupCategory: (type, body, objectId) => {
|
|
1323
|
-
return API$
|
|
1353
|
+
return API$p.put(`/${getEndpoint(type)}/${objectId}`, body);
|
|
1324
1354
|
},
|
|
1325
1355
|
// Doesn't exist in company plan other than "Enterprise"
|
|
1326
1356
|
putMoveGroup: (body, objectId) => {
|
|
1327
|
-
return API$
|
|
1357
|
+
return API$p.put(`/groups/${objectId}/move-group`, body);
|
|
1328
1358
|
},
|
|
1329
1359
|
// Doesn't exist in company plan other than "Enterprise"
|
|
1330
1360
|
putEditBulkGroups: async (body) => {
|
|
1331
|
-
return API$
|
|
1361
|
+
return API$p.put("/groups/bulk", body);
|
|
1332
1362
|
},
|
|
1333
1363
|
deleteGroupCategory: (type, body, objectId) => {
|
|
1334
|
-
return API$
|
|
1364
|
+
return API$p.delete(`/${getEndpoint(type)}/${objectId}`, { data: body });
|
|
1335
1365
|
}
|
|
1336
1366
|
};
|
|
1337
|
-
const API$
|
|
1367
|
+
const API$o = createAxiosInstance({
|
|
1338
1368
|
prefix: "/settings-attribute/v2/alias-code"
|
|
1339
1369
|
});
|
|
1340
1370
|
const AliasCodeServices = {
|
|
1341
1371
|
getAliasCode: () => {
|
|
1342
|
-
return API$
|
|
1372
|
+
return API$o.get("/");
|
|
1343
1373
|
},
|
|
1344
1374
|
postAliasCode: (data) => {
|
|
1345
|
-
return API$
|
|
1375
|
+
return API$o.post("/", data);
|
|
1346
1376
|
},
|
|
1347
1377
|
getAliasCodeList: (params) => {
|
|
1348
|
-
return API$
|
|
1378
|
+
return API$o.get(`/${params.object}/code-list`, { params });
|
|
1349
1379
|
}
|
|
1350
1380
|
};
|
|
1351
|
-
const API$
|
|
1381
|
+
const API$n = createAxiosInstance({
|
|
1352
1382
|
prefix: "/settings-attribute/v2/general-settings"
|
|
1353
1383
|
});
|
|
1354
1384
|
const GeneralSettingsServices = {
|
|
1355
1385
|
getGeneralSettings: () => {
|
|
1356
|
-
return API$
|
|
1386
|
+
return API$n.get("/");
|
|
1357
1387
|
},
|
|
1358
1388
|
putUpdateGeneralSettings: (data) => {
|
|
1359
|
-
return API$
|
|
1389
|
+
return API$n.put("/", data);
|
|
1360
1390
|
}
|
|
1361
1391
|
};
|
|
1362
|
-
const API$
|
|
1392
|
+
const API$m = createAxiosInstance({
|
|
1363
1393
|
prefix: "/settings-attribute/v2/custom-field"
|
|
1364
1394
|
});
|
|
1365
1395
|
const CustomFieldServices = {
|
|
1366
1396
|
getCustomField: async (params) => {
|
|
1367
|
-
return API$
|
|
1397
|
+
return API$m.get("/", { params });
|
|
1368
1398
|
},
|
|
1369
1399
|
getCustomFieldsByCategory: (category, params) => {
|
|
1370
|
-
return API$
|
|
1400
|
+
return API$m.get(`/${category}`, { params });
|
|
1371
1401
|
},
|
|
1372
1402
|
getOptions: async (params) => {
|
|
1373
|
-
return API$
|
|
1403
|
+
return API$m.get("/options", { params });
|
|
1374
1404
|
},
|
|
1375
1405
|
postCreateCustomField: async (params, data) => {
|
|
1376
|
-
return API$
|
|
1406
|
+
return API$m.post("/", data, { params });
|
|
1377
1407
|
},
|
|
1378
1408
|
putEditCustomField: async (params, data, id) => {
|
|
1379
|
-
return API$
|
|
1409
|
+
return API$m.put(`/${id}`, data, { params });
|
|
1380
1410
|
},
|
|
1381
1411
|
putChangeStatus: async (params, data) => {
|
|
1382
|
-
return API$
|
|
1412
|
+
return API$m.put("/bulk", data, { params });
|
|
1383
1413
|
},
|
|
1384
1414
|
deleteCustomField: async (params) => {
|
|
1385
|
-
return API$
|
|
1415
|
+
return API$m.delete("/bulk", { params });
|
|
1386
1416
|
},
|
|
1387
1417
|
getUsedCustomFields: async () => {
|
|
1388
|
-
return API$
|
|
1418
|
+
return API$m.get("/used-by-assets");
|
|
1389
1419
|
}
|
|
1390
1420
|
};
|
|
1391
|
-
const API$
|
|
1421
|
+
const API$l = createAxiosInstance({
|
|
1392
1422
|
prefix: "/settings-attribute/v2/asset-name-policy"
|
|
1393
1423
|
});
|
|
1394
1424
|
const AssetPolicyServices = {
|
|
1395
1425
|
getList: (params) => {
|
|
1396
|
-
return API$
|
|
1426
|
+
return API$l.get("/", { params });
|
|
1397
1427
|
},
|
|
1398
1428
|
getListFilterOptions: (params) => {
|
|
1399
|
-
return API$
|
|
1429
|
+
return API$l.get("/options");
|
|
1400
1430
|
},
|
|
1401
1431
|
putUpdatePolicy: (body) => {
|
|
1402
|
-
return API$
|
|
1432
|
+
return API$l.put("/", body);
|
|
1403
1433
|
}
|
|
1404
1434
|
};
|
|
1405
|
-
const API$
|
|
1435
|
+
const API$k = createAxiosInstance({
|
|
1406
1436
|
prefix: "/settings-user-role/v2/auth"
|
|
1407
1437
|
});
|
|
1408
1438
|
const onRejected$1 = (error) => {
|
|
@@ -1417,10 +1447,10 @@ const onRejected$1 = (error) => {
|
|
|
1417
1447
|
};
|
|
1418
1448
|
const AuthServices$1 = {
|
|
1419
1449
|
reLogin: (body) => {
|
|
1420
|
-
API$
|
|
1450
|
+
API$k.interceptors.response.use((response) => {
|
|
1421
1451
|
return response;
|
|
1422
1452
|
}, onRejected$1);
|
|
1423
|
-
return API$
|
|
1453
|
+
return API$k.post("/login", body);
|
|
1424
1454
|
}
|
|
1425
1455
|
};
|
|
1426
1456
|
const DepreciationMethodAPI = createAxiosInstance({
|
|
@@ -1486,31 +1516,31 @@ const AccountingServices = {
|
|
|
1486
1516
|
return AccountCodeAPI.put("/account-code/" + id, body);
|
|
1487
1517
|
}
|
|
1488
1518
|
};
|
|
1489
|
-
const API$
|
|
1519
|
+
const API$j = createAxiosInstance({
|
|
1490
1520
|
env: "APP_TAGSAMURAI_API",
|
|
1491
1521
|
prefix: "/settings-attribute/v2/asset-name"
|
|
1492
1522
|
});
|
|
1493
1523
|
const AssetNameServices = {
|
|
1494
1524
|
getDropdown: (params) => {
|
|
1495
|
-
return API$
|
|
1525
|
+
return API$j.get("/dropdown", { params });
|
|
1496
1526
|
},
|
|
1497
1527
|
getAssetNameDetail: (id) => {
|
|
1498
|
-
return API$
|
|
1528
|
+
return API$j.get(`/${id}`);
|
|
1499
1529
|
},
|
|
1500
1530
|
getAssetsByAssetName: (id, params) => {
|
|
1501
|
-
return API$
|
|
1531
|
+
return API$j.get(`/${id}/list-asset`, { params });
|
|
1502
1532
|
},
|
|
1503
1533
|
getAssetNameList: (params) => {
|
|
1504
|
-
return API$
|
|
1534
|
+
return API$j.get("/", { params });
|
|
1505
1535
|
},
|
|
1506
1536
|
getUnpairedAssetName: (params) => {
|
|
1507
|
-
return API$
|
|
1537
|
+
return API$j.get("/unpaired", { params });
|
|
1508
1538
|
},
|
|
1509
1539
|
getOptions: (params) => {
|
|
1510
|
-
return API$
|
|
1540
|
+
return API$j.get("/options", { params });
|
|
1511
1541
|
}
|
|
1512
1542
|
};
|
|
1513
|
-
const API$
|
|
1543
|
+
const API$i = createAxiosInstance({
|
|
1514
1544
|
env: "APP_TAGSAMURAI_API",
|
|
1515
1545
|
prefix: "/audit/v2"
|
|
1516
1546
|
});
|
|
@@ -1520,100 +1550,100 @@ const API_IOT = createAxiosInstance({
|
|
|
1520
1550
|
});
|
|
1521
1551
|
const TaskServices = {
|
|
1522
1552
|
getTaskList: (params) => {
|
|
1523
|
-
return API$
|
|
1553
|
+
return API$i.get("/audit/task", { params });
|
|
1524
1554
|
},
|
|
1525
1555
|
getTaskHistory: (params) => {
|
|
1526
|
-
return API$
|
|
1556
|
+
return API$i.get("/audit/task/history", { params });
|
|
1527
1557
|
},
|
|
1528
1558
|
extendAuditDuration: (body, id) => {
|
|
1529
|
-
return API$
|
|
1559
|
+
return API$i.put(`/audit/task/${id}/extend`, body);
|
|
1530
1560
|
},
|
|
1531
1561
|
stopAudit: (id, body) => {
|
|
1532
|
-
return API$
|
|
1562
|
+
return API$i.put(`/audit/task/${id}/stop`, body);
|
|
1533
1563
|
},
|
|
1534
1564
|
cancelAuditTask: (id) => {
|
|
1535
|
-
return API$
|
|
1565
|
+
return API$i.put(`/audit/task/${id}/cancel`);
|
|
1536
1566
|
},
|
|
1537
1567
|
getTaskDetail: (id) => {
|
|
1538
|
-
return API$
|
|
1568
|
+
return API$i.get(`/audit/task/${id}`);
|
|
1539
1569
|
},
|
|
1540
1570
|
getInAuditTask: (params) => {
|
|
1541
|
-
return API$
|
|
1571
|
+
return API$i.get("/audit/scheduled-asset/in-audit", { params });
|
|
1542
1572
|
},
|
|
1543
1573
|
getTaskDetailAssets: (params, taskId) => {
|
|
1544
|
-
return API$
|
|
1574
|
+
return API$i.get(`/audit/task/${taskId}/view-asset-detail`, { params });
|
|
1545
1575
|
},
|
|
1546
1576
|
getAuditedTask: (params) => {
|
|
1547
|
-
return API$
|
|
1577
|
+
return API$i.get("/audit/scheduled-asset/audited", { params });
|
|
1548
1578
|
},
|
|
1549
1579
|
getAuditLog: (id) => {
|
|
1550
|
-
return API$
|
|
1580
|
+
return API$i.get(`/audit/scheduled-asset/${id}/log`);
|
|
1551
1581
|
},
|
|
1552
1582
|
getTaskEventLog: (params) => {
|
|
1553
|
-
return API$
|
|
1583
|
+
return API$i.get("/audit/task/task-event-log", { params });
|
|
1554
1584
|
},
|
|
1555
1585
|
getTaskTimelineEventLog: (idTask) => {
|
|
1556
|
-
return API$
|
|
1586
|
+
return API$i.get(`/audit/task/${idTask}/event-log`);
|
|
1557
1587
|
},
|
|
1558
1588
|
scanAssetTAG: (body, idTask) => {
|
|
1559
|
-
return API$
|
|
1589
|
+
return API$i.put(`/audit/task/${idTask}/scan`, body);
|
|
1560
1590
|
},
|
|
1561
1591
|
submitAssetCondition: (body, idAsset) => {
|
|
1562
1592
|
const headers = body.picture ? { "Content-Type": "multipart/form-data" } : { "Content-Type": "application/json" };
|
|
1563
|
-
return API$
|
|
1593
|
+
return API$i.put(`/audit/scheduled-asset/${idAsset}/update/condition`, body, {
|
|
1564
1594
|
headers
|
|
1565
1595
|
});
|
|
1566
1596
|
},
|
|
1567
1597
|
submitAuditedAsset: (idTask) => {
|
|
1568
|
-
return API$
|
|
1598
|
+
return API$i.put(`/audit/task/${idTask}/submit`);
|
|
1569
1599
|
},
|
|
1570
1600
|
reportTAGMissing: (note, idAsset) => {
|
|
1571
|
-
return API$
|
|
1601
|
+
return API$i.put(`/audit/scheduled-asset/${idAsset}/report-missing`, {
|
|
1572
1602
|
note
|
|
1573
1603
|
});
|
|
1574
1604
|
},
|
|
1575
1605
|
reportTAG: (id, body) => {
|
|
1576
|
-
return API$
|
|
1606
|
+
return API$i.put(`/audit/scheduled-asset/${id}/tag-reported`, body);
|
|
1577
1607
|
},
|
|
1578
1608
|
getTaskInitialState: (idTask) => {
|
|
1579
|
-
return API$
|
|
1609
|
+
return API$i.get(`/audit/scheduled-asset/${idTask}`);
|
|
1580
1610
|
},
|
|
1581
1611
|
cancelTaskReport: (scheduledAssetId) => {
|
|
1582
|
-
return API$
|
|
1612
|
+
return API$i.put(`/audit/scheduled-asset/${scheduledAssetId}/cancel-report`);
|
|
1583
1613
|
}
|
|
1584
1614
|
};
|
|
1585
1615
|
const ScheduleServices = {
|
|
1586
1616
|
getScheduleList: (params) => {
|
|
1587
|
-
return API$
|
|
1617
|
+
return API$i.get("/audit/schedule", { params });
|
|
1588
1618
|
},
|
|
1589
1619
|
getScheduleDetail: (id) => {
|
|
1590
|
-
return API$
|
|
1620
|
+
return API$i.get("/audit/schedule/" + id);
|
|
1591
1621
|
},
|
|
1592
1622
|
deleteSchedule: (scheduleId) => {
|
|
1593
|
-
return API$
|
|
1623
|
+
return API$i.put("/audit/schedule/bulk-delete", {
|
|
1594
1624
|
id: scheduleId
|
|
1595
1625
|
});
|
|
1596
1626
|
},
|
|
1597
1627
|
inactivateSchedule: (id) => {
|
|
1598
|
-
return API$
|
|
1628
|
+
return API$i.put("/audit/schedule/bulk-inactive", { id });
|
|
1599
1629
|
},
|
|
1600
1630
|
activateSchedule: (id) => {
|
|
1601
|
-
return API$
|
|
1631
|
+
return API$i.put("/audit/schedule/bulk-active", { id });
|
|
1602
1632
|
},
|
|
1603
1633
|
createNewSchedule: (body) => {
|
|
1604
|
-
return API$
|
|
1634
|
+
return API$i.post("/audit/schedule", body);
|
|
1605
1635
|
},
|
|
1606
1636
|
editSchedule: (body, id) => {
|
|
1607
|
-
return API$
|
|
1637
|
+
return API$i.put("/audit/schedule/" + id, body);
|
|
1608
1638
|
},
|
|
1609
1639
|
getActiveAsset: (id, params) => {
|
|
1610
|
-
return API$
|
|
1640
|
+
return API$i.get(`/audit/asset/schedule/${id}`, { params });
|
|
1611
1641
|
},
|
|
1612
1642
|
setAssetActivation: (body) => {
|
|
1613
|
-
return API$
|
|
1643
|
+
return API$i.put("/audit/asset/activation", body);
|
|
1614
1644
|
},
|
|
1615
1645
|
getAuditableAssetAmount: (params) => {
|
|
1616
|
-
return API$
|
|
1646
|
+
return API$i.get("/audit/asset/auditable/total-asset", { params });
|
|
1617
1647
|
}
|
|
1618
1648
|
};
|
|
1619
1649
|
const IOTAuditServices = {
|
|
@@ -1627,17 +1657,17 @@ const IOTAuditServices = {
|
|
|
1627
1657
|
return API_IOT.put(`/iot/audit/${auditId}`, body);
|
|
1628
1658
|
},
|
|
1629
1659
|
getReaderTotalAsset: (taskId, params) => {
|
|
1630
|
-
return API$
|
|
1660
|
+
return API$i.get(`/audit/task/${taskId}/reader/total-assets`, {
|
|
1631
1661
|
params
|
|
1632
1662
|
});
|
|
1633
1663
|
},
|
|
1634
1664
|
getAssetList: (params) => {
|
|
1635
|
-
return API$
|
|
1665
|
+
return API$i.get("/audit/scheduled-asset", { params });
|
|
1636
1666
|
}
|
|
1637
1667
|
};
|
|
1638
1668
|
const FilterServices = {
|
|
1639
1669
|
getFilterOptions: (path, params) => {
|
|
1640
|
-
return API$
|
|
1670
|
+
return API$i.get(`/${path}/options`, { params });
|
|
1641
1671
|
},
|
|
1642
1672
|
getIOTFilterOptions: (path, params) => {
|
|
1643
1673
|
return API_IOT.get(`/${path}/options`, { params });
|
|
@@ -1645,50 +1675,50 @@ const FilterServices = {
|
|
|
1645
1675
|
};
|
|
1646
1676
|
const AuditableAssetServices = {
|
|
1647
1677
|
getAudiableAssetList: (params) => {
|
|
1648
|
-
return API$
|
|
1678
|
+
return API$i.get("/audit/asset/auditable", { params });
|
|
1649
1679
|
},
|
|
1650
1680
|
getAuditableAssetDetail: (id) => {
|
|
1651
|
-
return API$
|
|
1681
|
+
return API$i.get("/audit/asset/auditable/" + id);
|
|
1652
1682
|
}
|
|
1653
1683
|
};
|
|
1654
1684
|
const ApprovalServices = {
|
|
1655
1685
|
getApprovalList: (idTask, approvalRound) => {
|
|
1656
|
-
return API$
|
|
1686
|
+
return API$i.get(`/audit/approval/task/${idTask}/transaction`, {
|
|
1657
1687
|
params: {
|
|
1658
1688
|
approvalRound
|
|
1659
1689
|
}
|
|
1660
1690
|
});
|
|
1661
1691
|
},
|
|
1662
1692
|
getActiveApprovalList: (params) => {
|
|
1663
|
-
return API$
|
|
1693
|
+
return API$i.get("/audit/approval/active", { params });
|
|
1664
1694
|
},
|
|
1665
1695
|
getHisotryApprovalList: (params) => {
|
|
1666
|
-
return API$
|
|
1696
|
+
return API$i.get("/audit/approval/history", { params });
|
|
1667
1697
|
},
|
|
1668
1698
|
getTaskDetail: (id) => {
|
|
1669
|
-
return API$
|
|
1699
|
+
return API$i.get(`/audit/task/${id}`);
|
|
1670
1700
|
},
|
|
1671
1701
|
getApprovalHistoryDetail: (idApproval) => {
|
|
1672
|
-
return API$
|
|
1702
|
+
return API$i.get(`/audit/approval/${idApproval}`);
|
|
1673
1703
|
},
|
|
1674
1704
|
getApprovalAssetList: (params) => {
|
|
1675
|
-
return API$
|
|
1705
|
+
return API$i.get("/audit/scheduled-asset/audited", { params });
|
|
1676
1706
|
},
|
|
1677
1707
|
submitApprovalAction: (body) => {
|
|
1678
|
-
return API$
|
|
1708
|
+
return API$i.put("/audit/approval/approve", body);
|
|
1679
1709
|
}
|
|
1680
1710
|
};
|
|
1681
1711
|
const AuditServices = {
|
|
1682
1712
|
getAudit: (assetId, params) => {
|
|
1683
|
-
return API$
|
|
1713
|
+
return API$i.get(`/audit/schedule/asset-detail/${assetId}`, { params });
|
|
1684
1714
|
},
|
|
1685
1715
|
getAuditOption: (assetId, params) => {
|
|
1686
|
-
return API$
|
|
1716
|
+
return API$i.get(`/audit/schedule/asset-detail/${assetId}/options`, {
|
|
1687
1717
|
params
|
|
1688
1718
|
});
|
|
1689
1719
|
},
|
|
1690
1720
|
putSetActive: (body) => {
|
|
1691
|
-
return API$
|
|
1721
|
+
return API$i.put("/audit/asset/activation", body);
|
|
1692
1722
|
},
|
|
1693
1723
|
...TaskServices,
|
|
1694
1724
|
...ScheduleServices,
|
|
@@ -1697,54 +1727,16 @@ const AuditServices = {
|
|
|
1697
1727
|
...AuditableAssetServices,
|
|
1698
1728
|
...ApprovalServices
|
|
1699
1729
|
};
|
|
1700
|
-
const API$
|
|
1730
|
+
const API$h = createAxiosInstance({
|
|
1701
1731
|
env: "APP_TAGSAMURAI_API",
|
|
1702
1732
|
prefix: "/settings-attribute/v2/brands"
|
|
1703
1733
|
});
|
|
1704
1734
|
const BrandServices = {
|
|
1705
1735
|
getDropdown: (params) => {
|
|
1706
|
-
return API$
|
|
1707
|
-
}
|
|
1708
|
-
};
|
|
1709
|
-
const API$i = createAxiosInstance({
|
|
1710
|
-
prefix: "/v2",
|
|
1711
|
-
env: "APP_LOGS_NOTIFICATION_API"
|
|
1712
|
-
});
|
|
1713
|
-
const ChangelogServices = {
|
|
1714
|
-
getActionLog: (params) => {
|
|
1715
|
-
return API$i.get("/change-log", { params });
|
|
1716
|
-
},
|
|
1717
|
-
getActionLogOption: (params) => {
|
|
1718
|
-
return API$i.get("/change-log/options", { params });
|
|
1719
|
-
},
|
|
1720
|
-
getSessionLogList: (params) => {
|
|
1721
|
-
return API$i.get("/session-log", { params });
|
|
1722
|
-
},
|
|
1723
|
-
getUserDetailSystemLogList: (params) => {
|
|
1724
|
-
return API$i.get("/change-log", { params });
|
|
1725
|
-
},
|
|
1726
|
-
getUserDetailSystemLogOption: (params) => {
|
|
1727
|
-
return API$i.get("/change-log/options", { params });
|
|
1728
|
-
},
|
|
1729
|
-
/**
|
|
1730
|
-
* Retrieves the transaction log.
|
|
1731
|
-
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
1732
|
-
*/
|
|
1733
|
-
getTransactionLog: (params) => {
|
|
1734
|
-
return API$i.get("/transaction-log", { params });
|
|
1735
|
-
},
|
|
1736
|
-
/**
|
|
1737
|
-
* Retrieves the transaction log options.
|
|
1738
|
-
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
1739
|
-
*/
|
|
1740
|
-
getTransactionLogOption: (params) => {
|
|
1741
|
-
return API$i.get("/transaction-log/options", { params });
|
|
1742
|
-
},
|
|
1743
|
-
postScanLog: (body) => {
|
|
1744
|
-
return API$i.post("/transaction-log/scan-log", body);
|
|
1736
|
+
return API$h.get("/dropdown", { params });
|
|
1745
1737
|
}
|
|
1746
1738
|
};
|
|
1747
|
-
const API$
|
|
1739
|
+
const API$g = ({ headers = {}, params = {} } = {}) => {
|
|
1748
1740
|
const BASE_URL = getBaseURL("APP_COUNTRY_STATE_API");
|
|
1749
1741
|
const API_KEY = getBaseURL("APP_COUNTRY_STATE_API_KEY");
|
|
1750
1742
|
const instance = axios.create({
|
|
@@ -1760,28 +1752,28 @@ const API$h = ({ headers = {}, params = {} } = {}) => {
|
|
|
1760
1752
|
};
|
|
1761
1753
|
const CountryStateServices = {
|
|
1762
1754
|
getCountry: () => {
|
|
1763
|
-
return API$
|
|
1755
|
+
return API$g().get("/countries");
|
|
1764
1756
|
},
|
|
1765
1757
|
getState: (country) => {
|
|
1766
|
-
return API$
|
|
1758
|
+
return API$g().get(`/countries/${country}/states`);
|
|
1767
1759
|
},
|
|
1768
1760
|
getCity: (country, state) => {
|
|
1769
|
-
return API$
|
|
1761
|
+
return API$g().get(`/countries/${country}/states/${state}/cities`);
|
|
1770
1762
|
}
|
|
1771
1763
|
};
|
|
1772
|
-
const API$
|
|
1764
|
+
const API$f = createAxiosInstance({
|
|
1773
1765
|
env: "APP_TAGSAMURAI_API",
|
|
1774
1766
|
prefix: "/dashboard/v2/dashboard"
|
|
1775
1767
|
});
|
|
1776
1768
|
const DashboardServices = {
|
|
1777
1769
|
getLatestTask: (params) => {
|
|
1778
|
-
return API$
|
|
1770
|
+
return API$f.get("/latest-task", { params });
|
|
1779
1771
|
},
|
|
1780
1772
|
getSummary: (params) => {
|
|
1781
|
-
return API$
|
|
1773
|
+
return API$f.get("/summary", { params });
|
|
1782
1774
|
}
|
|
1783
1775
|
};
|
|
1784
|
-
const API$
|
|
1776
|
+
const API$e = createAxiosInstance({
|
|
1785
1777
|
env: "APP_GLOBAL_SETTINGS_API",
|
|
1786
1778
|
prefix: "/v1/global-settings/auth"
|
|
1787
1779
|
});
|
|
@@ -1798,37 +1790,37 @@ const onRejected = (error) => {
|
|
|
1798
1790
|
const AuthServices = {
|
|
1799
1791
|
login: (form) => {
|
|
1800
1792
|
const body = { ...form, isMobile: false };
|
|
1801
|
-
return API$
|
|
1793
|
+
return API$e.post("/login", body);
|
|
1802
1794
|
},
|
|
1803
1795
|
reLogin: (body) => {
|
|
1804
|
-
API$
|
|
1796
|
+
API$e.interceptors.response.use((response) => {
|
|
1805
1797
|
return response;
|
|
1806
1798
|
}, onRejected);
|
|
1807
|
-
return API$
|
|
1799
|
+
return API$e.post("/login", body);
|
|
1808
1800
|
},
|
|
1809
1801
|
requestOTP: (email) => {
|
|
1810
1802
|
const body = { email };
|
|
1811
|
-
return API$
|
|
1803
|
+
return API$e.post("/request-otp", body);
|
|
1812
1804
|
},
|
|
1813
1805
|
requestResetPassLink: (email) => {
|
|
1814
1806
|
const body = { email };
|
|
1815
|
-
return API$
|
|
1807
|
+
return API$e.post("/request-reset-link", body);
|
|
1816
1808
|
},
|
|
1817
1809
|
setPassword: (body) => {
|
|
1818
|
-
return API$
|
|
1810
|
+
return API$e.post("/set-password", body);
|
|
1819
1811
|
},
|
|
1820
1812
|
verifyToken: (token) => {
|
|
1821
|
-
return API$
|
|
1813
|
+
return API$e.get(`/verify-token/${token}`);
|
|
1822
1814
|
},
|
|
1823
1815
|
confirmEmailChange: (token) => {
|
|
1824
1816
|
const body = { token };
|
|
1825
|
-
return API$
|
|
1817
|
+
return API$e.put("/confirm-email-change/confirm", body);
|
|
1826
1818
|
},
|
|
1827
1819
|
postLogout: () => {
|
|
1828
|
-
return API$
|
|
1820
|
+
return API$e.post("/logout");
|
|
1829
1821
|
}
|
|
1830
1822
|
};
|
|
1831
|
-
const API$
|
|
1823
|
+
const API$d = createAxiosInstance({
|
|
1832
1824
|
env: "APP_ADMIN_API",
|
|
1833
1825
|
prefix: "/settings-attribute/languages"
|
|
1834
1826
|
});
|
|
@@ -1839,7 +1831,7 @@ const I18nService = {
|
|
|
1839
1831
|
* @returns A promise resolving to a key-value record of messages.
|
|
1840
1832
|
*/
|
|
1841
1833
|
getMessages: (isoCode) => {
|
|
1842
|
-
return API$
|
|
1834
|
+
return API$d.get(`/${isoCode}/translations`);
|
|
1843
1835
|
},
|
|
1844
1836
|
/**
|
|
1845
1837
|
* Fetch all available lang options for LanguageDropdown and LanguageSwitcher
|
|
@@ -1847,7 +1839,7 @@ const I18nService = {
|
|
|
1847
1839
|
* @returns Promise Array of options
|
|
1848
1840
|
*/
|
|
1849
1841
|
getLanguageOptions: async () => {
|
|
1850
|
-
const { data } = await API$
|
|
1842
|
+
const { data } = await API$d.get("/dropdown");
|
|
1851
1843
|
return data.data;
|
|
1852
1844
|
},
|
|
1853
1845
|
/**
|
|
@@ -1857,7 +1849,7 @@ const I18nService = {
|
|
|
1857
1849
|
* @returns Promise LanguageMeta
|
|
1858
1850
|
*/
|
|
1859
1851
|
getLanguageOptionMeta: async (isoCode) => {
|
|
1860
|
-
const { data } = await API$
|
|
1852
|
+
const { data } = await API$d.get(
|
|
1861
1853
|
"/dropdown/" + isoCode
|
|
1862
1854
|
);
|
|
1863
1855
|
return data.data;
|
|
@@ -1869,85 +1861,106 @@ const I18nService = {
|
|
|
1869
1861
|
* @param locale Target locale code.
|
|
1870
1862
|
*/
|
|
1871
1863
|
translateText: async (key, locale) => {
|
|
1872
|
-
const { data } = await API$
|
|
1864
|
+
const { data } = await API$d.post("/translate", {
|
|
1873
1865
|
q: key,
|
|
1874
1866
|
target: locale
|
|
1875
1867
|
});
|
|
1876
1868
|
return data.data.translations[key];
|
|
1877
1869
|
}
|
|
1878
1870
|
};
|
|
1879
|
-
const API$
|
|
1871
|
+
const API$c = createAxiosInstance({
|
|
1880
1872
|
env: "APP_TAGSAMURAI_API",
|
|
1881
1873
|
prefix: "/settings-attribute/v2/models"
|
|
1882
1874
|
});
|
|
1883
1875
|
const ModelTypeServices = {
|
|
1884
1876
|
getDropdown: (params) => {
|
|
1885
|
-
return API$
|
|
1877
|
+
return API$c.get("/dropdown", { params });
|
|
1886
1878
|
}
|
|
1887
1879
|
};
|
|
1888
|
-
const API$
|
|
1880
|
+
const API$b = createAxiosInstance({
|
|
1889
1881
|
prefix: "/v2",
|
|
1890
1882
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
1891
1883
|
});
|
|
1892
1884
|
const NotificationApprovalServices = {
|
|
1893
1885
|
getTotalApprovals: () => {
|
|
1894
|
-
return API$
|
|
1886
|
+
return API$b.get("/approval/count");
|
|
1895
1887
|
}
|
|
1896
1888
|
};
|
|
1897
|
-
const
|
|
1889
|
+
const ReaderAPI$1 = createAxiosInstance({
|
|
1898
1890
|
prefix: "/iot/v2/reader"
|
|
1899
1891
|
});
|
|
1892
|
+
const IOTAntennaAPI$1 = createAxiosInstance({
|
|
1893
|
+
prefix: "/iot/v2/iot/antenna"
|
|
1894
|
+
});
|
|
1895
|
+
const IOTReaderAPI$1 = createAxiosInstance({
|
|
1896
|
+
prefix: "/iot/v2/iot/reader"
|
|
1897
|
+
});
|
|
1900
1898
|
const ReaderServices = {
|
|
1899
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader
|
|
1901
1900
|
getIOTReaderList: (params) => {
|
|
1902
|
-
return
|
|
1901
|
+
return IOTReaderAPI$1.get("", { params: queryParamsStringfy(params) });
|
|
1903
1902
|
},
|
|
1903
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/options
|
|
1904
1904
|
getIOTReaderListOptions: (params) => {
|
|
1905
|
-
return
|
|
1905
|
+
return IOTReaderAPI$1.get("/options", { params });
|
|
1906
1906
|
},
|
|
1907
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/set-alias-name
|
|
1907
1908
|
setIOTAliasName: (body) => {
|
|
1908
|
-
return
|
|
1909
|
+
return IOTReaderAPI$1.put("/set-alias-name", body);
|
|
1909
1910
|
},
|
|
1911
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/ping
|
|
1910
1912
|
pingIOTSingle: (id) => {
|
|
1911
|
-
return
|
|
1913
|
+
return IOTReaderAPI$1.put(`/${id}/ping`);
|
|
1914
|
+
},
|
|
1915
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/ping/bulk
|
|
1916
|
+
pingIOTBulk: (body) => {
|
|
1917
|
+
return IOTReaderAPI$1.put("/ping/bulk", body);
|
|
1912
1918
|
},
|
|
1913
1919
|
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/set-antenna-power
|
|
1914
1920
|
setIOTAntennaPowerBulk: (id, body) => {
|
|
1915
|
-
return
|
|
1921
|
+
return IOTReaderAPI$1.put(`/${id}/set-antenna-power`, body);
|
|
1916
1922
|
},
|
|
1917
1923
|
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/ports
|
|
1918
1924
|
getIOTPortList: (id, params) => {
|
|
1919
|
-
return
|
|
1925
|
+
return IOTReaderAPI$1.get(`/${id}/ports`, { params });
|
|
1920
1926
|
},
|
|
1927
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id
|
|
1921
1928
|
getIOTDetail: (id) => {
|
|
1922
|
-
return
|
|
1929
|
+
return IOTReaderAPI$1.get(`/${id}`);
|
|
1923
1930
|
},
|
|
1924
1931
|
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/check-manager
|
|
1925
1932
|
getIOTCheckManager: () => {
|
|
1926
|
-
return
|
|
1933
|
+
return IOTReaderAPI$1.get("/check-manager");
|
|
1927
1934
|
},
|
|
1928
|
-
|
|
1929
|
-
|
|
1935
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/reader/:id
|
|
1936
|
+
updateReader: (id, body) => {
|
|
1937
|
+
return ReaderAPI$1.put(`/${id}`, body);
|
|
1930
1938
|
},
|
|
1931
|
-
|
|
1932
|
-
|
|
1939
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/set-status
|
|
1940
|
+
updateReaderStatus: (body) => {
|
|
1941
|
+
return IOTReaderAPI$1.put("/set-status", body);
|
|
1933
1942
|
},
|
|
1934
|
-
|
|
1935
|
-
|
|
1943
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/antenna/set-status
|
|
1944
|
+
updateAntennaStatus: (body) => {
|
|
1945
|
+
return IOTAntennaAPI$1.put("/set-status", body);
|
|
1936
1946
|
},
|
|
1937
|
-
|
|
1938
|
-
return
|
|
1947
|
+
setIOTPortGroup: (id, body) => {
|
|
1948
|
+
return IOTReaderAPI$1.put(`/${id}/set-port-group`, body);
|
|
1949
|
+
},
|
|
1950
|
+
setGroupIOT: (body) => {
|
|
1951
|
+
return IOTReaderAPI$1.put("/set-group", body);
|
|
1939
1952
|
},
|
|
1940
1953
|
getDataById: (id) => {
|
|
1941
|
-
return
|
|
1954
|
+
return IOTReaderAPI$1.get(`/${id}`);
|
|
1942
1955
|
},
|
|
1943
1956
|
getChangeLog: (params) => {
|
|
1944
|
-
return
|
|
1957
|
+
return IOTReaderAPI$1.get(`/${params.id}/change-log`, { params });
|
|
1945
1958
|
},
|
|
1946
1959
|
getChangeLogOptions: (params) => {
|
|
1947
|
-
return
|
|
1960
|
+
return IOTReaderAPI$1.get(`/${params.id}/change-log/options`, { params });
|
|
1948
1961
|
},
|
|
1949
1962
|
putData: (id, body) => {
|
|
1950
|
-
return
|
|
1963
|
+
return IOTReaderAPI$1.put(`/${id}`, body);
|
|
1951
1964
|
}
|
|
1952
1965
|
};
|
|
1953
1966
|
const API$a = createAxiosInstance({
|
|
@@ -2471,6 +2484,112 @@ const IOTServices = {
|
|
|
2471
2484
|
},
|
|
2472
2485
|
putIOTTracking: (body) => {
|
|
2473
2486
|
return API.put("/tracking", body);
|
|
2487
|
+
},
|
|
2488
|
+
getActivityLogData: (params) => {
|
|
2489
|
+
return API.get("/activity-log", { params });
|
|
2490
|
+
},
|
|
2491
|
+
getActivityLogOptions: (params) => {
|
|
2492
|
+
return API.get("/activity-log/options", { params });
|
|
2493
|
+
}
|
|
2494
|
+
};
|
|
2495
|
+
const ReaderAPI = createAxiosInstance({
|
|
2496
|
+
prefix: "/iot/v2/reader"
|
|
2497
|
+
});
|
|
2498
|
+
const IOTAntennaAPI = createAxiosInstance({
|
|
2499
|
+
prefix: "/iot/v2/iot/antenna"
|
|
2500
|
+
});
|
|
2501
|
+
const IOTReaderAPI = createAxiosInstance({
|
|
2502
|
+
prefix: "/iot/v2/iot/reader"
|
|
2503
|
+
});
|
|
2504
|
+
const IOTActivityLogAPI = createAxiosInstance({
|
|
2505
|
+
prefix: "/iot/v2/iot/activity-log"
|
|
2506
|
+
});
|
|
2507
|
+
const IOTService = {
|
|
2508
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/antenna
|
|
2509
|
+
getIOTAntennaList: (params) => {
|
|
2510
|
+
return IOTAntennaAPI.get("", { params: queryParamsStringfy(params) });
|
|
2511
|
+
},
|
|
2512
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/antenna/options
|
|
2513
|
+
getIOTAntennaListOptions: (params) => {
|
|
2514
|
+
return IOTAntennaAPI.get("/options", { params });
|
|
2515
|
+
},
|
|
2516
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/options
|
|
2517
|
+
getIOTReaderListOptions: (params) => {
|
|
2518
|
+
return IOTReaderAPI.get("/options", { params });
|
|
2519
|
+
},
|
|
2520
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader
|
|
2521
|
+
getIOTReaderList: (params) => {
|
|
2522
|
+
return IOTReaderAPI.get("", { params: queryParamsStringfy(params) });
|
|
2523
|
+
},
|
|
2524
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/activity-log
|
|
2525
|
+
getActivityLog: (params) => {
|
|
2526
|
+
return IOTActivityLogAPI.get("", { params });
|
|
2527
|
+
},
|
|
2528
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/activity-log/options
|
|
2529
|
+
getActivityLogOptions: (params) => {
|
|
2530
|
+
return IOTActivityLogAPI.get("/options", { params });
|
|
2531
|
+
},
|
|
2532
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/set-alias-name
|
|
2533
|
+
setIOTAliasName: (body) => {
|
|
2534
|
+
return IOTReaderAPI.put("/set-alias-name", body);
|
|
2535
|
+
},
|
|
2536
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/ping
|
|
2537
|
+
pingIOTSingle: (id) => {
|
|
2538
|
+
return IOTReaderAPI.put(`/${id}/ping`);
|
|
2539
|
+
},
|
|
2540
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/ping/bulk
|
|
2541
|
+
pingIOTBulk: (body) => {
|
|
2542
|
+
return IOTReaderAPI.put("/ping/bulk", body);
|
|
2543
|
+
},
|
|
2544
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/set-antenna-power
|
|
2545
|
+
setIOTAntennaPowerBulk: (id, body) => {
|
|
2546
|
+
return IOTReaderAPI.put(`/${id}/set-antenna-power`, body);
|
|
2547
|
+
},
|
|
2548
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/ports
|
|
2549
|
+
getIOTPortList: (id, params) => {
|
|
2550
|
+
return IOTReaderAPI.get(`/${id}/ports`, { params });
|
|
2551
|
+
},
|
|
2552
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id
|
|
2553
|
+
getIOTDetail: (id) => {
|
|
2554
|
+
return IOTReaderAPI.get(`/${id}`);
|
|
2555
|
+
},
|
|
2556
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/check-manager
|
|
2557
|
+
getIOTCheckManager: () => {
|
|
2558
|
+
return IOTReaderAPI.get("/check-manager");
|
|
2559
|
+
},
|
|
2560
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/reader/:id
|
|
2561
|
+
updateReader: (id, body) => {
|
|
2562
|
+
return ReaderAPI.put(`/${id}`, body);
|
|
2563
|
+
},
|
|
2564
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/set-status
|
|
2565
|
+
updateReaderStatus: (body) => {
|
|
2566
|
+
return IOTReaderAPI.put("/set-status", body);
|
|
2567
|
+
},
|
|
2568
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/antenna/set-status
|
|
2569
|
+
updateAntennaStatus: (body) => {
|
|
2570
|
+
return IOTAntennaAPI.put("/set-status", body);
|
|
2571
|
+
},
|
|
2572
|
+
setIOTPortGroup: (id, body) => {
|
|
2573
|
+
return IOTReaderAPI.put(`/${id}/set-port-group`, body);
|
|
2574
|
+
},
|
|
2575
|
+
//https://dev-api.tagsamurai.com/fam/iot/v2/iot/reader/:id/set-port-status
|
|
2576
|
+
setIOTPortStatus: (id, body) => {
|
|
2577
|
+
return IOTReaderAPI.put(`/${id}/set-port-status`, body);
|
|
2578
|
+
},
|
|
2579
|
+
setGroupIOT: (body) => {
|
|
2580
|
+
return IOTReaderAPI.put("/set-group", body);
|
|
2581
|
+
},
|
|
2582
|
+
getDataById: (id) => {
|
|
2583
|
+
return IOTReaderAPI.get(`/${id}`);
|
|
2584
|
+
},
|
|
2585
|
+
getChangeLog: (params) => {
|
|
2586
|
+
return IOTReaderAPI.get(`/${params.id}/change-log`, { params });
|
|
2587
|
+
},
|
|
2588
|
+
getChangeLogOptions: (params) => {
|
|
2589
|
+
return IOTReaderAPI.get(`/${params.id}/change-log/options`, { params });
|
|
2590
|
+
},
|
|
2591
|
+
putData: (id, body) => {
|
|
2592
|
+
return IOTReaderAPI.put(`/${id}`, body);
|
|
2474
2593
|
}
|
|
2475
2594
|
};
|
|
2476
2595
|
const ReportAPI = createAxiosInstance({
|
|
@@ -2613,10 +2732,12 @@ export {
|
|
|
2613
2732
|
IOTServices,
|
|
2614
2733
|
ImportServices,
|
|
2615
2734
|
LicenseServices,
|
|
2616
|
-
ChangelogServices
|
|
2735
|
+
ChangelogServices as LogServices,
|
|
2617
2736
|
MissingServices,
|
|
2618
2737
|
ModelTypeServices,
|
|
2619
2738
|
MyAssetServices,
|
|
2739
|
+
ChangelogServices as NewChangelogServices,
|
|
2740
|
+
IOTService as NewIOTServices,
|
|
2620
2741
|
NotificationApprovalServices,
|
|
2621
2742
|
NotificationServices,
|
|
2622
2743
|
DisposalServices as OldDisposalServices,
|
|
@@ -2637,6 +2758,9 @@ export {
|
|
|
2637
2758
|
TransactionSettingServices,
|
|
2638
2759
|
TransferServicesGo as TransferServices,
|
|
2639
2760
|
UserServices,
|
|
2761
|
+
buildFileURL,
|
|
2762
|
+
downloadFile,
|
|
2763
|
+
fetchBlobFile,
|
|
2640
2764
|
getAssetsFile,
|
|
2641
2765
|
getBaseURL,
|
|
2642
2766
|
getImageURL,
|