@tagsamurai/fats-api-services 1.0.0-alpha.23 → 1.0.0-alpha.231
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 +1374 -183
- package/api-services.system.js +1384 -1
- package/main.d.ts +39 -9
- package/package.json +6 -3
- package/src/dto/aliasCode.dto.d.ts +4 -0
- package/src/dto/assetDetail.dto.d.ts +91 -0
- package/src/dto/assetName.dto.d.ts +8 -0
- package/src/dto/assetPolicyService.dto.d.ts +19 -0
- package/src/dto/assetService.dto.d.ts +136 -0
- package/src/dto/assignment.dto.d.ts +81 -0
- package/src/dto/audit.dto.d.ts +14 -0
- package/src/dto/borrow.dto.d.ts +35 -0
- package/src/dto/customField.dto.d.ts +25 -0
- package/src/dto/damageService.dto.d.ts +23 -0
- package/src/dto/disposal.dto.d.ts +66 -0
- package/src/dto/fileManager.dto.d.ts +25 -0
- package/src/dto/globalAuth.dto.d.ts +18 -0
- package/src/dto/groupCategoryService.dto.d.ts +1 -1
- package/src/dto/importData.dto.d.ts +7 -0
- package/src/dto/importTemporaryData.dto.d.ts +6 -0
- package/src/dto/license.dto.d.ts +76 -0
- package/src/dto/log.dto.d.ts +11 -11
- package/src/dto/maintenanceRoutine.dto.d.ts +12 -0
- package/src/dto/missing.dto.d.ts +12 -0
- package/src/dto/myAsset.dro.d.ts +12 -0
- package/src/dto/notification.dto.d.ts +3 -1
- package/src/dto/oldBorrowService.dto.d.ts +102 -0
- package/src/dto/oldDamageService.dto.d.ts +7 -0
- package/src/dto/oldRepairService.dto.d.ts +29 -0
- package/src/dto/oldReportService.dto.d.ts +80 -0
- package/src/dto/oldTagService.dto.d.ts +59 -0
- package/src/dto/oldTrackingService.dto.d.ts +6 -0
- package/src/dto/oldTransferService.dto.d.ts +221 -0
- package/src/dto/openApi.dto.d.ts +3 -0
- package/src/dto/report.dto.d.ts +42 -0
- package/src/dto/role.dto.d.ts +50 -0
- package/src/dto/serviceCenter.dto.d.ts +22 -0
- package/src/dto/subUser.dto.d.ts +46 -0
- package/src/dto/transactionLog.dto.d.ts +17 -0
- package/src/dto/transfer.dto.d.ts +29 -0
- package/src/dto/user.dto.d.ts +126 -33
- package/src/services/aliasCode.service.d.ts +10 -0
- package/src/services/asset.service.d.ts +44 -0
- package/src/services/assetPolicy.service.d.ts +10 -0
- package/src/services/assignment.service.d.ts +15 -0
- package/src/services/borrow.service.d.ts +14 -0
- package/src/services/countryState.service.d.ts +7 -0
- package/src/services/customField.service.d.ts +22 -0
- package/src/services/damage.service.d.ts +13 -0
- package/src/services/damageService.type.d.ts +104 -0
- package/src/services/disposal.service.d.ts +18 -0
- package/src/services/fileManager.service.d.ts +53 -0
- package/src/services/generalSettings.service.d.ts +6 -0
- package/src/services/globalAuth.service.d.ts +27 -0
- package/src/services/groupCategory.service.d.ts +6 -3
- package/src/services/importData.service.d.ts +24 -0
- package/src/services/license.service.d.ts +23 -0
- package/src/services/log.service.d.ts +29 -0
- package/src/services/missing.service.d.ts +12 -0
- package/src/services/moduleAuth.service.d.ts +19 -0
- package/src/services/myAsset.service.d.ts +13 -0
- package/src/services/notification.service.d.ts +9 -0
- package/src/services/oldAsset.service.d.ts +38 -5
- package/src/services/oldAssetName.service.d.ts +14 -0
- package/src/services/oldAssignment.service.d.ts +84 -0
- package/src/services/oldAudit.service.d.ts +11 -0
- package/src/services/oldBorrow.service.d.ts +77 -0
- package/src/services/oldBrand.service.d.ts +7 -0
- package/src/services/oldDamage.service.d.ts +17 -0
- package/src/services/oldDisposal.service.d.ts +44 -0
- package/src/services/oldFileManager.service.d.ts +53 -0
- package/src/services/oldImportData.service.d.ts +22 -0
- package/src/services/oldLicense.service.d.ts +39 -0
- package/src/services/oldLog.service.d.ts +17 -0
- package/src/services/oldMaintenanceRoutine.service.d.ts +11 -0
- package/src/services/oldMissing.service.d.ts +12 -1
- package/src/services/oldModelType.service.d.ts +7 -0
- package/src/services/oldMyAsset.service.d.ts +7 -0
- package/src/services/oldOpenApi.service.d.ts +10 -0
- package/src/services/oldReader.service.d.ts +13 -0
- package/src/services/oldRepair.service.d.ts +10 -0
- package/src/services/oldReport.service.d.ts +31 -0
- package/src/services/oldRole.service.d.ts +56 -0
- package/src/services/oldServiceCenter.service.d.ts +19 -0
- package/src/services/oldSubUser.service.d.ts +15 -0
- package/src/services/oldTag.service.d.ts +25 -1
- package/src/services/oldTracking.service.d.ts +4 -0
- package/src/services/oldTransactionSetting.service.d.ts +21 -0
- package/src/services/oldTransfer.service.d.ts +30 -0
- package/src/services/oldUser.service.d.ts +28 -15
- package/src/services/openApi.service.d.ts +8 -0
- package/src/services/report.service.d.ts +32 -0
- package/src/services/role.service.d.ts +58 -0
- package/src/services/subUser.service.d.ts +17 -0
- package/src/services/transfer.service.d.ts +11 -0
- package/src/services/user.service.d.ts +42 -0
- package/src/types/aliasCode.type.d.ts +16 -0
- package/src/types/approval.type.d.ts +17 -0
- package/src/types/asset.type.d.ts +225 -0
- package/src/types/assetDetail.type.d.ts +120 -0
- package/src/types/assetPolicyService.type.d.ts +18 -0
- package/src/types/assignedAsset.type.d.ts +60 -0
- package/src/types/assignment.type.d.ts +318 -0
- package/src/types/audit.type.d.ts +13 -0
- package/src/types/borrow.type.d.ts +86 -0
- package/src/types/customField.type.d.ts +43 -0
- package/src/types/dataTable.type.d.ts +7 -0
- package/src/types/disposal/history.type.d.ts +51 -0
- package/src/types/disposal/prelist.type.d.ts +18 -0
- package/src/types/disposal/reported.type.d.ts +54 -0
- package/src/types/disposal/requestDisposal.type.d.ts +80 -0
- package/src/types/disposal/transaction.type.d.ts +62 -0
- package/src/types/disposal/user.type.d.ts +5 -0
- package/src/types/disposal.type.d.ts +1 -0
- package/src/types/fetchResponse.type.d.ts +4 -2
- package/src/types/fileManager.type.d.ts +24 -0
- package/src/types/groupCategoryData.type.d.ts +2 -7
- package/src/types/importData.type.d.ts +92 -0
- package/src/types/license.type.d.ts +43 -0
- package/src/types/licenseAddon.type.d.ts +35 -0
- package/src/types/licenseAllocation.type.d.ts +64 -0
- package/src/types/licenseAsset.type.d.ts +77 -0
- package/src/types/licenseConcurrent.type.d.ts +11 -0
- package/src/types/licensePurchased.type.d.ts +16 -0
- package/src/types/maintenanceRoutine.type.d.ts +10 -0
- package/src/types/myAsset.type.d.ts +65 -0
- package/src/types/notification.type.d.ts +17 -0
- package/src/types/oldBorrowingService.type.d.ts +549 -0
- package/src/types/oldTagService.type.d.ts +109 -0
- package/src/types/options.type.d.ts +6 -10
- package/src/types/reader.d.ts +55 -0
- package/src/types/role.type.d.ts +111 -6
- package/src/types/serviceCenter.type.d.ts +29 -0
- package/src/types/subUser.type.d.ts +28 -0
- package/src/types/transfer.type.d.ts +64 -0
- package/src/types/user.type.d.ts +43 -1
- package/src/types/userGlobalRole.type.d.ts +1 -1
- package/src/types/userGroupRole.type.d.ts +3 -2
- package/src/types/userTransactionRole.type.d.ts +3 -1
- package/src/utils/createInstance.util.d.ts +17 -0
- package/src/utils/getAssetsFile.util.d.ts +1 -0
- package/src/utils/index.d.ts +1 -0
- package/src/dto/oldAssetService.dto.d.ts +0 -26
- package/src/services/oldGroupCategory.service.d.ts +0 -14
- package/src/types/userSystemRole.type.d.ts +0 -14
package/api-services.es.js
CHANGED
|
@@ -1,186 +1,1099 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false, "VITE_APP_ADMIN_API": "https://dev-admin-api.tagsamurai.com", "VITE_APP_API": "https://dev-api.tagsamurai.com/fam", "VITE_APP_ASSETS_URL": "https://assets.tagsamurai.com", "VITE_APP_COUNTRY_STATE_API": "https://api.countrystatecity.in", "VITE_APP_COUNTRY_STATE_API_KEY": "ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==", "VITE_APP_GLOBAL_SETTINGS_API": "https://dev-api.global-settings.tagsamurai.com", "VITE_APP_LOGS_NOTIFICATION_API": "https://dev-api-logs-notification.tagsamurai.com", "VITE_APP_TAGSAMURAI_API": "https://dev-api.tagsamurai.com" };
|
|
3
|
+
const getBaseURL = (env = "APP_API") => {
|
|
4
|
+
return __vite_import_meta_env__["VITE_" + env];
|
|
5
|
+
};
|
|
6
|
+
const createAxiosInstance = (config = {}, useDifferentHeaders = false) => {
|
|
7
|
+
const { env = "APP_API", prefix = "", headers = {}, ...restConfig } = config;
|
|
8
|
+
const baseURL = `${getBaseURL(env)}${prefix}`;
|
|
9
|
+
const instance = axios.create({
|
|
10
|
+
...restConfig,
|
|
11
|
+
baseURL,
|
|
12
|
+
headers: useDifferentHeaders ? headers : {
|
|
8
13
|
"Content-Type": "application/json",
|
|
9
|
-
|
|
10
|
-
...p
|
|
14
|
+
...headers
|
|
11
15
|
}
|
|
12
16
|
});
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
instance.interceptors.request.use((request) => {
|
|
18
|
+
const user = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
19
|
+
const jwt = user.jwt ?? user.token ?? "";
|
|
20
|
+
request.headers["Authorization"] = `Bearer ${jwt}`;
|
|
21
|
+
return request;
|
|
22
|
+
});
|
|
23
|
+
return instance;
|
|
24
|
+
};
|
|
25
|
+
const queryParamsStringfy = (data) => {
|
|
26
|
+
if (!data || typeof data === "string") {
|
|
15
27
|
return;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
getSessionLogList: (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
28
|
+
}
|
|
29
|
+
const assignedData = {};
|
|
30
|
+
Object.keys(data).forEach((item) => {
|
|
31
|
+
if (Array.isArray(data[item])) {
|
|
32
|
+
if (data[item].length > 0) {
|
|
33
|
+
Object.assign(assignedData, {
|
|
34
|
+
[item]: JSON.stringify(data[item])
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
} else if (data[item] !== void 0) {
|
|
38
|
+
Object.assign(assignedData, {
|
|
39
|
+
[item]: data[item]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return assignedData;
|
|
44
|
+
};
|
|
45
|
+
const getImageURL$1 = (name, width, height) => {
|
|
46
|
+
if (!name) return;
|
|
47
|
+
const BASE_URL = getBaseURL("APP_API");
|
|
48
|
+
const filePath = name.startsWith("http") ? name : `${BASE_URL}/utility/v2/files/${name.replace(/^\/+/, "")}`;
|
|
49
|
+
if (width || height) {
|
|
50
|
+
const params = new URLSearchParams();
|
|
51
|
+
if (width) {
|
|
52
|
+
params.set("width", width.toString());
|
|
53
|
+
params.set("height", height ? height == null ? void 0 : height.toString() : width.toString());
|
|
54
|
+
}
|
|
55
|
+
return `${filePath}?${params.toString()}`;
|
|
56
|
+
}
|
|
57
|
+
return filePath;
|
|
58
|
+
};
|
|
59
|
+
const getImageURL = (name) => {
|
|
60
|
+
if (!name) return;
|
|
61
|
+
const BASE_URL = getBaseURL();
|
|
62
|
+
const filePath = name.startsWith("http") ? name : `${BASE_URL}/file-manager/v2/files/${name}`;
|
|
63
|
+
return filePath;
|
|
64
|
+
};
|
|
65
|
+
const getAssetsFile = async (file, type = "excel") => {
|
|
66
|
+
const response = await fetch(
|
|
67
|
+
`${getBaseURL("APP_ASSETS_URL")}/${type}/${file}`
|
|
68
|
+
);
|
|
69
|
+
return response;
|
|
70
|
+
};
|
|
71
|
+
const API$E = createAxiosInstance({
|
|
72
|
+
prefix: "/utility/v2"
|
|
73
|
+
});
|
|
74
|
+
const ChangelogServices$1 = {
|
|
75
|
+
getActionLog: (params) => {
|
|
76
|
+
return API$E.get("/change-log", { params });
|
|
77
|
+
},
|
|
78
|
+
getActionLogOption: (params) => {
|
|
79
|
+
return API$E.get("/change-log/options", { params });
|
|
80
|
+
},
|
|
81
|
+
getSessionLogList: (params) => {
|
|
82
|
+
return API$E.get("/session-log", { params });
|
|
83
|
+
},
|
|
84
|
+
getTransactionLog: (params) => {
|
|
85
|
+
return API$E.get("/transaction-log", { params });
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* Retrieves the transaction log options.
|
|
89
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
90
|
+
*/
|
|
91
|
+
getTransactionLogOption: (params) => {
|
|
92
|
+
return API$E.get("/transaction-log/options", { params });
|
|
93
|
+
},
|
|
94
|
+
getUserDetailSystemLogList: (params) => {
|
|
95
|
+
return API$E.get("/change-log", { params });
|
|
96
|
+
},
|
|
97
|
+
getUserDetailSystemLogOption: (params) => {
|
|
98
|
+
return API$E.get("/change-log/options", { params });
|
|
99
|
+
},
|
|
100
|
+
getUserDetailUserLogBorrowingList: (userId, params) => {
|
|
101
|
+
return API$E.get(`/borrowing-log/${userId}`, { params });
|
|
102
|
+
},
|
|
103
|
+
getUserDetailUserLogAssignmentList: (userId, params) => {
|
|
104
|
+
return API$E.get(`/assignment-log/${userId}`, { params });
|
|
105
|
+
},
|
|
106
|
+
getUserDetailUserLogBorrowingOption: (userId, params) => {
|
|
107
|
+
return API$E.get(`/borrowing-log/${userId}/options`, { params });
|
|
108
|
+
},
|
|
109
|
+
getUserDetailUserLogAssignmentOption: (userId, params) => {
|
|
110
|
+
return API$E.get(`/assignment-log/${userId}/options`, { params });
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const AssetsAPIs = createAxiosInstance({
|
|
73
114
|
prefix: "/assets/v2/assets"
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
getAllAssets: (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
};
|
|
89
|
-
|
|
115
|
+
});
|
|
116
|
+
const AssetServices = {
|
|
117
|
+
getAllAssets: (params) => {
|
|
118
|
+
return AssetsAPIs.get("/", { params });
|
|
119
|
+
},
|
|
120
|
+
getAllAssetsOptions: (params) => {
|
|
121
|
+
return AssetsAPIs.get("/options", { params });
|
|
122
|
+
},
|
|
123
|
+
getOptions: (endpoint, params) => {
|
|
124
|
+
return AssetsAPIs.get(endpoint ? `/${endpoint}/options` : "/options", {
|
|
125
|
+
params
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
getUnlinkedAssets: (params) => {
|
|
129
|
+
return AssetsAPIs.get("/unlinked", { params });
|
|
130
|
+
},
|
|
131
|
+
getAssetDetail: (id, params) => {
|
|
132
|
+
return AssetsAPIs.get(`/${id}`, { params });
|
|
133
|
+
},
|
|
134
|
+
getAssetNameTotal: () => {
|
|
135
|
+
return AssetsAPIs.get("/name-amount");
|
|
136
|
+
},
|
|
137
|
+
postRegisterAsset: (body) => {
|
|
138
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
139
|
+
return AssetsAPIs.post("", body, { headers });
|
|
140
|
+
},
|
|
141
|
+
putEditAsset: (id, body) => {
|
|
142
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
143
|
+
return AssetsAPIs.put(`/${id}`, body, { headers });
|
|
144
|
+
},
|
|
145
|
+
putEditDetailCustomField: (id, body) => {
|
|
146
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
147
|
+
return AssetsAPIs.put(`/${id}`, body, { headers });
|
|
148
|
+
},
|
|
149
|
+
getLinkedAsset: (assetId, params) => {
|
|
150
|
+
return AssetsAPIs.get(`/${assetId}/linked-assets`, { params });
|
|
151
|
+
},
|
|
152
|
+
getPurchase: (assetId) => {
|
|
153
|
+
return AssetsAPIs.get(`/${assetId}/purchase`);
|
|
154
|
+
},
|
|
155
|
+
putPurchase: (body, assetId) => {
|
|
156
|
+
return AssetsAPIs.put(`/${assetId}/purchase`, body);
|
|
157
|
+
},
|
|
158
|
+
getAccounting: (assetId, params) => {
|
|
159
|
+
return AssetsAPIs.get(`/${assetId}/accounting`, { params });
|
|
160
|
+
},
|
|
161
|
+
getLinkedAssetOption: (parentId, params) => {
|
|
162
|
+
return AssetsAPIs.get(`/${parentId}/linked-assets/options`, { params });
|
|
163
|
+
},
|
|
164
|
+
putLinkAsset: (body, parentId) => {
|
|
165
|
+
return AssetsAPIs.put(`/${parentId}/linked-assets`, body);
|
|
166
|
+
},
|
|
167
|
+
putUnlinkAsset: (body, parentId) => {
|
|
168
|
+
return AssetsAPIs.put(`/${parentId}/unlink-assets`, body);
|
|
169
|
+
},
|
|
170
|
+
putEditUsefulLife: (body) => {
|
|
171
|
+
return AssetsAPIs.put("/useful-life", body);
|
|
172
|
+
},
|
|
173
|
+
getAttachment: (assetId, params) => {
|
|
174
|
+
return AssetsAPIs.get(`/attachment/${assetId}`, { params });
|
|
175
|
+
},
|
|
176
|
+
postAttachment: (body, assetId) => {
|
|
177
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
178
|
+
return AssetsAPIs.post(`/attachment/${assetId}`, body, { headers });
|
|
179
|
+
},
|
|
180
|
+
putAttachment: (body, id) => {
|
|
181
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
182
|
+
return AssetsAPIs.put(`/attachment/${id}`, body, { headers });
|
|
183
|
+
},
|
|
184
|
+
/**
|
|
185
|
+
* Deletes the attachment with the given IDs.
|
|
186
|
+
* @param {object} params - The request params containing the IDs of the attachments to delete.
|
|
187
|
+
* @returns {Promise<AxiosResponse>}
|
|
188
|
+
*/
|
|
189
|
+
deleteAttachment: (params) => {
|
|
190
|
+
return AssetsAPIs.delete("/attachment/bulk", { params });
|
|
90
191
|
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
192
|
+
};
|
|
193
|
+
const API$D = createAxiosInstance({
|
|
194
|
+
prefix: "/missing-tracking/v2"
|
|
195
|
+
});
|
|
196
|
+
const MissingServices$1 = {
|
|
197
|
+
putFoundAsset: (body) => {
|
|
198
|
+
return API$D.put("/found", body);
|
|
199
|
+
},
|
|
200
|
+
putReportMissing: (id, body) => {
|
|
201
|
+
return API$D.put(`/${id}/report-missing`, body);
|
|
202
|
+
},
|
|
203
|
+
getData: (params) => {
|
|
204
|
+
return API$D.get("/", { params });
|
|
205
|
+
},
|
|
206
|
+
getDataOptions: (params) => {
|
|
207
|
+
return API$D.get("/options", { params });
|
|
208
|
+
},
|
|
209
|
+
getDetail: (id) => {
|
|
210
|
+
return API$D.get(`/${id}`);
|
|
97
211
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
})
|
|
108
|
-
postLogout: () => $.post("/logout")
|
|
109
|
-
}, c = n({
|
|
110
|
-
prefix: "/tag/v2"
|
|
111
|
-
}), G = {
|
|
112
|
-
getScanQR: (t) => c.get("/qr", { params: { tag: t } }),
|
|
113
|
-
getScanRFID: (t) => c.get("/rfid", { params: { tag: t } }),
|
|
114
|
-
getRFIDQRTAG: (t) => c.get("/rfid-qr/scan", { params: t })
|
|
115
|
-
}, y = n({
|
|
116
|
-
prefix: "/tracking/v2/tracking"
|
|
117
|
-
}), x = {
|
|
118
|
-
putFoundAsset: (t, e, r) => {
|
|
119
|
-
const a = {
|
|
120
|
-
tag: t,
|
|
121
|
-
group: e,
|
|
122
|
-
serialNumber: r,
|
|
123
|
-
type: "Global"
|
|
124
|
-
};
|
|
125
|
-
return y.put("/found", { params: a });
|
|
212
|
+
};
|
|
213
|
+
const API$C = createAxiosInstance({
|
|
214
|
+
prefix: "/utility/v2/notification"
|
|
215
|
+
});
|
|
216
|
+
const NotificationServices = {
|
|
217
|
+
getNotifications: (params) => {
|
|
218
|
+
return API$C.get("/", { params });
|
|
219
|
+
},
|
|
220
|
+
readNotification: (id) => {
|
|
221
|
+
return API$C.put(`/${id}`);
|
|
126
222
|
}
|
|
127
|
-
}
|
|
223
|
+
};
|
|
224
|
+
const API$B = createAxiosInstance({
|
|
128
225
|
prefix: "/settings-user-role/v2"
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
226
|
+
});
|
|
227
|
+
const UserServices = {
|
|
228
|
+
/**
|
|
229
|
+
* Retrieves the user list as dropdown options.
|
|
230
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
231
|
+
*/
|
|
232
|
+
getUserDropdown: (params) => {
|
|
233
|
+
return API$B.get("/users/dropdown", { params });
|
|
234
|
+
},
|
|
235
|
+
getUserOptions: (params) => {
|
|
236
|
+
return API$B.get("/users/options", { params });
|
|
237
|
+
},
|
|
238
|
+
getUserList: (params) => {
|
|
239
|
+
return API$B.get("/users", { params });
|
|
240
|
+
},
|
|
241
|
+
getUserDetail: (id) => {
|
|
242
|
+
return API$B.get(`/users/${id}`);
|
|
243
|
+
},
|
|
244
|
+
putSetActiveBulk: (data) => {
|
|
245
|
+
return API$B.put("/users/set-active-bulk", data);
|
|
246
|
+
},
|
|
247
|
+
// User Detail
|
|
142
248
|
/**
|
|
143
249
|
*
|
|
144
250
|
* @param id {string} User's _id
|
|
145
251
|
* @param type {"Global" | "Group"} Whether the system role's type is global or group
|
|
146
252
|
* @param params {Record<string, unknown>}
|
|
147
253
|
*/
|
|
148
|
-
getUserDetailSystemRoles: (
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
254
|
+
getUserDetailSystemRoles: (id, params, permissionType) => {
|
|
255
|
+
const additionalPath = permissionType ? `/${permissionType}/groups` : "";
|
|
256
|
+
return API$B.get(`/users/${id}/system-roles${additionalPath}`, {
|
|
257
|
+
params
|
|
258
|
+
});
|
|
259
|
+
},
|
|
260
|
+
getUserDetailTransactionRoleList: (id, params) => {
|
|
261
|
+
return API$B.get(`/users/${id}/transaction-roles`, { params });
|
|
262
|
+
},
|
|
263
|
+
postUserDetailAddTransactionRole: (userId, data) => {
|
|
264
|
+
return API$B.post(`/users/${userId}/add-transaction-role`, data);
|
|
265
|
+
},
|
|
266
|
+
deleteUserDetailTransactionRole: (userId, body) => {
|
|
267
|
+
return API$B.put(`/users/${userId}/delete-transaction-role`, body);
|
|
268
|
+
},
|
|
269
|
+
putUserDetailEditTransactionRole: (userId, data) => {
|
|
270
|
+
return API$B.put(`/users/${userId}/edit-transaction-role`, data);
|
|
271
|
+
},
|
|
272
|
+
putAssignGroup: (data, permissionType, id) => {
|
|
273
|
+
return API$B.put(`/users/${id}/system-roles/${permissionType}/groups`, data);
|
|
274
|
+
},
|
|
275
|
+
putRoleSetActive: (body, userId) => {
|
|
276
|
+
return API$B.put(`/users/${userId}/system-roles/set-active-bulk`, body);
|
|
277
|
+
},
|
|
278
|
+
getUserDetailTransactionAdminLogList: (userId, params) => {
|
|
279
|
+
return API$B.get(`/users/${userId}/transaction-log`, { params });
|
|
280
|
+
},
|
|
281
|
+
getUserDetailTransactionAdminLogOption: (userId, params) => {
|
|
282
|
+
return API$B.get(`/users/${userId}/transaction-log/option`, { params });
|
|
283
|
+
},
|
|
284
|
+
getUserDetailUserAssetBorrowedList: (userId, params) => {
|
|
285
|
+
return API$B.get(`/users/${userId}/borrowed-asset`, { params });
|
|
286
|
+
},
|
|
287
|
+
getUserDetailUserAssetAssignedList: (userId, params) => {
|
|
288
|
+
return API$B.get(`/users/${userId}/assigned-asset`, { params });
|
|
289
|
+
},
|
|
290
|
+
getUserDetailUserAssetBorrowedOption: (userId, params) => {
|
|
291
|
+
return API$B.get(`/users/${userId}/borrowed-asset/option`, { params });
|
|
292
|
+
},
|
|
293
|
+
getUserDetailUserAssetAssignedOption: (userId, params) => {
|
|
294
|
+
return API$B.get(`/users/${userId}/assigned-asset/option`, { params });
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
const API$A = createAxiosInstance({
|
|
298
|
+
prefix: "/settings-user-role/v2/users"
|
|
299
|
+
});
|
|
300
|
+
const SubUserServices = {
|
|
301
|
+
// Sub User
|
|
302
|
+
getSubUserList: (userId, params) => {
|
|
303
|
+
return API$A.get(`/${userId}/sub-users`, { params });
|
|
304
|
+
},
|
|
305
|
+
getSubUserOptions: (userId, params) => {
|
|
306
|
+
return API$A.get(`/${userId}/sub-users/option`, { params });
|
|
307
|
+
},
|
|
308
|
+
postCreateSubUser: (userId, data) => {
|
|
309
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
310
|
+
return API$A.post(`/${userId}/sub-users`, data, { headers });
|
|
311
|
+
},
|
|
312
|
+
putSubUserSetActiveBulk: (userId, data) => {
|
|
313
|
+
return API$A.put(`/${userId}/sub-users/set-active-bulk`, data);
|
|
314
|
+
},
|
|
315
|
+
deleteSubUser: (userId, subUserIds) => {
|
|
316
|
+
return API$A.put(`/${userId}/sub-users/bulk`, { subUserIds });
|
|
317
|
+
},
|
|
318
|
+
putEditSubUser: (userId, subUserId, data) => {
|
|
319
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
320
|
+
return API$A.put(`/${userId}/sub-users/${subUserId}`, data, {
|
|
321
|
+
headers
|
|
322
|
+
});
|
|
323
|
+
},
|
|
324
|
+
getBorrowedAsset: (userId, subUserId, params) => {
|
|
325
|
+
return API$A.get(`/${userId}/sub-users/${subUserId}/borrowed-asset`, {
|
|
326
|
+
params
|
|
327
|
+
});
|
|
328
|
+
},
|
|
329
|
+
getBorrowedAssetOptions: (userId, subUserId, params) => {
|
|
330
|
+
return API$A.get(`/${userId}/sub-users/${subUserId}/borrowed-asset/options`, {
|
|
331
|
+
params
|
|
332
|
+
});
|
|
333
|
+
},
|
|
334
|
+
getAssignedAsset: (userId, subUserId, params) => {
|
|
335
|
+
return API$A.get(`/${userId}/sub-users/${subUserId}/assigned-asset`, {
|
|
336
|
+
params
|
|
337
|
+
});
|
|
338
|
+
},
|
|
339
|
+
getAssignedAssetOptions: (userId, subUserId, params) => {
|
|
340
|
+
return API$A.get(`/${userId}/sub-users/${subUserId}/assigned-asset/options`, {
|
|
341
|
+
params
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
const API$z = createAxiosInstance({
|
|
346
|
+
prefix: "/utility/v2"
|
|
347
|
+
});
|
|
348
|
+
const FileManagerServices = {
|
|
349
|
+
/**
|
|
350
|
+
* Get storage information.
|
|
351
|
+
*
|
|
352
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
353
|
+
*/
|
|
354
|
+
getStorageInformation: () => {
|
|
355
|
+
return API$z.get("/files/storage");
|
|
356
|
+
},
|
|
357
|
+
/**
|
|
358
|
+
* Get file manager data.
|
|
359
|
+
*
|
|
360
|
+
* @param {FileType} type - The type of the file.
|
|
361
|
+
* @param {FileManagerFilterParams} [params] - The parameters for filtering.
|
|
362
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
363
|
+
*/
|
|
364
|
+
getFileManager: (type, params) => {
|
|
365
|
+
return API$z.get(`/${type}`, { params });
|
|
366
|
+
},
|
|
367
|
+
/**
|
|
368
|
+
* Get file manager options.
|
|
369
|
+
*
|
|
370
|
+
* @param {FileType} type - The type of the file.
|
|
371
|
+
* @param {FileManagerOptionBoolean} [params] - The parameters for options.
|
|
372
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
373
|
+
*/
|
|
374
|
+
getFileManagerOption: (type, params) => {
|
|
375
|
+
return API$z.get(`/${type}/options`, { params });
|
|
376
|
+
},
|
|
377
|
+
/**
|
|
378
|
+
* Recover files.
|
|
379
|
+
*
|
|
380
|
+
* @param {FileType} type - The type of the file.
|
|
381
|
+
* @param {object} body - The body of the request.
|
|
382
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
383
|
+
*/
|
|
384
|
+
recoverFiles: (type, body) => {
|
|
385
|
+
return API$z.put(`/${type}/recover`, body);
|
|
386
|
+
},
|
|
387
|
+
/**
|
|
388
|
+
* Delete files.
|
|
389
|
+
*
|
|
390
|
+
* @param {FileType} type - The type of the file.
|
|
391
|
+
* @param {DeleteFileManagerDto} params - The params of the request.
|
|
392
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
393
|
+
*/
|
|
394
|
+
deleteFiles: (type, params) => {
|
|
395
|
+
return API$z.delete(`/${type}`, { params });
|
|
396
|
+
},
|
|
397
|
+
/**
|
|
398
|
+
* Delete files permanently.
|
|
399
|
+
*
|
|
400
|
+
* @param {FileType} type - The type of the file.
|
|
401
|
+
* @param {object} body - The body of the request.
|
|
402
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
403
|
+
*/
|
|
404
|
+
deletePermanently: (type, params) => {
|
|
405
|
+
return API$z.delete(`/${type}/delete-permanent`, { params });
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
const API$y = createAxiosInstance({
|
|
409
|
+
prefix: "/settings-user-role/v2"
|
|
410
|
+
});
|
|
411
|
+
const RoleServices = {
|
|
412
|
+
/**
|
|
413
|
+
* Retrieves the transaction role for the given group and transaction name.
|
|
414
|
+
* @param {string} groupId - The ID of the group to retrieve the transaction role for.
|
|
415
|
+
* @param {string} transactionName - The name of the transaction to retrieve the role for.
|
|
416
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
417
|
+
*/
|
|
418
|
+
getTransactionRole: (groupId, transactionName) => {
|
|
419
|
+
return API$y.get(`/transaction-roles/${groupId}/${transactionName}`);
|
|
420
|
+
},
|
|
421
|
+
getTransactionRoleTypes: (groupKeys, transactionName) => {
|
|
422
|
+
return API$y.get(`/transaction-roles/${transactionName}/types`, {
|
|
423
|
+
params: { groupKeys }
|
|
424
|
+
});
|
|
425
|
+
},
|
|
426
|
+
/**
|
|
427
|
+
* Updates the users assigned to the given transaction role.
|
|
428
|
+
* @param {string} groupId - The ID of the group the transaction role belongs to.
|
|
429
|
+
* @param {string} transactionName - The name of the transaction to update.
|
|
430
|
+
* @param {UpdateUser} body - The request body containing the updated user information.
|
|
431
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
432
|
+
*/
|
|
433
|
+
putUpdateUsers: (groupId, transactionName, body) => {
|
|
434
|
+
return API$y.put(
|
|
435
|
+
`/transaction-roles/${groupId}/${transactionName}/update-user`,
|
|
436
|
+
body
|
|
437
|
+
);
|
|
438
|
+
},
|
|
439
|
+
/**
|
|
440
|
+
* Updates the approval level for the given transaction role.
|
|
441
|
+
* @param {string} groupId - The ID of the group the transaction role belongs to.
|
|
442
|
+
* @param {string} transactionName - The name of the transaction to update.
|
|
443
|
+
* @param {UserApprovalLevel} body - The request body containing the updated approval level.
|
|
444
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
445
|
+
*/
|
|
446
|
+
putUpdateLevel: (groupId, transactionName, body) => {
|
|
447
|
+
return API$y.put(
|
|
448
|
+
`/transaction-roles/${groupId}/${transactionName}/update-approval-level`,
|
|
449
|
+
body
|
|
450
|
+
);
|
|
451
|
+
},
|
|
452
|
+
/**
|
|
453
|
+
* Updates the group management settings for the given transaction role.
|
|
454
|
+
* @param {string} groupId - The ID of the group the transaction role belongs to.
|
|
455
|
+
* @param {string} transactionName - The name of the transaction to update.
|
|
456
|
+
* @param {GroupManageByParent} body - The request body containing the updated management settings.
|
|
457
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
458
|
+
*/
|
|
459
|
+
putUpdateGroupManage: (groupId, transactionName, body) => {
|
|
460
|
+
return API$y.put(
|
|
461
|
+
`/transaction-roles/${groupId}/${transactionName}/update-manage-by-parent`,
|
|
462
|
+
body
|
|
463
|
+
);
|
|
464
|
+
},
|
|
465
|
+
getUserAssignedSystemRole: (userId) => {
|
|
466
|
+
return API$y.get(`/system-roles/user/${userId}`);
|
|
467
|
+
},
|
|
468
|
+
getAssignedUserAmounts: () => {
|
|
469
|
+
return API$y.get("/system-roles/amounts");
|
|
470
|
+
},
|
|
471
|
+
getPermissionUser: (permissionType, params) => {
|
|
472
|
+
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
473
|
+
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
474
|
+
return API$y.get(`/system-roles/total-control-read-only/${type}`, {
|
|
475
|
+
params
|
|
476
|
+
});
|
|
152
477
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
478
|
+
return API$y.get(`/system-roles/permission/${permissionType}`, { params });
|
|
479
|
+
},
|
|
480
|
+
getPermissionUserOptions: (permissionType, params) => {
|
|
481
|
+
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
482
|
+
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
483
|
+
return API$y.get(`/system-roles/total-control-read-only/${type}/options`, {
|
|
484
|
+
params
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
return API$y.get(`/system-roles/permission/${permissionType}/options`, {
|
|
488
|
+
params
|
|
489
|
+
});
|
|
490
|
+
},
|
|
491
|
+
getUserGroups: (params, permissionType) => {
|
|
492
|
+
return API$y.get(`/system-roles/permission/${permissionType}/groups`, {
|
|
493
|
+
params
|
|
494
|
+
});
|
|
495
|
+
},
|
|
496
|
+
postAssignUser: (body, permissionType) => {
|
|
497
|
+
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
498
|
+
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
499
|
+
return API$y.post(`/system-roles/total-control-read-only/${type}`, body);
|
|
500
|
+
}
|
|
501
|
+
return API$y.post(`/system-roles/permission/${permissionType}`, body);
|
|
502
|
+
},
|
|
503
|
+
putEditUser: (body, roleId) => {
|
|
504
|
+
return API$y.put(`/system-roles/${roleId}`, body);
|
|
505
|
+
},
|
|
506
|
+
deleteRemoveUser: (body, permissionType) => {
|
|
507
|
+
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
508
|
+
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
509
|
+
return API$y.put(`/system-roles/total-control-read-only/${type}`, body);
|
|
510
|
+
}
|
|
511
|
+
return API$y.put("/system-roles", body);
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
const API$x = createAxiosInstance({
|
|
515
|
+
prefix: "/settings-attribute/v2/open-api"
|
|
516
|
+
});
|
|
517
|
+
const OpenAPIServices = {
|
|
518
|
+
putGenerateToken: () => {
|
|
519
|
+
return API$x.put("/generate");
|
|
520
|
+
},
|
|
521
|
+
// This is if the dummy was not dummy
|
|
522
|
+
getToken: () => {
|
|
523
|
+
return API$x.get("");
|
|
524
|
+
},
|
|
525
|
+
putRequestOpenAPI: () => {
|
|
526
|
+
return API$x.put("/request");
|
|
527
|
+
},
|
|
528
|
+
putCancelRequestOpenAPI: () => {
|
|
529
|
+
return API$x.put("/cancel-request");
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
const API$w = createAxiosInstance({
|
|
533
|
+
prefix: "/import/v2"
|
|
534
|
+
});
|
|
535
|
+
const ImportServices = {
|
|
536
|
+
getImport: (importUrl, params) => {
|
|
537
|
+
return API$w.get(`/${importUrl}`, { params });
|
|
538
|
+
},
|
|
539
|
+
postImportTemporary: (importUrl, data) => {
|
|
540
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
541
|
+
return API$w.post(`/${importUrl}/temporary`, data, { headers });
|
|
542
|
+
},
|
|
543
|
+
deleteImportTemporary: (importUrl, params) => {
|
|
544
|
+
return API$w.delete(`/${importUrl}/temporary`, { params });
|
|
545
|
+
},
|
|
546
|
+
postDuplicateImport: (importUrl, body) => {
|
|
547
|
+
return API$w.post(`/${importUrl}/duplicate`, body);
|
|
548
|
+
},
|
|
549
|
+
putEditImport: (importUrl, body) => {
|
|
550
|
+
return API$w.put(`/${importUrl}`, body);
|
|
551
|
+
},
|
|
552
|
+
postImport: (importUrl, controller, body) => {
|
|
553
|
+
return API$w.post(importUrl, body, { signal: controller.signal });
|
|
554
|
+
},
|
|
555
|
+
putImportCancelProgress: (importUrl) => {
|
|
556
|
+
return API$w.put(`/${importUrl}/cancel-progress`);
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
const API$v = createAxiosInstance({
|
|
560
|
+
prefix: "/assignment/v2"
|
|
561
|
+
});
|
|
562
|
+
const AssignmentServices = {
|
|
563
|
+
getTransactionData: (params) => {
|
|
564
|
+
return API$v.get("/transaction", { params });
|
|
565
|
+
},
|
|
566
|
+
getTransactionOptions: (params) => {
|
|
567
|
+
return API$v.get("/transaction/options", { params });
|
|
568
|
+
},
|
|
569
|
+
getDetailTransactionLog: (id) => {
|
|
570
|
+
return API$v.get(`/transaction/request/${id}/transaction-log`);
|
|
571
|
+
},
|
|
572
|
+
postTransaction: (body) => {
|
|
573
|
+
return API$v.post("/transaction", body);
|
|
574
|
+
},
|
|
575
|
+
putTransaction: (body) => {
|
|
576
|
+
return API$v.put("/transaction", body);
|
|
577
|
+
},
|
|
578
|
+
putUnassignTransaction: (body) => {
|
|
579
|
+
return API$v.put("/transaction/unassign", body);
|
|
580
|
+
},
|
|
581
|
+
putCancelReport: (body) => {
|
|
582
|
+
return API$v.put("/transaction/request/cancel-report", body);
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
const API$u = createAxiosInstance({
|
|
586
|
+
prefix: "/license/v2"
|
|
587
|
+
});
|
|
588
|
+
const TotalLicenseServices = {
|
|
589
|
+
getTotalLicense: () => {
|
|
590
|
+
return API$u.get("/total-license");
|
|
591
|
+
},
|
|
592
|
+
getPurchasedData: (params) => {
|
|
593
|
+
return API$u.get("/purchase", { params });
|
|
594
|
+
}
|
|
595
|
+
};
|
|
596
|
+
const LicenseConcurrentServices = {
|
|
597
|
+
getConcurrentUserData: () => {
|
|
598
|
+
return API$u.get("/concurrent-user-data");
|
|
599
|
+
},
|
|
600
|
+
getConcurrentUserList: (params) => {
|
|
601
|
+
return API$u.get("/concurrent-user", { params });
|
|
602
|
+
},
|
|
603
|
+
putLogoutUsers: (body) => {
|
|
604
|
+
return API$u.put("/concurrent-user", body);
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
const LicenseAssetServices = {
|
|
608
|
+
getFixedAssetPerGroup: (groupId, params) => {
|
|
609
|
+
return API$u.get(`/${groupId}/assets`, { params });
|
|
610
|
+
},
|
|
611
|
+
deleteAssetData: (body) => {
|
|
612
|
+
return API$u.delete("/assets", { data: body });
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
const LicenseServices = {
|
|
616
|
+
getFilterOptions: (path, params) => {
|
|
617
|
+
return API$u.get(`/${path}`, { params });
|
|
618
|
+
},
|
|
619
|
+
...TotalLicenseServices,
|
|
620
|
+
...LicenseConcurrentServices,
|
|
621
|
+
...LicenseAssetServices
|
|
622
|
+
};
|
|
623
|
+
const API$t = createAxiosInstance({
|
|
624
|
+
prefix: "/damage-repair-ticketing/v2"
|
|
625
|
+
});
|
|
626
|
+
const DamageServices = {
|
|
627
|
+
getDamageReportList: (params) => {
|
|
628
|
+
return API$t.get("/", { params });
|
|
629
|
+
},
|
|
630
|
+
getDamageReportListFilterOptions: (params) => {
|
|
631
|
+
return API$t.get("/options", { params });
|
|
632
|
+
},
|
|
633
|
+
getDamageReportDetail: (reportId) => {
|
|
634
|
+
return API$t.get(`/${reportId}`);
|
|
635
|
+
},
|
|
636
|
+
putReportDamage: (id, body) => {
|
|
637
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
638
|
+
return API$t.put(`/${id}/report-damage`, body, { headers });
|
|
639
|
+
},
|
|
640
|
+
putMarkAsRepaired: (body) => {
|
|
641
|
+
return API$t.put("/repair", body);
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
const API$s = createAxiosInstance({
|
|
645
|
+
prefix: "/assets/v2/my-assets"
|
|
646
|
+
});
|
|
647
|
+
const MyAssetServices = {
|
|
648
|
+
getAssigned: async (params) => {
|
|
649
|
+
return API$s.get("/assigned", { params });
|
|
650
|
+
},
|
|
651
|
+
getAssignedOptions: async (params) => {
|
|
652
|
+
return API$s.get("/assigned/options", { params });
|
|
653
|
+
},
|
|
654
|
+
getBorrowed: async (params) => {
|
|
655
|
+
return API$s.get("/borrowed", { params });
|
|
656
|
+
},
|
|
657
|
+
getBorrowedOptions: async (params) => {
|
|
658
|
+
return API$s.get("/borrowed/options", { params });
|
|
659
|
+
},
|
|
660
|
+
getHistory: async (params) => {
|
|
661
|
+
return API$s.get("/history", { params });
|
|
662
|
+
},
|
|
663
|
+
getHistoryOptions: async (params) => {
|
|
664
|
+
return API$s.get("/history/options", { params });
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
const API$r = createAxiosInstance({
|
|
668
|
+
prefix: "/transfer/v2"
|
|
669
|
+
});
|
|
670
|
+
const TransferServicesGo = {
|
|
671
|
+
getTransactionData: (params) => {
|
|
672
|
+
return API$r.get("/transaction", { params });
|
|
673
|
+
},
|
|
674
|
+
getTransactionOptions: (params) => {
|
|
675
|
+
return API$r.get("/transaction/options", { params });
|
|
676
|
+
},
|
|
677
|
+
getTransactionLog: (id) => {
|
|
678
|
+
return API$r.get(`/transaction/request/${id}/transaction-log`);
|
|
679
|
+
},
|
|
680
|
+
postCreateTransaction: (body) => {
|
|
681
|
+
return API$r.post("/transaction", body);
|
|
682
|
+
}
|
|
683
|
+
};
|
|
684
|
+
const API$q = createAxiosInstance({
|
|
685
|
+
prefix: "/borrowing/v2"
|
|
686
|
+
});
|
|
687
|
+
const BorrowServicesGo = {
|
|
688
|
+
getTransactions: async (params) => {
|
|
689
|
+
return API$q.get("/transaction", { params });
|
|
690
|
+
},
|
|
691
|
+
getTransactionOptions: async (params) => {
|
|
692
|
+
return API$q.get("/transaction/options", { params });
|
|
693
|
+
},
|
|
694
|
+
getTransactionLog: async (id) => {
|
|
695
|
+
return API$q.get(`/transaction/request/${id}/transaction-log`);
|
|
696
|
+
},
|
|
697
|
+
postTransaction: async (body) => {
|
|
698
|
+
return API$q.post("/transaction", body);
|
|
699
|
+
},
|
|
700
|
+
putTransaction: async (body) => {
|
|
701
|
+
return API$q.put("/transaction", body);
|
|
702
|
+
},
|
|
703
|
+
putTransactionReturn: async (requestIds) => {
|
|
704
|
+
const body = { id: requestIds };
|
|
705
|
+
return API$q.put("/transaction/return", body);
|
|
706
|
+
},
|
|
707
|
+
putCancelReport: async (requestIds) => {
|
|
708
|
+
const body = { id: requestIds };
|
|
709
|
+
return API$q.put("/transaction/request/cancel-report", body);
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
const API$p = createAxiosInstance({
|
|
713
|
+
prefix: "/disposal/v2/"
|
|
714
|
+
});
|
|
715
|
+
const DisposalServices = {
|
|
716
|
+
getReportedDisposal: (params) => {
|
|
717
|
+
return API$p.get("/report", { params });
|
|
718
|
+
},
|
|
719
|
+
getReportedDisposalOptions: (params) => {
|
|
720
|
+
return API$p.get("/report/options", { params });
|
|
721
|
+
},
|
|
722
|
+
postReportDisposal: (body) => {
|
|
723
|
+
return API$p.post("/report", body);
|
|
724
|
+
},
|
|
725
|
+
deleteCancelReport: (params) => {
|
|
726
|
+
params.isFromDisposal = "false";
|
|
727
|
+
return API$p.delete("/report/cancel-report", { params });
|
|
728
|
+
},
|
|
729
|
+
deleteDeclineReport: (params) => {
|
|
730
|
+
params.isFromDisposal = "true";
|
|
731
|
+
return API$p.delete("/report/cancel-report", { params });
|
|
732
|
+
},
|
|
733
|
+
getDisposalHistory: (params) => {
|
|
734
|
+
return API$p.get("/transaction", { params });
|
|
735
|
+
},
|
|
736
|
+
getHistoryByAssetOptions: (params) => {
|
|
737
|
+
return API$p.get("/transaction/options", { params });
|
|
738
|
+
},
|
|
739
|
+
getDisposalTransactionLog: (requestId) => {
|
|
740
|
+
return API$p.get(`/transaction/request/${requestId}/transaction-log`);
|
|
741
|
+
},
|
|
742
|
+
postCreateTransaction: (body) => {
|
|
743
|
+
return API$p.post("/transaction", body);
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
const API$o = createAxiosInstance({
|
|
747
|
+
prefix: "/report/v2/reports"
|
|
748
|
+
});
|
|
749
|
+
const ReportServices = {
|
|
750
|
+
getReportList: (params) => {
|
|
751
|
+
return API$o.get("/schedules", { params });
|
|
752
|
+
},
|
|
753
|
+
getReportSchedule: (scheduleId) => {
|
|
754
|
+
return API$o.get("/schedules/" + scheduleId);
|
|
755
|
+
},
|
|
756
|
+
getUniqueScheduleName: (name) => {
|
|
757
|
+
return API$o.get("/schedules/unique-name", { params: { name } });
|
|
758
|
+
},
|
|
759
|
+
getFilterOptions: (params) => {
|
|
760
|
+
return API$o.get("/schedules/options", { params });
|
|
761
|
+
},
|
|
762
|
+
putSetActive: (body) => {
|
|
763
|
+
return API$o.put("/schedules/set-active", body);
|
|
764
|
+
},
|
|
765
|
+
putEditSchedule: (id, body) => {
|
|
766
|
+
return API$o.put(`/schedules/${id}`, body);
|
|
767
|
+
},
|
|
768
|
+
deleteReports: (id) => {
|
|
769
|
+
return API$o.delete("/schedules", { params: { id } });
|
|
770
|
+
},
|
|
771
|
+
postCreateSchedule: (data) => {
|
|
772
|
+
return API$o.post("/schedules", data);
|
|
773
|
+
},
|
|
774
|
+
postDownloadReport: (data) => {
|
|
775
|
+
return API$o.post("/download", data, { responseType: "arraybuffer" });
|
|
776
|
+
},
|
|
777
|
+
postGenerateReport: (data) => {
|
|
778
|
+
return API$o.post("/generate", data);
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
const API$n = createAxiosInstance({
|
|
782
|
+
prefix: "/settings-attribute/v2"
|
|
783
|
+
});
|
|
784
|
+
const getEndpoint = (type) => {
|
|
785
|
+
return type === "category" ? "category" : "groups";
|
|
786
|
+
};
|
|
787
|
+
const GroupCategoryServices = {
|
|
788
|
+
getGroupCategory: (type, params) => {
|
|
789
|
+
return API$n.get(`/${getEndpoint(type)}/tree`, { params });
|
|
790
|
+
},
|
|
791
|
+
// Doesn't exist in company plan other than "Basic"
|
|
792
|
+
getGroupCategoryList: (type, groupId, params) => {
|
|
793
|
+
return API$n.get(`/${getEndpoint(type)}/${groupId}`, { params });
|
|
794
|
+
},
|
|
795
|
+
getNames: (type) => {
|
|
796
|
+
return API$n.get(`/${getEndpoint(type)}/names`);
|
|
797
|
+
},
|
|
798
|
+
getCodes: (type) => {
|
|
799
|
+
return API$n.get(`/${getEndpoint(type)}/codes`);
|
|
800
|
+
},
|
|
801
|
+
postCreateGroupCategory: (type, body) => {
|
|
802
|
+
return API$n.post(`/${getEndpoint(type)}`, body);
|
|
803
|
+
},
|
|
804
|
+
putEditGroupCategory: (type, body, objectId) => {
|
|
805
|
+
return API$n.put(`/${getEndpoint(type)}/${objectId}`, body);
|
|
806
|
+
},
|
|
807
|
+
// Doesn't exist in company plan other than "Enterprise"
|
|
808
|
+
putMoveGroup: (body, objectId) => {
|
|
809
|
+
return API$n.put(`/groups/${objectId}/move-group`, body);
|
|
810
|
+
},
|
|
811
|
+
// Doesn't exist in company plan other than "Enterprise"
|
|
812
|
+
putEditBulkGroups: async (body) => {
|
|
813
|
+
return API$n.put("/groups/bulk", body);
|
|
814
|
+
},
|
|
815
|
+
deleteGroupCategory: (type, body, objectId) => {
|
|
816
|
+
return API$n.delete(`/${getEndpoint(type)}/${objectId}`, { data: body });
|
|
817
|
+
}
|
|
818
|
+
};
|
|
819
|
+
const API$m = createAxiosInstance({
|
|
820
|
+
prefix: "/settings-attribute/v2/alias-code"
|
|
821
|
+
});
|
|
822
|
+
const AliasCodeServices = {
|
|
823
|
+
getAliasCode: () => {
|
|
824
|
+
return API$m.get("/");
|
|
825
|
+
},
|
|
826
|
+
postAliasCode: (data) => {
|
|
827
|
+
return API$m.post("/", data);
|
|
828
|
+
},
|
|
829
|
+
getAliasCodeList: (params) => {
|
|
830
|
+
return API$m.get(`/${params.object}/code-list`, { params });
|
|
831
|
+
}
|
|
832
|
+
};
|
|
833
|
+
const API$l = createAxiosInstance({
|
|
834
|
+
prefix: "/settings-attribute/v2/general-settings"
|
|
835
|
+
});
|
|
836
|
+
const GeneralSettingsServices = {
|
|
837
|
+
getGeneralSettings: () => {
|
|
838
|
+
return API$l.get("/");
|
|
839
|
+
},
|
|
840
|
+
putUpdateGeneralSettings: (data) => {
|
|
841
|
+
return API$l.put("/", data);
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
const API$k = createAxiosInstance({
|
|
845
|
+
prefix: "/settings-attribute/v2/custom-field"
|
|
846
|
+
});
|
|
847
|
+
const CustomFieldServices = {
|
|
848
|
+
getCustomField: async (params) => {
|
|
849
|
+
return API$k.get("/", { params });
|
|
850
|
+
},
|
|
851
|
+
getCustomFieldsByCategory: (category, params) => {
|
|
852
|
+
return API$k.get(`/${category}`, { params });
|
|
853
|
+
},
|
|
854
|
+
getOptions: async (params) => {
|
|
855
|
+
return API$k.get("/options", { params });
|
|
856
|
+
},
|
|
857
|
+
postCreateCustomField: async (params, data) => {
|
|
858
|
+
return API$k.post("/", data, { params });
|
|
859
|
+
},
|
|
860
|
+
putEditCustomField: async (params, data, id) => {
|
|
861
|
+
return API$k.put(`/${id}`, data, { params });
|
|
862
|
+
},
|
|
863
|
+
putChangeStatus: async (params, data) => {
|
|
864
|
+
return API$k.put("/bulk", data, { params });
|
|
865
|
+
},
|
|
866
|
+
deleteCustomField: async (params) => {
|
|
867
|
+
return API$k.delete("/bulk", { params });
|
|
868
|
+
},
|
|
869
|
+
getUsedCustomFields: async () => {
|
|
870
|
+
return API$k.get("/used-by-assets");
|
|
871
|
+
}
|
|
872
|
+
};
|
|
873
|
+
const API$j = createAxiosInstance({
|
|
874
|
+
prefix: "/settings-attribute/v2/asset-name-policy"
|
|
875
|
+
});
|
|
876
|
+
const AssetPolicyServices = {
|
|
877
|
+
getList: (params) => {
|
|
878
|
+
return API$j.get("/", { params });
|
|
879
|
+
},
|
|
880
|
+
getListFilterOptions: (params) => {
|
|
881
|
+
return API$j.get("/options");
|
|
882
|
+
},
|
|
883
|
+
putUpdatePolicy: (body) => {
|
|
884
|
+
return API$j.put("/", body);
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
const API$i = createAxiosInstance({
|
|
888
|
+
prefix: "/settings-user-role/v2/auth"
|
|
889
|
+
});
|
|
890
|
+
const onRejected$1 = (error) => {
|
|
891
|
+
var _a, _b, _c, _d;
|
|
892
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401 || ((_b = error.response) == null ? void 0 : _b.status) === 500 || ((_d = (_c = error.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message) === "jwt malformed") {
|
|
893
|
+
window.onblur = void 0;
|
|
894
|
+
window.onfocus = void 0;
|
|
895
|
+
window.sessionExpired = true;
|
|
896
|
+
return window.dispatchEvent(new CustomEvent("user:expired"));
|
|
897
|
+
}
|
|
898
|
+
return Promise.reject(error);
|
|
899
|
+
};
|
|
900
|
+
const AuthServices$1 = {
|
|
901
|
+
reLogin: (body) => {
|
|
902
|
+
API$i.interceptors.response.use((response) => {
|
|
903
|
+
return response;
|
|
904
|
+
}, onRejected$1);
|
|
905
|
+
return API$i.post("/login", body);
|
|
906
|
+
}
|
|
907
|
+
};
|
|
908
|
+
const API$h = createAxiosInstance({
|
|
909
|
+
prefix: "/settings-attribute/v2/asset-name"
|
|
910
|
+
});
|
|
911
|
+
const AssetNameServices = {
|
|
912
|
+
getDropdown: (params) => {
|
|
913
|
+
return API$h.get("/dropdown", { params });
|
|
914
|
+
},
|
|
915
|
+
getAssetNameDetail: (id) => {
|
|
916
|
+
return API$h.get(`/${id}`);
|
|
917
|
+
},
|
|
918
|
+
getAssetsByAssetName: (id, params) => {
|
|
919
|
+
return API$h.get(`/${id}/list-asset`, { params });
|
|
920
|
+
},
|
|
921
|
+
getAssetNameList: (params) => {
|
|
922
|
+
return API$h.get("/", { params });
|
|
923
|
+
},
|
|
924
|
+
getUnpairedAssetName: (params) => {
|
|
925
|
+
return API$h.get("/unpaired", { params });
|
|
926
|
+
},
|
|
927
|
+
getOptions: (params) => {
|
|
928
|
+
return API$h.get("/options", { params });
|
|
929
|
+
}
|
|
930
|
+
};
|
|
931
|
+
const API$g = createAxiosInstance({
|
|
932
|
+
prefix: "/audit/v2"
|
|
933
|
+
});
|
|
934
|
+
const AuditServices = {
|
|
935
|
+
getAudit: (assetId, params) => {
|
|
936
|
+
return API$g.get(`/audit/schedule/asset-detail/${assetId}`, { params });
|
|
937
|
+
},
|
|
938
|
+
getAuditOption: (assetId, params) => {
|
|
939
|
+
return API$g.get(`/audit/schedule/asset-detail/${assetId}/options`, {
|
|
940
|
+
params
|
|
941
|
+
});
|
|
942
|
+
},
|
|
943
|
+
putSetActive: (body) => {
|
|
944
|
+
return API$g.put("/audit/asset/activation", body);
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
const API$f = createAxiosInstance({
|
|
948
|
+
prefix: "/settings-attribute/v2/brands"
|
|
949
|
+
});
|
|
950
|
+
const BrandServices = {
|
|
951
|
+
getDropdown: (params) => {
|
|
952
|
+
return API$f.get("/dropdown", { params });
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
const API$e = createAxiosInstance({
|
|
956
|
+
prefix: "/v2",
|
|
957
|
+
env: "APP_LOGS_NOTIFICATION_API"
|
|
958
|
+
});
|
|
959
|
+
const ChangelogServices = {
|
|
960
|
+
getActionLog: (params) => {
|
|
961
|
+
return API$e.get("/change-log", { params });
|
|
962
|
+
},
|
|
963
|
+
getActionLogOption: (params) => {
|
|
964
|
+
return API$e.get("/change-log/options", { params });
|
|
965
|
+
},
|
|
966
|
+
getSessionLogList: (params) => {
|
|
967
|
+
return API$e.get("/session-log", { params });
|
|
968
|
+
},
|
|
969
|
+
getUserDetailSystemLogList: (params) => {
|
|
970
|
+
return API$e.get("/change-log", { params });
|
|
971
|
+
},
|
|
972
|
+
getUserDetailSystemLogOption: (params) => {
|
|
973
|
+
return API$e.get("/change-log/options", { params });
|
|
974
|
+
},
|
|
975
|
+
/**
|
|
976
|
+
* Retrieves the transaction log.
|
|
977
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
978
|
+
*/
|
|
979
|
+
getTransactionLog: (params) => {
|
|
980
|
+
return API$e.get("/transaction-log", { params });
|
|
981
|
+
},
|
|
982
|
+
/**
|
|
983
|
+
* Retrieves the transaction log options.
|
|
984
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
985
|
+
*/
|
|
986
|
+
getTransactionLogOption: (params) => {
|
|
987
|
+
return API$e.get("/transaction-log/options", { params });
|
|
988
|
+
},
|
|
989
|
+
postScanLog: (body) => {
|
|
990
|
+
return API$e.post("/transaction-log/scan-log", body);
|
|
991
|
+
}
|
|
992
|
+
};
|
|
993
|
+
const API$d = ({ headers = {}, params = {} } = {}) => {
|
|
994
|
+
const BASE_URL = getBaseURL("APP_COUNTRY_STATE_API");
|
|
995
|
+
const API_KEY = getBaseURL("APP_COUNTRY_STATE_API_KEY");
|
|
996
|
+
const instance = axios.create({
|
|
997
|
+
baseURL: `${BASE_URL}/v1`,
|
|
998
|
+
headers: {
|
|
999
|
+
"Content-type": "application/json",
|
|
1000
|
+
"X-CSCAPI-KEY": API_KEY,
|
|
1001
|
+
...headers
|
|
1002
|
+
},
|
|
1003
|
+
params
|
|
1004
|
+
});
|
|
1005
|
+
return instance;
|
|
1006
|
+
};
|
|
1007
|
+
const CountryStateServices = {
|
|
1008
|
+
getCountry: () => {
|
|
1009
|
+
return API$d().get("/countries");
|
|
1010
|
+
},
|
|
1011
|
+
getState: (country) => {
|
|
1012
|
+
return API$d().get(`/countries/${country}/states`);
|
|
1013
|
+
},
|
|
1014
|
+
getCity: (country, state) => {
|
|
1015
|
+
return API$d().get(`/countries/${country}/states/${state}/cities`);
|
|
1016
|
+
}
|
|
1017
|
+
};
|
|
1018
|
+
const API$c = createAxiosInstance({
|
|
1019
|
+
prefix: "/dashboard/v2/dashboard"
|
|
1020
|
+
});
|
|
1021
|
+
const DashboardServices = {
|
|
1022
|
+
getLatestTask: (params) => {
|
|
1023
|
+
return API$c.get("/latest-task", { params });
|
|
1024
|
+
},
|
|
1025
|
+
getSummary: (params) => {
|
|
1026
|
+
return API$c.get("/summary", { params });
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
const API$b = createAxiosInstance({
|
|
1030
|
+
env: "APP_GLOBAL_SETTINGS_API",
|
|
1031
|
+
prefix: "/v1/global-settings/auth"
|
|
1032
|
+
});
|
|
1033
|
+
const onRejected = (error) => {
|
|
1034
|
+
var _a, _b, _c, _d;
|
|
1035
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401 || ((_b = error.response) == null ? void 0 : _b.status) === 500 || ((_d = (_c = error.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message) === "jwt malformed") {
|
|
1036
|
+
window.onblur = void 0;
|
|
1037
|
+
window.onfocus = void 0;
|
|
1038
|
+
window.sessionExpired = true;
|
|
1039
|
+
return window.dispatchEvent(new CustomEvent("user:expired"));
|
|
1040
|
+
}
|
|
1041
|
+
return Promise.reject(error);
|
|
1042
|
+
};
|
|
1043
|
+
const AuthServices = {
|
|
1044
|
+
login: (form) => {
|
|
1045
|
+
const body = { ...form, isMobile: false };
|
|
1046
|
+
return API$b.post("/login", body);
|
|
1047
|
+
},
|
|
1048
|
+
reLogin: (body) => {
|
|
1049
|
+
API$b.interceptors.response.use((response) => {
|
|
1050
|
+
return response;
|
|
1051
|
+
}, onRejected);
|
|
1052
|
+
return API$b.post("/login", body);
|
|
1053
|
+
},
|
|
1054
|
+
requestOTP: (email) => {
|
|
1055
|
+
const body = { email };
|
|
1056
|
+
return API$b.post("/request-otp", body);
|
|
1057
|
+
},
|
|
1058
|
+
requestResetPassLink: (email) => {
|
|
1059
|
+
const body = { email };
|
|
1060
|
+
return API$b.post("/request-reset-link", body);
|
|
1061
|
+
},
|
|
1062
|
+
setPassword: (body) => {
|
|
1063
|
+
return API$b.post("/set-password", body);
|
|
1064
|
+
},
|
|
1065
|
+
verifyToken: (token) => {
|
|
1066
|
+
return API$b.get(`/verify-token/${token}`);
|
|
1067
|
+
},
|
|
1068
|
+
confirmEmailChange: (token) => {
|
|
1069
|
+
const body = { token };
|
|
1070
|
+
return API$b.put("/confirm-email-change/confirm", body);
|
|
1071
|
+
},
|
|
1072
|
+
postLogout: () => {
|
|
1073
|
+
return API$b.post("/logout");
|
|
1074
|
+
}
|
|
1075
|
+
};
|
|
1076
|
+
const API$a = createAxiosInstance({
|
|
165
1077
|
env: "APP_ADMIN_API",
|
|
166
1078
|
prefix: "/settings-attribute/languages"
|
|
167
|
-
})
|
|
1079
|
+
});
|
|
1080
|
+
const I18nService = {
|
|
168
1081
|
/**
|
|
169
1082
|
* Fetch all translation messages for a specific locale.
|
|
170
1083
|
* @param locale The locale code (e.g., 'en', 'id').
|
|
171
1084
|
* @returns A promise resolving to a key-value record of messages.
|
|
172
1085
|
*/
|
|
173
|
-
getMessages: (
|
|
1086
|
+
getMessages: (isoCode) => {
|
|
1087
|
+
return API$a.get(`/${isoCode}/translations`);
|
|
1088
|
+
},
|
|
174
1089
|
/**
|
|
175
1090
|
* Fetch all available lang options for LanguageDropdown and LanguageSwitcher
|
|
176
1091
|
*
|
|
177
1092
|
* @returns Promise Array of options
|
|
178
1093
|
*/
|
|
179
1094
|
getLanguageOptions: async () => {
|
|
180
|
-
const { data
|
|
181
|
-
|
|
182
|
-
);
|
|
183
|
-
return t.data;
|
|
1095
|
+
const { data } = await API$a.get("/dropdown");
|
|
1096
|
+
return data.data;
|
|
184
1097
|
},
|
|
185
1098
|
/**
|
|
186
1099
|
* Fetch single lang option meta data
|
|
@@ -188,11 +1101,11 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
188
1101
|
* @param isoCode The locale code (e.g., 'en', 'id').
|
|
189
1102
|
* @returns Promise LanguageMeta
|
|
190
1103
|
*/
|
|
191
|
-
getLanguageOptionMeta: async (
|
|
192
|
-
const { data
|
|
193
|
-
"/dropdown/" +
|
|
1104
|
+
getLanguageOptionMeta: async (isoCode) => {
|
|
1105
|
+
const { data } = await API$a.get(
|
|
1106
|
+
"/dropdown/" + isoCode
|
|
194
1107
|
);
|
|
195
|
-
return
|
|
1108
|
+
return data.data;
|
|
196
1109
|
},
|
|
197
1110
|
/**
|
|
198
1111
|
* Translate a specific text to the target locale.
|
|
@@ -200,33 +1113,311 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
200
1113
|
* @param key Unique translation key.
|
|
201
1114
|
* @param locale Target locale code.
|
|
202
1115
|
*/
|
|
203
|
-
translateText: async (
|
|
204
|
-
const { data
|
|
205
|
-
q:
|
|
206
|
-
target:
|
|
1116
|
+
translateText: async (key, locale) => {
|
|
1117
|
+
const { data } = await API$a.post("/translate", {
|
|
1118
|
+
q: key,
|
|
1119
|
+
target: locale
|
|
207
1120
|
});
|
|
208
|
-
return
|
|
1121
|
+
return data.data.translations[key];
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
const API$9 = createAxiosInstance({
|
|
1125
|
+
prefix: "/settings-attribute/v2/models"
|
|
1126
|
+
});
|
|
1127
|
+
const ModelTypeServices = {
|
|
1128
|
+
getDropdown: (params) => {
|
|
1129
|
+
return API$9.get("/dropdown", { params });
|
|
1130
|
+
}
|
|
1131
|
+
};
|
|
1132
|
+
const API$8 = createAxiosInstance({
|
|
1133
|
+
prefix: "/v2",
|
|
1134
|
+
env: "APP_LOGS_NOTIFICATION_API"
|
|
1135
|
+
});
|
|
1136
|
+
const NotificationApprovalServices = {
|
|
1137
|
+
getTotalApprovals: () => {
|
|
1138
|
+
return API$8.get("/approval/count");
|
|
1139
|
+
}
|
|
1140
|
+
};
|
|
1141
|
+
const API$7 = createAxiosInstance({
|
|
1142
|
+
prefix: "/iot/v2/reader"
|
|
1143
|
+
});
|
|
1144
|
+
const ReaderServices = {
|
|
1145
|
+
getData: (params) => {
|
|
1146
|
+
return API$7.get("/", { params });
|
|
1147
|
+
},
|
|
1148
|
+
getDataOptions: (params) => {
|
|
1149
|
+
return API$7.get("/options", { params });
|
|
1150
|
+
},
|
|
1151
|
+
getActivityLogData: (params) => {
|
|
1152
|
+
return API$7.get("/activity-log", { params });
|
|
1153
|
+
},
|
|
1154
|
+
getActivityLogOptions: (params) => {
|
|
1155
|
+
return API$7.get("/activity-log/options", { params });
|
|
1156
|
+
},
|
|
1157
|
+
getDataById: (id) => {
|
|
1158
|
+
return API$7.get(`/${id}`);
|
|
1159
|
+
},
|
|
1160
|
+
getChangeLog: (params) => {
|
|
1161
|
+
return API$7.get(`/${params.id}/change-log`, { params });
|
|
1162
|
+
},
|
|
1163
|
+
getChangeLogOptions: (params) => {
|
|
1164
|
+
return API$7.get(`/${params.id}/change-log/options`, { params });
|
|
1165
|
+
},
|
|
1166
|
+
putData: (id, body) => {
|
|
1167
|
+
return API$7.put(`/${id}`, body);
|
|
1168
|
+
}
|
|
1169
|
+
};
|
|
1170
|
+
const API$6 = createAxiosInstance({
|
|
1171
|
+
prefix: "/repair/v2"
|
|
1172
|
+
});
|
|
1173
|
+
const RepairServices = {
|
|
1174
|
+
getRepairList: (params) => {
|
|
1175
|
+
return API$6.get("/my-asset/repair", { params });
|
|
1176
|
+
},
|
|
1177
|
+
getFilterOptions: (params) => {
|
|
1178
|
+
return API$6.get("/my-asset/repair/options", { params });
|
|
1179
|
+
},
|
|
1180
|
+
getAssetRepairTicketing: (assetId, params) => {
|
|
1181
|
+
return API$6.get(`/repair/${assetId}/asset-repair-detail`, { params });
|
|
1182
|
+
},
|
|
1183
|
+
putConfirmRepair: (repairId) => {
|
|
1184
|
+
return API$6.put(`/repair/${repairId}/confirm-repair`);
|
|
1185
|
+
}
|
|
1186
|
+
};
|
|
1187
|
+
const API$5 = createAxiosInstance({
|
|
1188
|
+
prefix: "/routine/v2"
|
|
1189
|
+
});
|
|
1190
|
+
const RoutineServices = {
|
|
1191
|
+
getMaintenance: (assetId, params) => {
|
|
1192
|
+
return API$5.get(`/routine-task/${assetId}`, { params });
|
|
1193
|
+
},
|
|
1194
|
+
getMaintenanceOption: (assetId, params) => {
|
|
1195
|
+
return API$5.get(`/routine-task/${assetId}/options`, { params });
|
|
1196
|
+
},
|
|
1197
|
+
putSetActive: (body) => {
|
|
1198
|
+
return API$5.put("/maintenable-asset/set-active", body);
|
|
1199
|
+
}
|
|
1200
|
+
};
|
|
1201
|
+
const API$4 = createAxiosInstance({
|
|
1202
|
+
prefix: "/routine/v2"
|
|
1203
|
+
});
|
|
1204
|
+
const ServiceCenterServices = {
|
|
1205
|
+
getList: (params) => {
|
|
1206
|
+
return API$4.get("/service-center", { params });
|
|
1207
|
+
},
|
|
1208
|
+
postList: (body) => {
|
|
1209
|
+
return API$4.post("/service-center", body);
|
|
1210
|
+
},
|
|
1211
|
+
putList: (id, body) => {
|
|
1212
|
+
return API$4.put(`/service-center/${id}`, body);
|
|
1213
|
+
},
|
|
1214
|
+
putActivate: (body) => {
|
|
1215
|
+
return API$4.put("/service-center/bulk", body);
|
|
1216
|
+
},
|
|
1217
|
+
getDetailList: (id) => {
|
|
1218
|
+
return API$4.get(`/service-center/${id}`);
|
|
1219
|
+
},
|
|
1220
|
+
getListOptions: (params) => {
|
|
1221
|
+
return API$4.get("/service-center/options", { params });
|
|
1222
|
+
},
|
|
1223
|
+
deleteList: (params) => {
|
|
1224
|
+
return API$4.delete("/service-center", { params });
|
|
1225
|
+
},
|
|
1226
|
+
// Activities
|
|
1227
|
+
getActivities: (params) => {
|
|
1228
|
+
return API$4.get("/service-activities", { params });
|
|
1229
|
+
},
|
|
1230
|
+
getActivityOptions: (params) => {
|
|
1231
|
+
return API$4.get("/service-activities/options", { params });
|
|
1232
|
+
},
|
|
1233
|
+
getActivityDetail: (id) => {
|
|
1234
|
+
return API$4.get(`/service-activities/${id}`);
|
|
1235
|
+
},
|
|
1236
|
+
getActivityLog: (id) => {
|
|
1237
|
+
return API$4.get(`/service-activities/${id}/activity-log`);
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
const API$3 = createAxiosInstance({
|
|
1241
|
+
prefix: "/v2/session-log",
|
|
1242
|
+
env: "APP_LOGS_NOTIFICATION_API"
|
|
1243
|
+
});
|
|
1244
|
+
const SessionLogServices = {
|
|
1245
|
+
postLogout: () => {
|
|
1246
|
+
return API$3.post("/logout");
|
|
1247
|
+
}
|
|
1248
|
+
};
|
|
1249
|
+
const API$2 = createAxiosInstance({
|
|
1250
|
+
prefix: "/tag/v2"
|
|
1251
|
+
});
|
|
1252
|
+
const TAGServices = {
|
|
1253
|
+
getScanQR: (tag) => {
|
|
1254
|
+
return API$2.get("/qr", { params: { tag } });
|
|
1255
|
+
},
|
|
1256
|
+
getScanRFID: (tag) => {
|
|
1257
|
+
return API$2.get("/rfid", { params: { tag } });
|
|
1258
|
+
},
|
|
1259
|
+
getRFIDQRTAG: (params) => {
|
|
1260
|
+
return API$2.get("/rfid-qr/scan", { params });
|
|
1261
|
+
},
|
|
1262
|
+
getEventLog: (params) => {
|
|
1263
|
+
return API$2.get("/tag-transaction/event-log", { params });
|
|
1264
|
+
},
|
|
1265
|
+
// Tab All
|
|
1266
|
+
getRfidQrAll: (path, params) => {
|
|
1267
|
+
return API$2.get(`/${path}`, { params });
|
|
1268
|
+
},
|
|
1269
|
+
// Tab Paired
|
|
1270
|
+
getRfidQrPaired: (tagType, viewBy, params) => {
|
|
1271
|
+
return API$2.get(`/${tagType}/paired/${viewBy}`, { params });
|
|
1272
|
+
},
|
|
1273
|
+
postAddTAGtoPrelist: (body, destination) => {
|
|
1274
|
+
return API$2.post(`/prelist/${destination}/asset-name`, body);
|
|
1275
|
+
},
|
|
1276
|
+
postAddTAGtoReplacePrelist: (body) => {
|
|
1277
|
+
return API$2.post("/prelist/replace-tag", body);
|
|
1278
|
+
},
|
|
1279
|
+
postAddTAGToPrelistUnpair: (body) => {
|
|
1280
|
+
return API$2.post("/prelist/unpair-tag", body);
|
|
1281
|
+
},
|
|
1282
|
+
postAddTAGtoPending: (body) => {
|
|
1283
|
+
return API$2.post("/pending-changes", body);
|
|
1284
|
+
},
|
|
1285
|
+
// Available Tab
|
|
1286
|
+
getRFIDQrAvailable: (tagType, params) => {
|
|
1287
|
+
return API$2.get(`/${tagType}/available`, { params });
|
|
1288
|
+
},
|
|
1289
|
+
// Damaged TAB
|
|
1290
|
+
getRFIDQrDamaged: (tagType, params) => {
|
|
1291
|
+
return API$2.get(`/${tagType}/damaged`, { params });
|
|
1292
|
+
},
|
|
1293
|
+
// RFID and QR Module
|
|
1294
|
+
getRFIDandQRList: (params) => {
|
|
1295
|
+
return API$2.get("/rfid-qr", { params });
|
|
1296
|
+
},
|
|
1297
|
+
deleteUnpairTAG: (body) => {
|
|
1298
|
+
return API$2.delete("/rfid-qr", { data: { data: body } });
|
|
1299
|
+
},
|
|
1300
|
+
postPairTAG: (body) => {
|
|
1301
|
+
return API$2.post("/rfid-qr", { body: { data: body } });
|
|
1302
|
+
},
|
|
1303
|
+
// RFID To Be Returned
|
|
1304
|
+
getToBeReturnedTAGList: (params) => {
|
|
1305
|
+
return API$2.get("/rfid/to-be-returned", { params });
|
|
1306
|
+
},
|
|
1307
|
+
// Handover TAG
|
|
1308
|
+
putHandoverTAG: (body) => {
|
|
1309
|
+
return API$2.put("/rfid/handover", { body: { data: body } });
|
|
1310
|
+
},
|
|
1311
|
+
// Table Filter
|
|
1312
|
+
getFilterOptions: (path, params) => {
|
|
1313
|
+
return API$2.get(`/${path}/options`, { params });
|
|
1314
|
+
},
|
|
1315
|
+
getHolderListOptions: (params) => {
|
|
1316
|
+
return API$2.get("/rfid/holder-list/options", { params });
|
|
1317
|
+
},
|
|
1318
|
+
getHolderList: (params) => {
|
|
1319
|
+
return API$2.get("/rfid/holder-list", { params });
|
|
1320
|
+
},
|
|
1321
|
+
putAuditTAG: (body, tagType) => {
|
|
1322
|
+
return API$2.put(`/${tagType}/audit`, body);
|
|
1323
|
+
},
|
|
1324
|
+
postLogAudit: (body) => {
|
|
1325
|
+
return API$2.post("/tag-transaction/log-audit", body);
|
|
1326
|
+
},
|
|
1327
|
+
postCreateQr: (amount) => {
|
|
1328
|
+
const body = { amount };
|
|
1329
|
+
return API$2.post("/qr", body);
|
|
1330
|
+
},
|
|
1331
|
+
putReportTAG: (id, body) => {
|
|
1332
|
+
return API$2.put(`/tag-transaction/report/${id}`, body);
|
|
1333
|
+
},
|
|
1334
|
+
putReportTAGBulk: (body) => {
|
|
1335
|
+
return API$2.put("/tag-transaction/report/bulk", body);
|
|
1336
|
+
},
|
|
1337
|
+
putDeclineReport: (body, tagType) => {
|
|
1338
|
+
return API$2.put(`/report/decline-report/${tagType}`, body);
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
const API$1 = createAxiosInstance({
|
|
1342
|
+
prefix: "/tracking/v2/tracking"
|
|
1343
|
+
});
|
|
1344
|
+
const MissingServices = {
|
|
1345
|
+
getTrackingDetail: (trackingId) => {
|
|
1346
|
+
return API$1.get(`/${trackingId}`);
|
|
1347
|
+
},
|
|
1348
|
+
putFoundAsset: (tag, groupId, serialNumber) => {
|
|
1349
|
+
const params = {
|
|
1350
|
+
tag,
|
|
1351
|
+
group: groupId,
|
|
1352
|
+
serialNumber,
|
|
1353
|
+
type: "Global"
|
|
1354
|
+
};
|
|
1355
|
+
return API$1.put("/scan", void 0, { params });
|
|
1356
|
+
},
|
|
1357
|
+
putReportPermanentlyMissing: (trackingId, body) => {
|
|
1358
|
+
return API$1.put(`/report-permanently-missing/${trackingId}`, body);
|
|
1359
|
+
},
|
|
1360
|
+
putMoveBack: (body) => {
|
|
1361
|
+
return API$1.put("/tracking/move-back", body);
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1364
|
+
const API = createAxiosInstance({
|
|
1365
|
+
prefix: "/settings-attribute/v2/transaction-settings"
|
|
1366
|
+
});
|
|
1367
|
+
const TransactionSettingServices = {
|
|
1368
|
+
getData: () => {
|
|
1369
|
+
return API.get("/");
|
|
1370
|
+
},
|
|
1371
|
+
putData: (data) => {
|
|
1372
|
+
return API.put("/", data);
|
|
209
1373
|
}
|
|
210
|
-
}, P = n({
|
|
211
|
-
prefix: "/dashboard/v2/dashboard"
|
|
212
|
-
}), F = {
|
|
213
|
-
getLatestTask: (t) => P.get("/latest-task", { params: t }),
|
|
214
|
-
getSummary: (t) => P.get("/summary", { params: t })
|
|
215
1374
|
};
|
|
216
1375
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
1376
|
+
AliasCodeServices,
|
|
1377
|
+
AssetNameServices,
|
|
1378
|
+
AssetPolicyServices,
|
|
1379
|
+
AssetServices,
|
|
1380
|
+
AssignmentServices,
|
|
1381
|
+
AuditServices,
|
|
1382
|
+
AuthServices$1 as AuthServices,
|
|
1383
|
+
BorrowServicesGo as BorrowServices,
|
|
1384
|
+
BrandServices,
|
|
1385
|
+
ChangelogServices,
|
|
1386
|
+
CountryStateServices,
|
|
1387
|
+
CustomFieldServices,
|
|
1388
|
+
DamageServices,
|
|
1389
|
+
DashboardServices,
|
|
1390
|
+
DisposalServices,
|
|
1391
|
+
FileManagerServices,
|
|
1392
|
+
GeneralSettingsServices,
|
|
1393
|
+
AuthServices as GlobalAuthServices,
|
|
1394
|
+
GroupCategoryServices,
|
|
1395
|
+
I18nService,
|
|
1396
|
+
ImportServices,
|
|
1397
|
+
LicenseServices,
|
|
1398
|
+
ChangelogServices$1 as LogServices,
|
|
1399
|
+
MissingServices$1 as MissingServices,
|
|
1400
|
+
ModelTypeServices,
|
|
1401
|
+
MyAssetServices,
|
|
1402
|
+
NotificationApprovalServices,
|
|
1403
|
+
NotificationServices,
|
|
1404
|
+
OpenAPIServices,
|
|
1405
|
+
ReaderServices,
|
|
1406
|
+
RepairServices,
|
|
1407
|
+
ReportServices,
|
|
1408
|
+
RoleServices,
|
|
1409
|
+
RoutineServices,
|
|
1410
|
+
ServiceCenterServices,
|
|
1411
|
+
SessionLogServices,
|
|
1412
|
+
SubUserServices,
|
|
1413
|
+
TAGServices,
|
|
1414
|
+
MissingServices as TrackingServices,
|
|
1415
|
+
TransactionSettingServices,
|
|
1416
|
+
TransferServicesGo as TransferServices,
|
|
1417
|
+
UserServices,
|
|
1418
|
+
getAssetsFile,
|
|
1419
|
+
getBaseURL,
|
|
1420
|
+
getImageURL,
|
|
1421
|
+
getImageURL$1 as getImageURLGo,
|
|
1422
|
+
queryParamsStringfy
|
|
232
1423
|
};
|