@tagsamurai/fats-api-services 1.0.0-alpha.22 → 1.0.0-alpha.220
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 +2673 -167
- package/api-services.system.js +2678 -1
- package/main.d.ts +52 -1
- package/package.json +6 -3
- package/src/constants/serverPrefixMap.d.ts +11 -0
- 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 +16 -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/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 +1 -0
- 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/oldAliasCode.service.d.ts +10 -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/oldCustomField.service.d.ts +29 -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/oldGeneralSettings.service.d.ts +6 -0
- package/src/services/oldGroupCategory.service.d.ts +1 -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/oldAssetService.type.d.ts +58 -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 +20 -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/types/userSystemRole.type.d.ts +0 -14
package/api-services.es.js
CHANGED
|
@@ -1,186 +1,892 @@
|
|
|
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", "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" };
|
|
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 SERVER_PREFIX = {
|
|
26
|
+
SETTINGS_ATTRIBUTES: "settings-attribute"
|
|
27
|
+
};
|
|
28
|
+
const queryParamsStringfy = (data) => {
|
|
29
|
+
if (!data || typeof data === "string") {
|
|
15
30
|
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
|
-
}
|
|
31
|
+
}
|
|
32
|
+
const assignedData = {};
|
|
33
|
+
Object.keys(data).forEach((item) => {
|
|
34
|
+
if (Array.isArray(data[item])) {
|
|
35
|
+
if (data[item].length > 0) {
|
|
36
|
+
Object.assign(assignedData, {
|
|
37
|
+
[item]: JSON.stringify(data[item])
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
} else if (data[item] !== void 0) {
|
|
41
|
+
Object.assign(assignedData, {
|
|
42
|
+
[item]: data[item]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return assignedData;
|
|
47
|
+
};
|
|
48
|
+
const getImageURL$1 = (name, width, height) => {
|
|
49
|
+
if (!name) return;
|
|
50
|
+
const BASE_URL = getBaseURL("APP_API");
|
|
51
|
+
const filePath = name.startsWith("http") ? name : `${BASE_URL}/utility/v2/files/${name.replace(/^\/+/, "")}`;
|
|
52
|
+
if (width || height) {
|
|
53
|
+
const params = new URLSearchParams();
|
|
54
|
+
if (width) {
|
|
55
|
+
params.set("width", width.toString());
|
|
56
|
+
params.set("height", height ? height == null ? void 0 : height.toString() : width.toString());
|
|
57
|
+
}
|
|
58
|
+
return `${filePath}?${params.toString()}`;
|
|
59
|
+
}
|
|
60
|
+
return filePath;
|
|
61
|
+
};
|
|
62
|
+
const getImageURL = (name) => {
|
|
63
|
+
if (!name) return;
|
|
64
|
+
const BASE_URL = getBaseURL();
|
|
65
|
+
const filePath = name.startsWith("http") ? name : `${BASE_URL}/file-manager/v2/files/${name}`;
|
|
66
|
+
return filePath;
|
|
67
|
+
};
|
|
68
|
+
const getAssetsFile = async (file, type = "excel") => {
|
|
69
|
+
const response = await fetch(
|
|
70
|
+
`${getBaseURL("APP_ASSETS_URL")}/${type}/${file}`
|
|
71
|
+
);
|
|
72
|
+
return response;
|
|
73
|
+
};
|
|
74
|
+
const API$W = createAxiosInstance({
|
|
75
|
+
prefix: "/settings-attribute/v2"
|
|
76
|
+
});
|
|
77
|
+
const GroupCategoryServices$1 = {
|
|
78
|
+
getGroupCategory: (type, params) => {
|
|
79
|
+
const endpoint = type === "category" ? type : "groups";
|
|
80
|
+
return API$W.get(`/${endpoint}/tree`, { params });
|
|
81
|
+
},
|
|
82
|
+
getGroupCategoryList: (type, groupId, params) => {
|
|
83
|
+
const endpoint = type === "category" ? type : "groups";
|
|
84
|
+
return API$W.get(`/${endpoint}/${groupId}`, { params });
|
|
85
|
+
},
|
|
86
|
+
getNames: (type) => {
|
|
87
|
+
const endpoint = type === "category" ? type : "groups";
|
|
88
|
+
return API$W.get(`/${endpoint}/names`);
|
|
89
|
+
},
|
|
90
|
+
getCodes: (type) => {
|
|
91
|
+
const endpoint = type === "category" ? type : "groups";
|
|
92
|
+
return API$W.get(`/${endpoint}/codes`);
|
|
93
|
+
},
|
|
94
|
+
postCreateGroupCategory: (type, body) => {
|
|
95
|
+
const endpoint = type === "category" ? type : "groups";
|
|
96
|
+
return API$W.post(`/${endpoint}`, body);
|
|
97
|
+
},
|
|
98
|
+
putEditGroupCategory: (type, body, objectId) => {
|
|
99
|
+
const endpoint = type === "category" ? type : "groups";
|
|
100
|
+
return API$W.put(`/${endpoint}/${objectId}`, body);
|
|
101
|
+
},
|
|
102
|
+
putMoveGroup: (body, objectId) => {
|
|
103
|
+
return API$W.put(`/groups/${objectId}/move-group`, body);
|
|
104
|
+
},
|
|
105
|
+
putEditBulkGroups: async (body) => {
|
|
106
|
+
return API$W.put("/groups/bulk", body);
|
|
107
|
+
},
|
|
108
|
+
deleteGroupCategory: (type, body, objectId) => {
|
|
109
|
+
const endpoint = type === "category" ? type : "groups";
|
|
110
|
+
return API$W.delete(`/${endpoint}/${objectId}`, { data: body });
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const API$V = createAxiosInstance({
|
|
114
|
+
prefix: "/settings-attribute-go/v2"
|
|
115
|
+
});
|
|
116
|
+
const GroupCategoryServices = {
|
|
117
|
+
getGroupCategory: (type, params) => {
|
|
118
|
+
const endpoint = type === "category" ? type : "groups";
|
|
119
|
+
return API$V.get(`/${endpoint}/tree`, { params });
|
|
120
|
+
},
|
|
121
|
+
getGroupCategoryList: (type, groupId) => {
|
|
122
|
+
const endpoint = type === "category" ? type : "groups";
|
|
123
|
+
return API$V.get(`/${endpoint}/${groupId}`);
|
|
124
|
+
},
|
|
125
|
+
getNames: (type) => {
|
|
126
|
+
const endpoint = type === "category" ? type : "groups";
|
|
127
|
+
return API$V.get(`/${endpoint}/names`);
|
|
128
|
+
},
|
|
129
|
+
getCodes: (type) => {
|
|
130
|
+
const endpoint = type === "category" ? type : "groups";
|
|
131
|
+
return API$V.get(`/${endpoint}/codes`);
|
|
132
|
+
},
|
|
133
|
+
postCreateGroupCategory: (type, body) => {
|
|
134
|
+
const endpoint = type === "category" ? type : "groups";
|
|
135
|
+
return API$V.post(`/${endpoint}`, body);
|
|
136
|
+
},
|
|
137
|
+
putEditGroupCategory: (type, body, objectId) => {
|
|
138
|
+
const endpoint = type === "category" ? type : "groups";
|
|
139
|
+
return API$V.put(`/${endpoint}/${objectId}`, body);
|
|
140
|
+
},
|
|
141
|
+
deleteGroupCategory: (type, body, objectId) => {
|
|
142
|
+
const endpoint = type === "category" ? type : "groups";
|
|
143
|
+
return API$V.delete(`/${endpoint}/${objectId}`, { data: body });
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
const API$U = createAxiosInstance({
|
|
59
147
|
prefix: "/v2",
|
|
60
148
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
149
|
+
});
|
|
150
|
+
const NotificationApprovalServices = {
|
|
151
|
+
getTotalApprovals: () => {
|
|
152
|
+
return API$U.get("/approval/count");
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const API$T = createAxiosInstance({
|
|
64
156
|
prefix: "/v2",
|
|
65
157
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
158
|
+
});
|
|
159
|
+
const ChangelogServices$1 = {
|
|
160
|
+
getActionLog: (params) => {
|
|
161
|
+
return API$T.get("/change-log", { params });
|
|
162
|
+
},
|
|
163
|
+
getActionLogOption: (params) => {
|
|
164
|
+
return API$T.get("/change-log/options", { params });
|
|
165
|
+
},
|
|
166
|
+
getSessionLogList: (params) => {
|
|
167
|
+
return API$T.get("/session-log", { params });
|
|
168
|
+
},
|
|
169
|
+
getUserDetailSystemLogList: (params) => {
|
|
170
|
+
return API$T.get("/change-log", { params });
|
|
171
|
+
},
|
|
172
|
+
getUserDetailSystemLogOption: (params) => {
|
|
173
|
+
return API$T.get("/change-log/options", { params });
|
|
174
|
+
},
|
|
175
|
+
/**
|
|
176
|
+
* Retrieves the transaction log.
|
|
177
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
178
|
+
*/
|
|
179
|
+
getTransactionLog: (params) => {
|
|
180
|
+
return API$T.get("/transaction-log", { params });
|
|
181
|
+
},
|
|
182
|
+
/**
|
|
183
|
+
* Retrieves the transaction log options.
|
|
184
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
185
|
+
*/
|
|
186
|
+
getTransactionLogOption: (params) => {
|
|
187
|
+
return API$T.get("/transaction-log/options", { params });
|
|
188
|
+
},
|
|
189
|
+
postScanLog: (body) => {
|
|
190
|
+
return API$T.post("/transaction-log/scan-log", body);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
const API$S = createAxiosInstance({
|
|
194
|
+
prefix: "/utility/v2"
|
|
195
|
+
});
|
|
196
|
+
const ChangelogServices = {
|
|
197
|
+
getActionLog: (params) => {
|
|
198
|
+
return API$S.get("/change-log", { params });
|
|
199
|
+
},
|
|
200
|
+
getActionLogOption: (params) => {
|
|
201
|
+
return API$S.get("/change-log/options", { params });
|
|
202
|
+
},
|
|
203
|
+
getSessionLogList: (params) => {
|
|
204
|
+
return API$S.get("/session-log", { params });
|
|
205
|
+
},
|
|
206
|
+
getTransactionLog: (params) => {
|
|
207
|
+
return API$S.get("/transaction-log", { params });
|
|
208
|
+
},
|
|
209
|
+
/**
|
|
210
|
+
* Retrieves the transaction log options.
|
|
211
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
212
|
+
*/
|
|
213
|
+
getTransactionLogOption: (params) => {
|
|
214
|
+
return API$S.get("/transaction-log/options", { params });
|
|
215
|
+
},
|
|
216
|
+
getUserDetailSystemLogList: (params) => {
|
|
217
|
+
return API$S.get("/change-log", { params });
|
|
218
|
+
},
|
|
219
|
+
getUserDetailSystemLogOption: (params) => {
|
|
220
|
+
return API$S.get("/change-log/options", { params });
|
|
221
|
+
},
|
|
222
|
+
getUserDetailUserLogBorrowingList: (userId, params) => {
|
|
223
|
+
return API$S.get(`/borrowing-log/${userId}`, { params });
|
|
224
|
+
},
|
|
225
|
+
getUserDetailUserLogAssignmentList: (userId, params) => {
|
|
226
|
+
return API$S.get(`/assignment-log/${userId}`, { params });
|
|
227
|
+
},
|
|
228
|
+
getUserDetailUserLogBorrowingOption: (userId, params) => {
|
|
229
|
+
return API$S.get(`/borrowing-log/${userId}/options`, { params });
|
|
230
|
+
},
|
|
231
|
+
getUserDetailUserLogAssignmentOption: (userId, params) => {
|
|
232
|
+
return API$S.get(`/assignment-log/${userId}/options`, { params });
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
const AssetsAPIs$1 = createAxiosInstance({
|
|
73
236
|
prefix: "/assets/v2/assets"
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
237
|
+
});
|
|
238
|
+
const AttachmentAPIs = createAxiosInstance({
|
|
239
|
+
prefix: "/assets/v2/attachment"
|
|
240
|
+
});
|
|
241
|
+
const AssetServices$1 = {
|
|
242
|
+
getScanTag: (tag) => {
|
|
243
|
+
return AssetsAPIs$1.get("/scan", { params: { tag } });
|
|
244
|
+
},
|
|
245
|
+
getAllAssets: (params) => {
|
|
246
|
+
return AssetsAPIs$1.get("/", { params });
|
|
247
|
+
},
|
|
248
|
+
getAllAssetsOptions: (params) => {
|
|
249
|
+
return AssetsAPIs$1.get("/options", { params });
|
|
250
|
+
},
|
|
251
|
+
getAvailableAssets: (params) => {
|
|
252
|
+
return AssetsAPIs$1.get("/available", { params });
|
|
253
|
+
},
|
|
254
|
+
getAvailableAssetOptions: (params) => {
|
|
255
|
+
return AssetsAPIs$1.get("/available/options", { params });
|
|
256
|
+
},
|
|
257
|
+
scanAsset: (tag) => {
|
|
258
|
+
return AssetsAPIs$1.get("", { params: { tag } });
|
|
259
|
+
},
|
|
260
|
+
getAssetsById: (_id, params) => {
|
|
261
|
+
return AssetsAPIs$1.get("/by-id", { params: { _id, ...params } });
|
|
262
|
+
},
|
|
263
|
+
getOptions: (endpoint, params) => {
|
|
264
|
+
return AssetsAPIs$1.get(endpoint ? `/${endpoint}/options` : "/options", {
|
|
265
|
+
params
|
|
266
|
+
});
|
|
267
|
+
},
|
|
268
|
+
getUnlinkedAssets: (params) => {
|
|
269
|
+
return AssetsAPIs$1.get("/unlinked", { params });
|
|
270
|
+
},
|
|
271
|
+
getAssetDetail: (id, params) => {
|
|
272
|
+
return AssetsAPIs$1.get(`/${id}`, { params });
|
|
273
|
+
},
|
|
274
|
+
getAssetNameTotal: (assetNameId) => {
|
|
275
|
+
return AssetsAPIs$1.get(`/name-amount/${assetNameId}`);
|
|
276
|
+
},
|
|
277
|
+
getLinkedAssetFamily: (id) => {
|
|
278
|
+
return AssetsAPIs$1.get("/family", { params: { id } });
|
|
279
|
+
},
|
|
280
|
+
matchAssetWithTag: (id, tag) => {
|
|
281
|
+
const params = {
|
|
282
|
+
_id: JSON.stringify([id]),
|
|
283
|
+
tag
|
|
88
284
|
};
|
|
89
|
-
return
|
|
285
|
+
return AssetsAPIs$1.get("/by-id", { params });
|
|
286
|
+
},
|
|
287
|
+
postRegisterAsset: (body) => {
|
|
288
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
289
|
+
return AssetsAPIs$1.post("/bulk", body, { headers });
|
|
290
|
+
},
|
|
291
|
+
putEditAsset: (id, body) => {
|
|
292
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
293
|
+
return AssetsAPIs$1.put(`/${id}`, body, { headers });
|
|
294
|
+
},
|
|
295
|
+
putEditDetailCustomField: (id, body) => {
|
|
296
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
297
|
+
return AssetsAPIs$1.put(`/${id}`, body, { headers });
|
|
298
|
+
},
|
|
299
|
+
getLinkedAsset: (assetId, params) => {
|
|
300
|
+
return AssetsAPIs$1.get(`/${assetId}/linked`, { params });
|
|
301
|
+
},
|
|
302
|
+
getPurchase: (assetId) => {
|
|
303
|
+
return AssetsAPIs$1.get(`/${assetId}/purchase`);
|
|
304
|
+
},
|
|
305
|
+
putPurchase: (body, assetId) => {
|
|
306
|
+
return AssetsAPIs$1.put(`/${assetId}/purchase`, body);
|
|
307
|
+
},
|
|
308
|
+
getAccounting: (assetId, params) => {
|
|
309
|
+
return AssetsAPIs$1.get(`/${assetId}/accounting`, { params });
|
|
310
|
+
},
|
|
311
|
+
getAssetFamily: (parentId) => {
|
|
312
|
+
return AssetsAPIs$1.get(`/${parentId}/family`);
|
|
313
|
+
},
|
|
314
|
+
getLinkedAssetOption: (parentId, params) => {
|
|
315
|
+
return AssetsAPIs$1.get(`/${parentId}/linked/options`, { params });
|
|
316
|
+
},
|
|
317
|
+
putLinkAsset: (body, parentId) => {
|
|
318
|
+
return AssetsAPIs$1.put(`/${parentId}/link-assets`, body);
|
|
319
|
+
},
|
|
320
|
+
putUnlinkAsset: (body, parentId) => {
|
|
321
|
+
return AssetsAPIs$1.put(`/${parentId}/remove-link-assets`, body);
|
|
322
|
+
},
|
|
323
|
+
// Asset Services prefixed by "attachment"
|
|
324
|
+
getAttachment: (params) => {
|
|
325
|
+
return AttachmentAPIs.get("", { params });
|
|
326
|
+
},
|
|
327
|
+
postAttachment: (body) => {
|
|
328
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
329
|
+
return AttachmentAPIs.post("", body, { headers });
|
|
330
|
+
},
|
|
331
|
+
putAttachment: (body, id) => {
|
|
332
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
333
|
+
return AttachmentAPIs.put(`/${id}`, body, { headers });
|
|
334
|
+
},
|
|
335
|
+
/**
|
|
336
|
+
* Deletes the attachment with the given IDs.
|
|
337
|
+
* @param {object} params - The request params containing the IDs of the attachments to delete.
|
|
338
|
+
* @returns {Promise<AxiosResponse>}
|
|
339
|
+
*/
|
|
340
|
+
deleteAttachment: (params) => {
|
|
341
|
+
return AttachmentAPIs.delete("/bulk", { params });
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
const AssetsAPIs = createAxiosInstance({
|
|
345
|
+
prefix: "/assets-go/v2/assets"
|
|
346
|
+
});
|
|
347
|
+
const AssetServices = {
|
|
348
|
+
getAllAssets: (params) => {
|
|
349
|
+
return AssetsAPIs.get("/", { params });
|
|
350
|
+
},
|
|
351
|
+
getAllAssetsOptions: (params) => {
|
|
352
|
+
return AssetsAPIs.get("/options", { params });
|
|
353
|
+
},
|
|
354
|
+
getOptions: (endpoint, params) => {
|
|
355
|
+
return AssetsAPIs.get(endpoint ? `/${endpoint}/options` : "/options", {
|
|
356
|
+
params
|
|
357
|
+
});
|
|
358
|
+
},
|
|
359
|
+
getUnlinkedAssets: (params) => {
|
|
360
|
+
return AssetsAPIs.get("/unlinked", { params });
|
|
361
|
+
},
|
|
362
|
+
getAssetDetail: (id, params) => {
|
|
363
|
+
return AssetsAPIs.get(`/${id}`, { params });
|
|
364
|
+
},
|
|
365
|
+
getAssetNameTotal: () => {
|
|
366
|
+
return AssetsAPIs.get("/name-amount");
|
|
367
|
+
},
|
|
368
|
+
postRegisterAsset: (body) => {
|
|
369
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
370
|
+
return AssetsAPIs.post("", body, { headers });
|
|
371
|
+
},
|
|
372
|
+
putEditAsset: (id, body) => {
|
|
373
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
374
|
+
return AssetsAPIs.put(`/${id}`, body, { headers });
|
|
375
|
+
},
|
|
376
|
+
putEditDetailCustomField: (id, body) => {
|
|
377
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
378
|
+
return AssetsAPIs.put(`/${id}`, body, { headers });
|
|
379
|
+
},
|
|
380
|
+
getLinkedAsset: (assetId, params) => {
|
|
381
|
+
return AssetsAPIs.get(`/${assetId}/linked-assets`, { params });
|
|
382
|
+
},
|
|
383
|
+
getPurchase: (assetId) => {
|
|
384
|
+
return AssetsAPIs.get(`/${assetId}/purchase`);
|
|
385
|
+
},
|
|
386
|
+
putPurchase: (body, assetId) => {
|
|
387
|
+
return AssetsAPIs.put(`/${assetId}/purchase`, body);
|
|
388
|
+
},
|
|
389
|
+
getAccounting: (assetId, params) => {
|
|
390
|
+
return AssetsAPIs.get(`/${assetId}/accounting`, { params });
|
|
391
|
+
},
|
|
392
|
+
getLinkedAssetOption: (parentId, params) => {
|
|
393
|
+
return AssetsAPIs.get(`/${parentId}/linked-assets/options`, { params });
|
|
394
|
+
},
|
|
395
|
+
putLinkAsset: (body, parentId) => {
|
|
396
|
+
return AssetsAPIs.put(`/${parentId}/linked-assets`, body);
|
|
397
|
+
},
|
|
398
|
+
putUnlinkAsset: (body, parentId) => {
|
|
399
|
+
return AssetsAPIs.put(`/${parentId}/unlink-assets`, body);
|
|
400
|
+
},
|
|
401
|
+
putEditUsefulLife: (body) => {
|
|
402
|
+
return AssetsAPIs.put("/useful-life", body);
|
|
403
|
+
},
|
|
404
|
+
getAttachment: (assetId, params) => {
|
|
405
|
+
return AssetsAPIs.get(`/attachment/${assetId}`, { params });
|
|
406
|
+
},
|
|
407
|
+
postAttachment: (body, assetId) => {
|
|
408
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
409
|
+
return AssetsAPIs.post(`/attachment/${assetId}`, body, { headers });
|
|
410
|
+
},
|
|
411
|
+
putAttachment: (body, id) => {
|
|
412
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
413
|
+
return AssetsAPIs.put(`/attachment/${id}`, body, { headers });
|
|
414
|
+
},
|
|
415
|
+
/**
|
|
416
|
+
* Deletes the attachment with the given IDs.
|
|
417
|
+
* @param {object} params - The request params containing the IDs of the attachments to delete.
|
|
418
|
+
* @returns {Promise<AxiosResponse>}
|
|
419
|
+
*/
|
|
420
|
+
deleteAttachment: (params) => {
|
|
421
|
+
return AssetsAPIs.delete("/attachment/bulk", { params });
|
|
90
422
|
}
|
|
91
|
-
}
|
|
423
|
+
};
|
|
424
|
+
const API$R = createAxiosInstance({
|
|
92
425
|
prefix: "/tracking/v2/missing"
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
426
|
+
});
|
|
427
|
+
const MissingServices$2 = {
|
|
428
|
+
/**
|
|
429
|
+
* To mark as found.
|
|
430
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
431
|
+
*/
|
|
432
|
+
putMarkAsFound: (body) => {
|
|
433
|
+
return API$R.put("/found", body);
|
|
434
|
+
},
|
|
435
|
+
putReportMissing: (id, body) => {
|
|
436
|
+
return API$R.put(`/report-missing/${id}`, body);
|
|
437
|
+
},
|
|
438
|
+
getData: (params) => {
|
|
439
|
+
return API$R.get("/", { params });
|
|
440
|
+
},
|
|
441
|
+
getDetail: (id) => {
|
|
442
|
+
return API$R.get(`/${id}`);
|
|
443
|
+
},
|
|
444
|
+
getOptions: (params) => {
|
|
445
|
+
return API$R.get("/options", { params });
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
const API$Q = createAxiosInstance({
|
|
449
|
+
prefix: "/missing-tracking/v2"
|
|
450
|
+
});
|
|
451
|
+
const MissingServices$1 = {
|
|
452
|
+
putFoundAsset: (body) => {
|
|
453
|
+
return API$Q.put("/found", body);
|
|
454
|
+
},
|
|
455
|
+
putReportMissing: (id, body) => {
|
|
456
|
+
return API$Q.put(`/${id}/report-missing`, body);
|
|
457
|
+
},
|
|
458
|
+
getData: (params) => {
|
|
459
|
+
return API$Q.get("/", { params });
|
|
460
|
+
},
|
|
461
|
+
getDataOptions: (params) => {
|
|
462
|
+
return API$Q.get("/options", { params });
|
|
463
|
+
},
|
|
464
|
+
getDetail: (id) => {
|
|
465
|
+
return API$Q.get(`/${id}`);
|
|
97
466
|
}
|
|
98
|
-
}
|
|
467
|
+
};
|
|
468
|
+
const API$P = createAxiosInstance({
|
|
99
469
|
prefix: "/v2/notification",
|
|
100
470
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
471
|
+
});
|
|
472
|
+
const NotificationServices$1 = {
|
|
473
|
+
getNotifications: (params) => {
|
|
474
|
+
return API$P.get("/", { params });
|
|
475
|
+
},
|
|
476
|
+
readNotification: (id) => {
|
|
477
|
+
return API$P.put(`/${id}`);
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
const API$O = createAxiosInstance({
|
|
481
|
+
prefix: "/utility/v2/notification"
|
|
482
|
+
});
|
|
483
|
+
const NotificationServices = {
|
|
484
|
+
getNotifications: (params) => {
|
|
485
|
+
return API$O.get("/", { params });
|
|
486
|
+
},
|
|
487
|
+
readNotification: (id) => {
|
|
488
|
+
return API$O.put(`/${id}`);
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
const API$N = createAxiosInstance({
|
|
105
492
|
prefix: "/v2/session-log",
|
|
106
493
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
|
|
494
|
+
});
|
|
495
|
+
const SessionLogServices = {
|
|
496
|
+
postLogout: () => {
|
|
497
|
+
return API$N.post("/logout");
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
const API$M = createAxiosInstance({
|
|
110
501
|
prefix: "/tag/v2"
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
},
|
|
502
|
+
});
|
|
503
|
+
const TAGServices = {
|
|
504
|
+
getScanQR: (tag) => {
|
|
505
|
+
return API$M.get("/qr", { params: { tag } });
|
|
506
|
+
},
|
|
507
|
+
getScanRFID: (tag) => {
|
|
508
|
+
return API$M.get("/rfid", { params: { tag } });
|
|
509
|
+
},
|
|
510
|
+
getRFIDQRTAG: (params) => {
|
|
511
|
+
return API$M.get("/rfid-qr/scan", { params });
|
|
512
|
+
},
|
|
513
|
+
getEventLog: (params) => {
|
|
514
|
+
return API$M.get("/tag-transaction/event-log", { params });
|
|
515
|
+
},
|
|
516
|
+
// Tab All
|
|
517
|
+
getRfidQrAll: (path, params) => {
|
|
518
|
+
return API$M.get(`/${path}`, { params });
|
|
519
|
+
},
|
|
520
|
+
// Tab Paired
|
|
521
|
+
getRfidQrPaired: (tagType, viewBy, params) => {
|
|
522
|
+
return API$M.get(`/${tagType}/paired/${viewBy}`, { params });
|
|
523
|
+
},
|
|
524
|
+
postAddTAGtoPrelist: (body, destination) => {
|
|
525
|
+
return API$M.post(`/prelist/${destination}/asset-name`, body);
|
|
526
|
+
},
|
|
527
|
+
postAddTAGtoReplacePrelist: (body) => {
|
|
528
|
+
return API$M.post("/prelist/replace-tag", body);
|
|
529
|
+
},
|
|
530
|
+
postAddTAGToPrelistUnpair: (body) => {
|
|
531
|
+
return API$M.post("/prelist/unpair-tag", body);
|
|
532
|
+
},
|
|
533
|
+
postAddTAGtoPending: (body) => {
|
|
534
|
+
return API$M.post("/pending-changes", body);
|
|
535
|
+
},
|
|
536
|
+
// Available Tab
|
|
537
|
+
getRFIDQrAvailable: (tagType, params) => {
|
|
538
|
+
return API$M.get(`/${tagType}/available`, { params });
|
|
539
|
+
},
|
|
540
|
+
// Damaged TAB
|
|
541
|
+
getRFIDQrDamaged: (tagType, params) => {
|
|
542
|
+
return API$M.get(`/${tagType}/damaged`, { params });
|
|
543
|
+
},
|
|
544
|
+
// RFID and QR Module
|
|
545
|
+
getRFIDandQRList: (params) => {
|
|
546
|
+
return API$M.get("/rfid-qr", { params });
|
|
547
|
+
},
|
|
548
|
+
deleteUnpairTAG: (body) => {
|
|
549
|
+
return API$M.delete("/rfid-qr", { data: { data: body } });
|
|
550
|
+
},
|
|
551
|
+
postPairTAG: (body) => {
|
|
552
|
+
return API$M.post("/rfid-qr", { body: { data: body } });
|
|
553
|
+
},
|
|
554
|
+
// RFID To Be Returned
|
|
555
|
+
getToBeReturnedTAGList: (params) => {
|
|
556
|
+
return API$M.get("/rfid/to-be-returned", { params });
|
|
557
|
+
},
|
|
558
|
+
// Handover TAG
|
|
559
|
+
putHandoverTAG: (body) => {
|
|
560
|
+
return API$M.put("/rfid/handover", { body: { data: body } });
|
|
561
|
+
},
|
|
562
|
+
// Table Filter
|
|
563
|
+
getFilterOptions: (path, params) => {
|
|
564
|
+
return API$M.get(`/${path}/options`, { params });
|
|
565
|
+
},
|
|
566
|
+
getHolderListOptions: (params) => {
|
|
567
|
+
return API$M.get("/rfid/holder-list/options", { params });
|
|
568
|
+
},
|
|
569
|
+
getHolderList: (params) => {
|
|
570
|
+
return API$M.get("/rfid/holder-list", { params });
|
|
571
|
+
},
|
|
572
|
+
putAuditTAG: (body, tagType) => {
|
|
573
|
+
return API$M.put(`/${tagType}/audit`, body);
|
|
574
|
+
},
|
|
575
|
+
postLogAudit: (body) => {
|
|
576
|
+
return API$M.post("/tag-transaction/log-audit", body);
|
|
577
|
+
},
|
|
578
|
+
postCreateQr: (amount) => {
|
|
579
|
+
const body = { amount };
|
|
580
|
+
return API$M.post("/qr", body);
|
|
581
|
+
},
|
|
582
|
+
putReportTAG: (id, body) => {
|
|
583
|
+
return API$M.put(`/tag-transaction/report/${id}`, body);
|
|
584
|
+
},
|
|
585
|
+
putReportTAGBulk: (body) => {
|
|
586
|
+
return API$M.put("/tag-transaction/report/bulk", body);
|
|
587
|
+
},
|
|
588
|
+
putDeclineReport: (body, tagType) => {
|
|
589
|
+
return API$M.put(`/report/decline-report/${tagType}`, body);
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
const API$L = createAxiosInstance({
|
|
116
593
|
prefix: "/tracking/v2/tracking"
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
594
|
+
});
|
|
595
|
+
const MissingServices = {
|
|
596
|
+
getTrackingDetail: (trackingId) => {
|
|
597
|
+
return API$L.get(`/${trackingId}`);
|
|
598
|
+
},
|
|
599
|
+
putFoundAsset: (tag, groupId, serialNumber) => {
|
|
600
|
+
const params = {
|
|
601
|
+
tag,
|
|
602
|
+
group: groupId,
|
|
603
|
+
serialNumber,
|
|
123
604
|
type: "Global"
|
|
124
605
|
};
|
|
125
|
-
return
|
|
606
|
+
return API$L.put("/scan", void 0, { params });
|
|
607
|
+
},
|
|
608
|
+
putReportPermanentlyMissing: (trackingId, body) => {
|
|
609
|
+
return API$L.put(`/report-permanently-missing/${trackingId}`, body);
|
|
610
|
+
},
|
|
611
|
+
putMoveBack: (body) => {
|
|
612
|
+
return API$L.put("/tracking/move-back", body);
|
|
126
613
|
}
|
|
127
|
-
}
|
|
614
|
+
};
|
|
615
|
+
const API$K = createAxiosInstance({
|
|
128
616
|
prefix: "/settings-user-role/v2"
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return
|
|
617
|
+
});
|
|
618
|
+
const UserServices$1 = {
|
|
619
|
+
reLogin: (body) => {
|
|
620
|
+
return API$K.post("/auth/login", body);
|
|
621
|
+
},
|
|
622
|
+
changePassword: (body) => {
|
|
623
|
+
return API$K.put("/users/change-password", body);
|
|
624
|
+
},
|
|
625
|
+
/**
|
|
626
|
+
* Retrieves the user list as dropdown options.
|
|
627
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
628
|
+
*/
|
|
629
|
+
getUserDropdown: (params) => {
|
|
630
|
+
return API$K.get("/users/dropdown", { params });
|
|
631
|
+
},
|
|
632
|
+
getUserOptions: (params) => {
|
|
633
|
+
return API$K.get("/users/options", { params });
|
|
634
|
+
},
|
|
635
|
+
getUserList: (params) => {
|
|
636
|
+
return API$K.get("/users", { params });
|
|
637
|
+
},
|
|
638
|
+
getUserDetail: (id) => {
|
|
639
|
+
return API$K.get(`/users/${id}`);
|
|
640
|
+
},
|
|
641
|
+
putSetActiveBulk: (data) => {
|
|
642
|
+
return API$K.put("/users/set-active-bulk", data);
|
|
136
643
|
},
|
|
137
|
-
|
|
138
|
-
putCancelEmailChange: (t, e) => s.put("/auth/confirm-email-change/cancel", {
|
|
139
|
-
user: t,
|
|
140
|
-
companyCode: e
|
|
141
|
-
}),
|
|
644
|
+
// User Detail
|
|
142
645
|
/**
|
|
143
646
|
*
|
|
144
647
|
* @param id {string} User's _id
|
|
145
648
|
* @param type {"Global" | "Group"} Whether the system role's type is global or group
|
|
146
649
|
* @param params {Record<string, unknown>}
|
|
147
650
|
*/
|
|
148
|
-
getUserDetailSystemRoles: (
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
}
|
|
651
|
+
getUserDetailSystemRoles: (id, params, permissionType) => {
|
|
652
|
+
const additionalPath = permissionType ? `/${permissionType}` : "";
|
|
653
|
+
return API$K.get(`/user-detail/${id}/system-roles${additionalPath}`, {
|
|
654
|
+
params
|
|
655
|
+
});
|
|
656
|
+
},
|
|
657
|
+
getUserDetailTransactionRoleList: (id, params) => {
|
|
658
|
+
return API$K.get(`/user-detail/${id}/transaction-role-list`, { params });
|
|
659
|
+
},
|
|
660
|
+
postUserDetailAddTransactionRole: (userId, data) => {
|
|
661
|
+
return API$K.post(`/user-detail/${userId}/add-transaction-role`, data);
|
|
662
|
+
},
|
|
663
|
+
deleteUserDetailTransactionRole: (userId, data) => {
|
|
664
|
+
return API$K.delete(`/user-detail/${userId}/delete-transaction-role`, {
|
|
665
|
+
data
|
|
666
|
+
});
|
|
667
|
+
},
|
|
668
|
+
putUserDetailEditTransactionRole: (userId, data) => {
|
|
669
|
+
return API$K.put(`/user-detail/${userId}/edit-transaction-role`, data);
|
|
670
|
+
},
|
|
671
|
+
putAssignGroup: (data, permissionType, id) => {
|
|
672
|
+
return API$K.put(`/user-detail/${id}/system-roles/${permissionType}`, data);
|
|
673
|
+
},
|
|
674
|
+
getUserDetailUserLogBorrowingList: (userId, params) => {
|
|
675
|
+
return API$K.get(`/users-log/${userId}/borrowing`, { params });
|
|
676
|
+
},
|
|
677
|
+
getUserDetailUserLogAssignmentList: (userId, params) => {
|
|
678
|
+
return API$K.get(`/users-log/${userId}/assignment`, { params });
|
|
679
|
+
},
|
|
680
|
+
getUserDetailUserLogBorrowingOption: (userId, params) => {
|
|
681
|
+
return API$K.get(`/users-log/${userId}/borrowing/option`, { params });
|
|
682
|
+
},
|
|
683
|
+
getUserDetailUserLogAssignmentOption: (userId, params) => {
|
|
684
|
+
return API$K.get(`/users-log/${userId}/assignment/option`, { params });
|
|
685
|
+
},
|
|
686
|
+
getUserDetailTransactionAdminLogList: (userId, params) => {
|
|
687
|
+
return API$K.get(`/users-log/${userId}/transaction-log`, { params });
|
|
688
|
+
},
|
|
689
|
+
getUserDetailTransactionAdminLogOption: (userId, params) => {
|
|
690
|
+
return API$K.get(`/users-log/${userId}/transaction-log/option`, { params });
|
|
691
|
+
},
|
|
692
|
+
getUserDetailUserAssetBorrowedList: (userId, params) => {
|
|
693
|
+
return API$K.get(`/user-detail/${userId}/assets/borrowed`, { params });
|
|
694
|
+
},
|
|
695
|
+
getUserDetailUserAssetAssignedList: (userId, params) => {
|
|
696
|
+
return API$K.get(`/user-detail/${userId}/assets/assigned`, { params });
|
|
697
|
+
},
|
|
698
|
+
getUserDetailUserAssetBorrowedOption: (userId, params) => {
|
|
699
|
+
return API$K.get(`/user-detail/${userId}/assets/borrowed/option`, { params });
|
|
700
|
+
},
|
|
701
|
+
getUserDetailUserAssetAssignedOption: (userId, params) => {
|
|
702
|
+
return API$K.get(`/user-detail/${userId}/assets/assigned/option`, { params });
|
|
703
|
+
},
|
|
704
|
+
getUserAndSubUser: (params) => {
|
|
705
|
+
return API$K.get("/users/user-and-sub-user", { params });
|
|
706
|
+
},
|
|
707
|
+
getUserAndSubUserOptions: () => {
|
|
708
|
+
return API$K.get("/users/user-and-sub-user/options", {
|
|
709
|
+
params: {
|
|
710
|
+
divisionOptions: "true",
|
|
711
|
+
positionOptions: "true"
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
const API$J = createAxiosInstance({
|
|
717
|
+
prefix: "/settings-user-role-go/v2"
|
|
718
|
+
});
|
|
719
|
+
const UserServices = {
|
|
720
|
+
/**
|
|
721
|
+
* Retrieves the user list as dropdown options.
|
|
722
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
723
|
+
*/
|
|
724
|
+
getUserDropdown: (params) => {
|
|
725
|
+
return API$J.get("/users/dropdown", { params });
|
|
726
|
+
},
|
|
727
|
+
getUserOptions: (params) => {
|
|
728
|
+
return API$J.get("/users/options", { params });
|
|
729
|
+
},
|
|
730
|
+
getUserList: (params) => {
|
|
731
|
+
return API$J.get("/users", { params });
|
|
732
|
+
},
|
|
733
|
+
getUserDetail: (id) => {
|
|
734
|
+
return API$J.get(`/users/${id}`);
|
|
735
|
+
},
|
|
736
|
+
putSetActiveBulk: (data) => {
|
|
737
|
+
return API$J.put("/users/set-active-bulk", data);
|
|
738
|
+
},
|
|
154
739
|
// User Detail
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
740
|
+
/**
|
|
741
|
+
*
|
|
742
|
+
* @param id {string} User's _id
|
|
743
|
+
* @param type {"Global" | "Group"} Whether the system role's type is global or group
|
|
744
|
+
* @param params {Record<string, unknown>}
|
|
745
|
+
*/
|
|
746
|
+
getUserDetailSystemRoles: (id, params, permissionType) => {
|
|
747
|
+
const additionalPath = permissionType ? `/${permissionType}/groups` : "";
|
|
748
|
+
return API$J.get(`/users/${id}/system-roles${additionalPath}`, {
|
|
749
|
+
params
|
|
750
|
+
});
|
|
751
|
+
},
|
|
752
|
+
getUserDetailTransactionRoleList: (id, params) => {
|
|
753
|
+
return API$J.get(`/users/${id}/transaction-roles`, { params });
|
|
754
|
+
},
|
|
755
|
+
postUserDetailAddTransactionRole: (userId, data) => {
|
|
756
|
+
return API$J.post(`/users/${userId}/add-transaction-role`, data);
|
|
757
|
+
},
|
|
758
|
+
deleteUserDetailTransactionRole: (userId, body) => {
|
|
759
|
+
return API$J.put(`/users/${userId}/delete-transaction-role`, body);
|
|
760
|
+
},
|
|
761
|
+
putUserDetailEditTransactionRole: (userId, data) => {
|
|
762
|
+
return API$J.put(`/users/${userId}/edit-transaction-role`, data);
|
|
763
|
+
},
|
|
764
|
+
putAssignGroup: (data, permissionType, id) => {
|
|
765
|
+
return API$J.put(`/users/${id}/system-roles/${permissionType}/groups`, data);
|
|
766
|
+
},
|
|
767
|
+
putRoleSetActive: (body, userId) => {
|
|
768
|
+
return API$J.put(`/users/${userId}/system-roles/set-active-bulk`, body);
|
|
769
|
+
},
|
|
770
|
+
getUserDetailTransactionAdminLogList: (userId, params) => {
|
|
771
|
+
return API$J.get(`/users/${userId}/transaction-log`, { params });
|
|
772
|
+
},
|
|
773
|
+
getUserDetailTransactionAdminLogOption: (userId, params) => {
|
|
774
|
+
return API$J.get(`/users/${userId}/transaction-log/option`, { params });
|
|
775
|
+
},
|
|
776
|
+
getUserDetailUserAssetBorrowedList: (userId, params) => {
|
|
777
|
+
return API$J.get(`/users/${userId}/borrowed-asset`, { params });
|
|
778
|
+
},
|
|
779
|
+
getUserDetailUserAssetAssignedList: (userId, params) => {
|
|
780
|
+
return API$J.get(`/users/${userId}/assigned-asset`, { params });
|
|
781
|
+
},
|
|
782
|
+
getUserDetailUserAssetBorrowedOption: (userId, params) => {
|
|
783
|
+
return API$J.get(`/users/${userId}/borrowed-asset/option`, { params });
|
|
784
|
+
},
|
|
785
|
+
getUserDetailUserAssetAssignedOption: (userId, params) => {
|
|
786
|
+
return API$J.get(`/users/${userId}/assigned-asset/option`, { params });
|
|
787
|
+
}
|
|
788
|
+
};
|
|
789
|
+
const API$I = createAxiosInstance({
|
|
790
|
+
prefix: "/settings-user-role/v2/sub-users"
|
|
791
|
+
});
|
|
792
|
+
const SubUserServices$1 = {
|
|
793
|
+
// Sub User
|
|
794
|
+
getSubUserList: (userId, params) => {
|
|
795
|
+
return API$I.get(`/${userId}`, { params });
|
|
796
|
+
},
|
|
797
|
+
getSubUserOptions: (userId, params) => {
|
|
798
|
+
return API$I.get(`/${userId}/option`, { params });
|
|
799
|
+
},
|
|
800
|
+
postCreateSubUser: (userId, data) => {
|
|
801
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
802
|
+
return API$I.post(`/${userId}`, data, { headers });
|
|
803
|
+
},
|
|
804
|
+
putSubUserSetActiveBulk: (data) => {
|
|
805
|
+
return API$I.put("/set-active-bulk", data);
|
|
806
|
+
},
|
|
807
|
+
deleteSubUser: (subUserIds) => {
|
|
808
|
+
return API$I.delete("/bulk", { data: { subUserIds } });
|
|
809
|
+
},
|
|
810
|
+
putEditSubUser: (userId, data) => {
|
|
811
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
812
|
+
return API$I.put(`/${userId}`, data, { headers });
|
|
813
|
+
},
|
|
814
|
+
getBorrowedAsset: (id, params) => {
|
|
815
|
+
return API$I.get(`/${id}/borrowed-asset`, { params });
|
|
816
|
+
},
|
|
817
|
+
getBorrowedAssetOptions: (id, params) => {
|
|
818
|
+
return API$I.get(`/${id}/borrowed-asset/options`, { params });
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
const API$H = createAxiosInstance({
|
|
822
|
+
prefix: "/settings-user-role-go/v2/users"
|
|
823
|
+
});
|
|
824
|
+
const SubUserServices = {
|
|
825
|
+
// Sub User
|
|
826
|
+
getSubUserList: (userId, params) => {
|
|
827
|
+
return API$H.get(`/${userId}/sub-users`, { params });
|
|
828
|
+
},
|
|
829
|
+
getSubUserOptions: (userId, params) => {
|
|
830
|
+
return API$H.get(`/${userId}/sub-users/option`, { params });
|
|
831
|
+
},
|
|
832
|
+
postCreateSubUser: (userId, data) => {
|
|
833
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
834
|
+
return API$H.post(`/${userId}/sub-users`, data, { headers });
|
|
835
|
+
},
|
|
836
|
+
putSubUserSetActiveBulk: (userId, data) => {
|
|
837
|
+
return API$H.put(`/${userId}/sub-users/set-active-bulk`, data);
|
|
838
|
+
},
|
|
839
|
+
deleteSubUser: (userId, subUserIds) => {
|
|
840
|
+
return API$H.put(`/${userId}/sub-users/bulk`, { subUserIds });
|
|
841
|
+
},
|
|
842
|
+
putEditSubUser: (userId, subUserId, data) => {
|
|
843
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
844
|
+
return API$H.put(`/${userId}/sub-users/${subUserId}`, data, {
|
|
845
|
+
headers
|
|
846
|
+
});
|
|
847
|
+
},
|
|
848
|
+
getBorrowedAsset: (userId, subUserId, params) => {
|
|
849
|
+
return API$H.get(`/${userId}/sub-users/${subUserId}/borrowed-asset`, {
|
|
850
|
+
params
|
|
851
|
+
});
|
|
852
|
+
},
|
|
853
|
+
getBorrowedAssetOptions: (userId, subUserId, params) => {
|
|
854
|
+
return API$H.get(`/${userId}/sub-users/${subUserId}/borrowed-asset/options`, {
|
|
855
|
+
params
|
|
856
|
+
});
|
|
857
|
+
},
|
|
858
|
+
getAssignedAsset: (userId, subUserId, params) => {
|
|
859
|
+
return API$H.get(`/${userId}/sub-users/${subUserId}/assigned-asset`, {
|
|
860
|
+
params
|
|
861
|
+
});
|
|
862
|
+
},
|
|
863
|
+
getAssignedAssetOptions: (userId, subUserId, params) => {
|
|
864
|
+
return API$H.get(`/${userId}/sub-users/${subUserId}/assigned-asset/options`, {
|
|
865
|
+
params
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
};
|
|
869
|
+
const API$G = createAxiosInstance({
|
|
165
870
|
env: "APP_ADMIN_API",
|
|
166
871
|
prefix: "/settings-attribute/languages"
|
|
167
|
-
})
|
|
872
|
+
});
|
|
873
|
+
const I18nService = {
|
|
168
874
|
/**
|
|
169
875
|
* Fetch all translation messages for a specific locale.
|
|
170
876
|
* @param locale The locale code (e.g., 'en', 'id').
|
|
171
877
|
* @returns A promise resolving to a key-value record of messages.
|
|
172
878
|
*/
|
|
173
|
-
getMessages: (
|
|
879
|
+
getMessages: (isoCode) => {
|
|
880
|
+
return API$G.get(`/${isoCode}/translations`);
|
|
881
|
+
},
|
|
174
882
|
/**
|
|
175
883
|
* Fetch all available lang options for LanguageDropdown and LanguageSwitcher
|
|
176
884
|
*
|
|
177
885
|
* @returns Promise Array of options
|
|
178
886
|
*/
|
|
179
887
|
getLanguageOptions: async () => {
|
|
180
|
-
const { data
|
|
181
|
-
|
|
182
|
-
);
|
|
183
|
-
return t.data;
|
|
888
|
+
const { data } = await API$G.get("/dropdown");
|
|
889
|
+
return data.data;
|
|
184
890
|
},
|
|
185
891
|
/**
|
|
186
892
|
* Fetch single lang option meta data
|
|
@@ -188,11 +894,11 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
188
894
|
* @param isoCode The locale code (e.g., 'en', 'id').
|
|
189
895
|
* @returns Promise LanguageMeta
|
|
190
896
|
*/
|
|
191
|
-
getLanguageOptionMeta: async (
|
|
192
|
-
const { data
|
|
193
|
-
"/dropdown/" +
|
|
897
|
+
getLanguageOptionMeta: async (isoCode) => {
|
|
898
|
+
const { data } = await API$G.get(
|
|
899
|
+
"/dropdown/" + isoCode
|
|
194
900
|
);
|
|
195
|
-
return
|
|
901
|
+
return data.data;
|
|
196
902
|
},
|
|
197
903
|
/**
|
|
198
904
|
* Translate a specific text to the target locale.
|
|
@@ -200,33 +906,1833 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
200
906
|
* @param key Unique translation key.
|
|
201
907
|
* @param locale Target locale code.
|
|
202
908
|
*/
|
|
203
|
-
translateText: async (
|
|
204
|
-
const { data
|
|
205
|
-
q:
|
|
206
|
-
target:
|
|
909
|
+
translateText: async (key, locale) => {
|
|
910
|
+
const { data } = await API$G.post("/translate", {
|
|
911
|
+
q: key,
|
|
912
|
+
target: locale
|
|
207
913
|
});
|
|
208
|
-
return
|
|
914
|
+
return data.data.translations[key];
|
|
209
915
|
}
|
|
210
|
-
}
|
|
916
|
+
};
|
|
917
|
+
const API$F = createAxiosInstance({
|
|
211
918
|
prefix: "/dashboard/v2/dashboard"
|
|
212
|
-
})
|
|
213
|
-
|
|
214
|
-
|
|
919
|
+
});
|
|
920
|
+
const DashboardServices = {
|
|
921
|
+
getLatestTask: (params) => {
|
|
922
|
+
return API$F.get("/latest-task", { params });
|
|
923
|
+
},
|
|
924
|
+
getSummary: (params) => {
|
|
925
|
+
return API$F.get("/summary", { params });
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
const API$E = createAxiosInstance({
|
|
929
|
+
prefix: "/alias-code/api/alias-code"
|
|
930
|
+
});
|
|
931
|
+
const AliasCodeServices$1 = {
|
|
932
|
+
getAliasCode: () => {
|
|
933
|
+
return API$E.get("/");
|
|
934
|
+
},
|
|
935
|
+
postAliasCode: (data) => {
|
|
936
|
+
return API$E.post("/", data);
|
|
937
|
+
},
|
|
938
|
+
getAliasCodeList: (params) => {
|
|
939
|
+
return API$E.get(`/${params.object}/code-list`, { params });
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
const API$D = createAxiosInstance({
|
|
943
|
+
prefix: "/settings-attribute-go/v2/alias-code"
|
|
944
|
+
});
|
|
945
|
+
const AliasCodeServices = {
|
|
946
|
+
getAliasCode: () => {
|
|
947
|
+
return API$D.get("/");
|
|
948
|
+
},
|
|
949
|
+
postAliasCode: (data) => {
|
|
950
|
+
return API$D.post("/", data);
|
|
951
|
+
},
|
|
952
|
+
getAliasCodeList: (params) => {
|
|
953
|
+
return API$D.get(`/${params.object}/code-list`, { params });
|
|
954
|
+
}
|
|
955
|
+
};
|
|
956
|
+
const API$C = createAxiosInstance({
|
|
957
|
+
prefix: "/settings-attribute/v2/general-settings"
|
|
958
|
+
});
|
|
959
|
+
const GeneralSettingsServices$1 = {
|
|
960
|
+
getGeneralSettings: () => {
|
|
961
|
+
return API$C.get("/");
|
|
962
|
+
},
|
|
963
|
+
putUpdateGeneralSettings: (data) => {
|
|
964
|
+
return API$C.put("/", data);
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
const API$B = createAxiosInstance({
|
|
968
|
+
prefix: "/settings-attribute-go/v2/general-settings"
|
|
969
|
+
});
|
|
970
|
+
const GeneralSettingsServices = {
|
|
971
|
+
getGeneralSettings: () => {
|
|
972
|
+
return API$B.get("/");
|
|
973
|
+
},
|
|
974
|
+
putUpdateGeneralSettings: (data) => {
|
|
975
|
+
return API$B.put("/", data);
|
|
976
|
+
}
|
|
977
|
+
};
|
|
978
|
+
const API$A = createAxiosInstance({
|
|
979
|
+
prefix: "/settings-attribute/v2/custom-field"
|
|
980
|
+
});
|
|
981
|
+
const CustomFieldServices$1 = {
|
|
982
|
+
getCustomField: async (params) => {
|
|
983
|
+
return API$A.get("/", { params });
|
|
984
|
+
},
|
|
985
|
+
getCustomFieldsByCategory: (category, params) => {
|
|
986
|
+
return API$A.get(`/${category}`, { params });
|
|
987
|
+
},
|
|
988
|
+
getOptions: async (params) => {
|
|
989
|
+
return API$A.get("/options", { params });
|
|
990
|
+
},
|
|
991
|
+
postCreateCustomField: async (params, data) => {
|
|
992
|
+
return API$A.post("/", data, { params });
|
|
993
|
+
},
|
|
994
|
+
putEditCustomField: async (params, data, id) => {
|
|
995
|
+
return API$A.put(`/${id}`, data, { params });
|
|
996
|
+
},
|
|
997
|
+
putChangeStatus: async (params, data) => {
|
|
998
|
+
return API$A.put("/bulk", data, { params });
|
|
999
|
+
},
|
|
1000
|
+
deleteCustomField: async (data) => {
|
|
1001
|
+
return API$A.delete("/bulk", { data });
|
|
1002
|
+
},
|
|
1003
|
+
getUsedCustomFields: async () => {
|
|
1004
|
+
return API$A.get("/used-by-assets");
|
|
1005
|
+
}
|
|
1006
|
+
};
|
|
1007
|
+
const API$z = createAxiosInstance({
|
|
1008
|
+
prefix: "/settings-attribute-go/v2/custom-field"
|
|
1009
|
+
});
|
|
1010
|
+
const CustomFieldServices = {
|
|
1011
|
+
getCustomField: async (params) => {
|
|
1012
|
+
return API$z.get("/", { params });
|
|
1013
|
+
},
|
|
1014
|
+
getCustomFieldsByCategory: (category, params) => {
|
|
1015
|
+
return API$z.get(`/${category}`, { params });
|
|
1016
|
+
},
|
|
1017
|
+
getOptions: async (params) => {
|
|
1018
|
+
return API$z.get("/options", { params });
|
|
1019
|
+
},
|
|
1020
|
+
postCreateCustomField: async (params, data) => {
|
|
1021
|
+
return API$z.post("/", data, { params });
|
|
1022
|
+
},
|
|
1023
|
+
putEditCustomField: async (params, data, id) => {
|
|
1024
|
+
return API$z.put(`/${id}`, data, { params });
|
|
1025
|
+
},
|
|
1026
|
+
putChangeStatus: async (params, data) => {
|
|
1027
|
+
return API$z.put("/bulk", data, { params });
|
|
1028
|
+
},
|
|
1029
|
+
deleteCustomField: async (params) => {
|
|
1030
|
+
return API$z.delete("/bulk", { params });
|
|
1031
|
+
},
|
|
1032
|
+
getUsedCustomFields: async () => {
|
|
1033
|
+
return API$z.get("/used-by-assets");
|
|
1034
|
+
}
|
|
1035
|
+
};
|
|
1036
|
+
const API$y = ({ headers = {}, params = {} } = {}) => {
|
|
1037
|
+
const BASE_URL = getBaseURL("APP_COUNTRY_STATE_API");
|
|
1038
|
+
const API_KEY = getBaseURL("APP_COUNTRY_STATE_API_KEY");
|
|
1039
|
+
const instance = axios.create({
|
|
1040
|
+
baseURL: `${BASE_URL}/v1`,
|
|
1041
|
+
headers: {
|
|
1042
|
+
"Content-type": "application/json",
|
|
1043
|
+
"X-CSCAPI-KEY": API_KEY,
|
|
1044
|
+
...headers
|
|
1045
|
+
},
|
|
1046
|
+
params
|
|
1047
|
+
});
|
|
1048
|
+
return instance;
|
|
1049
|
+
};
|
|
1050
|
+
const CountryStateServices = {
|
|
1051
|
+
getCountry: () => {
|
|
1052
|
+
return API$y().get("/countries");
|
|
1053
|
+
},
|
|
1054
|
+
getState: (country) => {
|
|
1055
|
+
return API$y().get(`/countries/${country}/states`);
|
|
1056
|
+
},
|
|
1057
|
+
getCity: (country, state) => {
|
|
1058
|
+
return API$y().get(`/countries/${country}/states/${state}/cities`);
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
const API$x = createAxiosInstance({
|
|
1062
|
+
prefix: "/routine/v2"
|
|
1063
|
+
});
|
|
1064
|
+
const ServiceCenterServices = {
|
|
1065
|
+
getList: (params) => {
|
|
1066
|
+
return API$x.get("/service-center", { params });
|
|
1067
|
+
},
|
|
1068
|
+
postList: (body) => {
|
|
1069
|
+
return API$x.post("/service-center", body);
|
|
1070
|
+
},
|
|
1071
|
+
putList: (id, body) => {
|
|
1072
|
+
return API$x.put(`/service-center/${id}`, body);
|
|
1073
|
+
},
|
|
1074
|
+
putActivate: (body) => {
|
|
1075
|
+
return API$x.put("/service-center/bulk", body);
|
|
1076
|
+
},
|
|
1077
|
+
getDetailList: (id) => {
|
|
1078
|
+
return API$x.get(`/service-center/${id}`);
|
|
1079
|
+
},
|
|
1080
|
+
getListOptions: (params) => {
|
|
1081
|
+
return API$x.get("/service-center/options", { params });
|
|
1082
|
+
},
|
|
1083
|
+
deleteList: (params) => {
|
|
1084
|
+
return API$x.delete("/service-center", { params });
|
|
1085
|
+
},
|
|
1086
|
+
// Activities
|
|
1087
|
+
getActivities: (params) => {
|
|
1088
|
+
return API$x.get("/service-activities", { params });
|
|
1089
|
+
},
|
|
1090
|
+
getActivityOptions: (params) => {
|
|
1091
|
+
return API$x.get("/service-activities/options", { params });
|
|
1092
|
+
},
|
|
1093
|
+
getActivityDetail: (id) => {
|
|
1094
|
+
return API$x.get(`/service-activities/${id}`);
|
|
1095
|
+
},
|
|
1096
|
+
getActivityLog: (id) => {
|
|
1097
|
+
return API$x.get(`/service-activities/${id}/activity-log`);
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
1100
|
+
const API$w = createAxiosInstance({
|
|
1101
|
+
prefix: "/settings-attribute/v2/brands"
|
|
1102
|
+
});
|
|
1103
|
+
const BrandServices = {
|
|
1104
|
+
getDropdown: (params) => {
|
|
1105
|
+
return API$w.get("/dropdown", { params });
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
const API$v = createAxiosInstance({
|
|
1109
|
+
prefix: "/file-manager/v2"
|
|
1110
|
+
});
|
|
1111
|
+
const FileManagerServices$1 = {
|
|
1112
|
+
/**
|
|
1113
|
+
* Get storage information.
|
|
1114
|
+
*
|
|
1115
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
1116
|
+
*/
|
|
1117
|
+
getStorageInformation: () => {
|
|
1118
|
+
return API$v.get("/files/storage");
|
|
1119
|
+
},
|
|
1120
|
+
/**
|
|
1121
|
+
* Get file manager data.
|
|
1122
|
+
*
|
|
1123
|
+
* @param {FileType} type - The type of the file.
|
|
1124
|
+
* @param {FileManagerFilterParams} [params] - The parameters for filtering.
|
|
1125
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
1126
|
+
*/
|
|
1127
|
+
getFileManager: (type, params) => {
|
|
1128
|
+
return API$v.get(`/${type}`, { params });
|
|
1129
|
+
},
|
|
1130
|
+
/**
|
|
1131
|
+
* Get file manager options.
|
|
1132
|
+
*
|
|
1133
|
+
* @param {FileType} type - The type of the file.
|
|
1134
|
+
* @param {FileManagerOptionBoolean} [params] - The parameters for options.
|
|
1135
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
1136
|
+
*/
|
|
1137
|
+
getFileManagerOption: (type, params) => {
|
|
1138
|
+
return API$v.get(`/${type}/options`, { params });
|
|
1139
|
+
},
|
|
1140
|
+
/**
|
|
1141
|
+
* Recover files.
|
|
1142
|
+
*
|
|
1143
|
+
* @param {FileType} type - The type of the file.
|
|
1144
|
+
* @param {object} body - The body of the request.
|
|
1145
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
1146
|
+
*/
|
|
1147
|
+
recoverFiles: (type, body) => {
|
|
1148
|
+
return API$v.put(`/${type}/recover`, body);
|
|
1149
|
+
},
|
|
1150
|
+
/**
|
|
1151
|
+
* Delete files.
|
|
1152
|
+
*
|
|
1153
|
+
* @param {FileType} type - The type of the file.
|
|
1154
|
+
* @param {DeleteFileManagerDto} params - The params of the request.
|
|
1155
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
1156
|
+
*/
|
|
1157
|
+
deleteFiles: (type, params) => {
|
|
1158
|
+
return API$v.delete(`/${type}`, { params });
|
|
1159
|
+
},
|
|
1160
|
+
/**
|
|
1161
|
+
* Delete files permanently.
|
|
1162
|
+
*
|
|
1163
|
+
* @param {FileType} type - The type of the file.
|
|
1164
|
+
* @param {object} body - The body of the request.
|
|
1165
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
1166
|
+
*/
|
|
1167
|
+
deletePermanently: (type, params) => {
|
|
1168
|
+
return API$v.delete(`/${type}/delete-permanent`, { params });
|
|
1169
|
+
}
|
|
1170
|
+
};
|
|
1171
|
+
const API$u = createAxiosInstance({
|
|
1172
|
+
prefix: "/utility/v2"
|
|
1173
|
+
});
|
|
1174
|
+
const FileManagerServices = {
|
|
1175
|
+
/**
|
|
1176
|
+
* Get storage information.
|
|
1177
|
+
*
|
|
1178
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
1179
|
+
*/
|
|
1180
|
+
getStorageInformation: () => {
|
|
1181
|
+
return API$u.get("/files/storage");
|
|
1182
|
+
},
|
|
1183
|
+
/**
|
|
1184
|
+
* Get file manager data.
|
|
1185
|
+
*
|
|
1186
|
+
* @param {FileType} type - The type of the file.
|
|
1187
|
+
* @param {FileManagerFilterParams} [params] - The parameters for filtering.
|
|
1188
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
1189
|
+
*/
|
|
1190
|
+
getFileManager: (type, params) => {
|
|
1191
|
+
return API$u.get(`/${type}`, { params });
|
|
1192
|
+
},
|
|
1193
|
+
/**
|
|
1194
|
+
* Get file manager options.
|
|
1195
|
+
*
|
|
1196
|
+
* @param {FileType} type - The type of the file.
|
|
1197
|
+
* @param {FileManagerOptionBoolean} [params] - The parameters for options.
|
|
1198
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
1199
|
+
*/
|
|
1200
|
+
getFileManagerOption: (type, params) => {
|
|
1201
|
+
return API$u.get(`/${type}/options`, { params });
|
|
1202
|
+
},
|
|
1203
|
+
/**
|
|
1204
|
+
* Recover files.
|
|
1205
|
+
*
|
|
1206
|
+
* @param {FileType} type - The type of the file.
|
|
1207
|
+
* @param {object} body - The body of the request.
|
|
1208
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
1209
|
+
*/
|
|
1210
|
+
recoverFiles: (type, body) => {
|
|
1211
|
+
return API$u.put(`/${type}/recover`, body);
|
|
1212
|
+
},
|
|
1213
|
+
/**
|
|
1214
|
+
* Delete files.
|
|
1215
|
+
*
|
|
1216
|
+
* @param {FileType} type - The type of the file.
|
|
1217
|
+
* @param {DeleteFileManagerDto} params - The params of the request.
|
|
1218
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
1219
|
+
*/
|
|
1220
|
+
deleteFiles: (type, params) => {
|
|
1221
|
+
return API$u.delete(`/${type}`, { params });
|
|
1222
|
+
},
|
|
1223
|
+
/**
|
|
1224
|
+
* Delete files permanently.
|
|
1225
|
+
*
|
|
1226
|
+
* @param {FileType} type - The type of the file.
|
|
1227
|
+
* @param {object} body - The body of the request.
|
|
1228
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
1229
|
+
*/
|
|
1230
|
+
deletePermanently: (type, params) => {
|
|
1231
|
+
return API$u.delete(`/${type}/delete-permanent`, { params });
|
|
1232
|
+
}
|
|
1233
|
+
};
|
|
1234
|
+
const API$t = createAxiosInstance({
|
|
1235
|
+
prefix: "/iot/v2/reader"
|
|
1236
|
+
});
|
|
1237
|
+
const ReaderServices = {
|
|
1238
|
+
getData: (params) => {
|
|
1239
|
+
return API$t.get("/", { params });
|
|
1240
|
+
},
|
|
1241
|
+
getDataOptions: (params) => {
|
|
1242
|
+
return API$t.get("/options", { params });
|
|
1243
|
+
},
|
|
1244
|
+
getActivityLogData: (params) => {
|
|
1245
|
+
return API$t.get("/activity-log", { params });
|
|
1246
|
+
},
|
|
1247
|
+
getActivityLogOptions: (params) => {
|
|
1248
|
+
return API$t.get("/activity-log/options", { params });
|
|
1249
|
+
},
|
|
1250
|
+
getDataById: (id) => {
|
|
1251
|
+
return API$t.get(`/${id}`);
|
|
1252
|
+
},
|
|
1253
|
+
getChangeLog: (params) => {
|
|
1254
|
+
return API$t.get(`/${params.id}/change-log`, { params });
|
|
1255
|
+
},
|
|
1256
|
+
getChangeLogOptions: (params) => {
|
|
1257
|
+
return API$t.get(`/${params.id}/change-log/options`, { params });
|
|
1258
|
+
},
|
|
1259
|
+
putData: (id, body) => {
|
|
1260
|
+
return API$t.put(`/${id}`, body);
|
|
1261
|
+
}
|
|
1262
|
+
};
|
|
1263
|
+
const API$s = createAxiosInstance({
|
|
1264
|
+
prefix: "/settings-user-role/v2"
|
|
1265
|
+
});
|
|
1266
|
+
const RoleServices$1 = {
|
|
1267
|
+
/**
|
|
1268
|
+
* Retrieves the transaction role for the given group and transaction name.
|
|
1269
|
+
* @param {string} groupId - The ID of the group to retrieve the transaction role for.
|
|
1270
|
+
* @param {string} transactionName - The name of the transaction to retrieve the role for.
|
|
1271
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
1272
|
+
*/
|
|
1273
|
+
getTransactionRole: (groupId, transactionName) => {
|
|
1274
|
+
return API$s.get(`/transaction-roles/${groupId}/${transactionName}`);
|
|
1275
|
+
},
|
|
1276
|
+
/**
|
|
1277
|
+
* Updates the users assigned to the given transaction role.
|
|
1278
|
+
* @param {string} groupId - The ID of the group the transaction role belongs to.
|
|
1279
|
+
* @param {string} transactionName - The name of the transaction to update.
|
|
1280
|
+
* @param {UpdateUser} body - The request body containing the updated user information.
|
|
1281
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
1282
|
+
*/
|
|
1283
|
+
putUpdateUsers: (groupId, transactionName, body) => {
|
|
1284
|
+
return API$s.put(
|
|
1285
|
+
`/transaction-roles/${groupId}/${transactionName}/update-user`,
|
|
1286
|
+
body
|
|
1287
|
+
);
|
|
1288
|
+
},
|
|
1289
|
+
/**
|
|
1290
|
+
* Updates the approval level for the given transaction role.
|
|
1291
|
+
* @param {string} groupId - The ID of the group the transaction role belongs to.
|
|
1292
|
+
* @param {string} transactionName - The name of the transaction to update.
|
|
1293
|
+
* @param {UserApprovalLevel} body - The request body containing the updated approval level.
|
|
1294
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
1295
|
+
*/
|
|
1296
|
+
putUpdateLevel: (groupId, transactionName, body) => {
|
|
1297
|
+
return API$s.put(
|
|
1298
|
+
`/transaction-roles/${groupId}/${transactionName}/update-approval-level`,
|
|
1299
|
+
body
|
|
1300
|
+
);
|
|
1301
|
+
},
|
|
1302
|
+
/**
|
|
1303
|
+
* Updates the group management settings for the given transaction role.
|
|
1304
|
+
* @param {string} groupId - The ID of the group the transaction role belongs to.
|
|
1305
|
+
* @param {string} transactionName - The name of the transaction to update.
|
|
1306
|
+
* @param {GroupManageByParent} body - The request body containing the updated management settings.
|
|
1307
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
1308
|
+
*/
|
|
1309
|
+
putUpdateGroupManage: (groupId, transactionName, body) => {
|
|
1310
|
+
return API$s.put(
|
|
1311
|
+
`/transaction-roles/${groupId}/${transactionName}/update-manage-by-parent`,
|
|
1312
|
+
body
|
|
1313
|
+
);
|
|
1314
|
+
},
|
|
1315
|
+
getUserAssignedSystemRole: (userId) => {
|
|
1316
|
+
return API$s.get(`/system-roles/user/${userId}`);
|
|
1317
|
+
},
|
|
1318
|
+
getAssignedUserAmounts: () => {
|
|
1319
|
+
return API$s.get("/system-roles/amounts");
|
|
1320
|
+
},
|
|
1321
|
+
getPermissionUser: (permissionType, params) => {
|
|
1322
|
+
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
1323
|
+
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
1324
|
+
return API$s.get(`/system-roles/total-control-read-only/${type}`, {
|
|
1325
|
+
params
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
return API$s.get(`/system-roles/permission/${permissionType}`, { params });
|
|
1329
|
+
},
|
|
1330
|
+
getPermissionUserOptions: (permissionType, params) => {
|
|
1331
|
+
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
1332
|
+
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
1333
|
+
return API$s.get(`/system-roles/total-control-read-only/${type}/options`, {
|
|
1334
|
+
params
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
return API$s.get(`/system-roles/permission/${permissionType}/options`, {
|
|
1338
|
+
params
|
|
1339
|
+
});
|
|
1340
|
+
},
|
|
1341
|
+
getUserGroups: (params, permissionType) => {
|
|
1342
|
+
return API$s.get(`/system-roles/permission/${permissionType}/groups`, {
|
|
1343
|
+
params
|
|
1344
|
+
});
|
|
1345
|
+
},
|
|
1346
|
+
postAssignUser: (body, permissionType) => {
|
|
1347
|
+
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
1348
|
+
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
1349
|
+
return API$s.post(`/system-roles/total-control-read-only/${type}`, body);
|
|
1350
|
+
}
|
|
1351
|
+
return API$s.post(`/system-roles/permission/${permissionType}`, body);
|
|
1352
|
+
},
|
|
1353
|
+
putEditUser: (body, roleId) => {
|
|
1354
|
+
return API$s.put(`/system-roles/${roleId}`, body);
|
|
1355
|
+
},
|
|
1356
|
+
putRoleSetActive: (body) => {
|
|
1357
|
+
return API$s.put("/system-roles/set-active", body);
|
|
1358
|
+
},
|
|
1359
|
+
deleteRemoveUser: (body, permissionType) => {
|
|
1360
|
+
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
1361
|
+
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
1362
|
+
return API$s.delete(`/system-roles/total-control-read-only/${type}`, {
|
|
1363
|
+
data: body
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
return API$s.delete("/system-roles", { data: body });
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
const API$r = createAxiosInstance({
|
|
1370
|
+
prefix: "/settings-user-role-go/v2"
|
|
1371
|
+
});
|
|
1372
|
+
const RoleServices = {
|
|
1373
|
+
/**
|
|
1374
|
+
* Retrieves the transaction role for the given group and transaction name.
|
|
1375
|
+
* @param {string} groupId - The ID of the group to retrieve the transaction role for.
|
|
1376
|
+
* @param {string} transactionName - The name of the transaction to retrieve the role for.
|
|
1377
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
1378
|
+
*/
|
|
1379
|
+
getTransactionRole: (groupId, transactionName) => {
|
|
1380
|
+
return API$r.get(`/transaction-roles/${groupId}/${transactionName}`);
|
|
1381
|
+
},
|
|
1382
|
+
getTransactionRoleTypes: (groupKeys, transactionName) => {
|
|
1383
|
+
return API$r.get(`/transaction-roles/${transactionName}/types`, {
|
|
1384
|
+
params: { groupKeys }
|
|
1385
|
+
});
|
|
1386
|
+
},
|
|
1387
|
+
/**
|
|
1388
|
+
* Updates the users assigned to the given transaction role.
|
|
1389
|
+
* @param {string} groupId - The ID of the group the transaction role belongs to.
|
|
1390
|
+
* @param {string} transactionName - The name of the transaction to update.
|
|
1391
|
+
* @param {UpdateUser} body - The request body containing the updated user information.
|
|
1392
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
1393
|
+
*/
|
|
1394
|
+
putUpdateUsers: (groupId, transactionName, body) => {
|
|
1395
|
+
return API$r.put(
|
|
1396
|
+
`/transaction-roles/${groupId}/${transactionName}/update-user`,
|
|
1397
|
+
body
|
|
1398
|
+
);
|
|
1399
|
+
},
|
|
1400
|
+
/**
|
|
1401
|
+
* Updates the approval level for the given transaction role.
|
|
1402
|
+
* @param {string} groupId - The ID of the group the transaction role belongs to.
|
|
1403
|
+
* @param {string} transactionName - The name of the transaction to update.
|
|
1404
|
+
* @param {UserApprovalLevel} body - The request body containing the updated approval level.
|
|
1405
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
1406
|
+
*/
|
|
1407
|
+
putUpdateLevel: (groupId, transactionName, body) => {
|
|
1408
|
+
return API$r.put(
|
|
1409
|
+
`/transaction-roles/${groupId}/${transactionName}/update-approval-level`,
|
|
1410
|
+
body
|
|
1411
|
+
);
|
|
1412
|
+
},
|
|
1413
|
+
/**
|
|
1414
|
+
* Updates the group management settings for the given transaction role.
|
|
1415
|
+
* @param {string} groupId - The ID of the group the transaction role belongs to.
|
|
1416
|
+
* @param {string} transactionName - The name of the transaction to update.
|
|
1417
|
+
* @param {GroupManageByParent} body - The request body containing the updated management settings.
|
|
1418
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
1419
|
+
*/
|
|
1420
|
+
putUpdateGroupManage: (groupId, transactionName, body) => {
|
|
1421
|
+
return API$r.put(
|
|
1422
|
+
`/transaction-roles/${groupId}/${transactionName}/update-manage-by-parent`,
|
|
1423
|
+
body
|
|
1424
|
+
);
|
|
1425
|
+
},
|
|
1426
|
+
getUserAssignedSystemRole: (userId) => {
|
|
1427
|
+
return API$r.get(`/system-roles/user/${userId}`);
|
|
1428
|
+
},
|
|
1429
|
+
getAssignedUserAmounts: () => {
|
|
1430
|
+
return API$r.get("/system-roles/amounts");
|
|
1431
|
+
},
|
|
1432
|
+
getPermissionUser: (permissionType, params) => {
|
|
1433
|
+
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
1434
|
+
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
1435
|
+
return API$r.get(`/system-roles/total-control-read-only/${type}`, {
|
|
1436
|
+
params
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1439
|
+
return API$r.get(`/system-roles/permission/${permissionType}`, { params });
|
|
1440
|
+
},
|
|
1441
|
+
getPermissionUserOptions: (permissionType, params) => {
|
|
1442
|
+
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
1443
|
+
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
1444
|
+
return API$r.get(`/system-roles/total-control-read-only/${type}/options`, {
|
|
1445
|
+
params
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
return API$r.get(`/system-roles/permission/${permissionType}/options`, {
|
|
1449
|
+
params
|
|
1450
|
+
});
|
|
1451
|
+
},
|
|
1452
|
+
getUserGroups: (params, permissionType) => {
|
|
1453
|
+
return API$r.get(`/system-roles/permission/${permissionType}/groups`, {
|
|
1454
|
+
params
|
|
1455
|
+
});
|
|
1456
|
+
},
|
|
1457
|
+
postAssignUser: (body, permissionType) => {
|
|
1458
|
+
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
1459
|
+
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
1460
|
+
return API$r.post(`/system-roles/total-control-read-only/${type}`, body);
|
|
1461
|
+
}
|
|
1462
|
+
return API$r.post(`/system-roles/permission/${permissionType}`, body);
|
|
1463
|
+
},
|
|
1464
|
+
putEditUser: (body, roleId) => {
|
|
1465
|
+
return API$r.put(`/system-roles/${roleId}`, body);
|
|
1466
|
+
},
|
|
1467
|
+
deleteRemoveUser: (body, permissionType) => {
|
|
1468
|
+
if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
|
|
1469
|
+
const type = permissionType === "totalControl" ? "total-control" : "read-only";
|
|
1470
|
+
return API$r.put(`/system-roles/total-control-read-only/${type}`, body);
|
|
1471
|
+
}
|
|
1472
|
+
return API$r.put("/system-roles", body);
|
|
1473
|
+
}
|
|
1474
|
+
};
|
|
1475
|
+
const API$q = createAxiosInstance({
|
|
1476
|
+
prefix: "/settings-attribute/v2/open-api"
|
|
1477
|
+
});
|
|
1478
|
+
const OpenAPIServices$1 = {
|
|
1479
|
+
getOpenAPIDocs: (params) => {
|
|
1480
|
+
return API$q.get(`/${params.doc}`);
|
|
1481
|
+
},
|
|
1482
|
+
putGenerateToken: () => {
|
|
1483
|
+
return API$q.put("/generate");
|
|
1484
|
+
},
|
|
1485
|
+
// This is if the dummy was not dummy
|
|
1486
|
+
getToken: () => {
|
|
1487
|
+
return API$q.get("");
|
|
1488
|
+
},
|
|
1489
|
+
putRequestOpenAPI: () => {
|
|
1490
|
+
return API$q.put("/request");
|
|
1491
|
+
},
|
|
1492
|
+
putCancelRequestOpenAPI: () => {
|
|
1493
|
+
return API$q.put("/cancel-request");
|
|
1494
|
+
}
|
|
1495
|
+
};
|
|
1496
|
+
const API$p = createAxiosInstance({
|
|
1497
|
+
prefix: "/settings-attribute-go/v2/open-api"
|
|
1498
|
+
});
|
|
1499
|
+
const OpenAPIServices = {
|
|
1500
|
+
putGenerateToken: () => {
|
|
1501
|
+
return API$p.put("/generate");
|
|
1502
|
+
},
|
|
1503
|
+
// This is if the dummy was not dummy
|
|
1504
|
+
getToken: () => {
|
|
1505
|
+
return API$p.get("");
|
|
1506
|
+
},
|
|
1507
|
+
putRequestOpenAPI: () => {
|
|
1508
|
+
return API$p.put("/request");
|
|
1509
|
+
},
|
|
1510
|
+
putCancelRequestOpenAPI: () => {
|
|
1511
|
+
return API$p.put("/cancel-request");
|
|
1512
|
+
}
|
|
1513
|
+
};
|
|
1514
|
+
const API$o = createAxiosInstance({
|
|
1515
|
+
prefix: "/import/v2"
|
|
1516
|
+
});
|
|
1517
|
+
const ImportServices$1 = {
|
|
1518
|
+
getImport: (importUrl, params) => {
|
|
1519
|
+
return API$o.get(`/${importUrl}`, { params });
|
|
1520
|
+
},
|
|
1521
|
+
postImportTemporary: (importUrl, data) => {
|
|
1522
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
1523
|
+
return API$o.post(`/${importUrl}/temporary`, data, { headers });
|
|
1524
|
+
},
|
|
1525
|
+
deleteImportTemporary: (importUrl, data) => {
|
|
1526
|
+
return API$o.delete(`/${importUrl}/temporary`, { data });
|
|
1527
|
+
},
|
|
1528
|
+
postDuplicateImport: (importUrl, body) => {
|
|
1529
|
+
return API$o.post(`/${importUrl}/duplicate`, body);
|
|
1530
|
+
},
|
|
1531
|
+
putEditImport: (importUrl, body) => {
|
|
1532
|
+
return API$o.put(`/${importUrl}`, body);
|
|
1533
|
+
},
|
|
1534
|
+
postImport: (importUrl, controller, body) => {
|
|
1535
|
+
return API$o.post(importUrl, body, { signal: controller.signal });
|
|
1536
|
+
},
|
|
1537
|
+
putImportCancelProgress: (importUrl) => {
|
|
1538
|
+
return API$o.put(`/${importUrl}/cancel-progress`);
|
|
1539
|
+
}
|
|
1540
|
+
};
|
|
1541
|
+
const API$n = createAxiosInstance({
|
|
1542
|
+
prefix: "/import-go/v2"
|
|
1543
|
+
});
|
|
1544
|
+
const ImportServices = {
|
|
1545
|
+
getImport: (importUrl, params) => {
|
|
1546
|
+
return API$n.get(`/${importUrl}`, { params });
|
|
1547
|
+
},
|
|
1548
|
+
postImportTemporary: (importUrl, data) => {
|
|
1549
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
1550
|
+
return API$n.post(`/${importUrl}/temporary`, data, { headers });
|
|
1551
|
+
},
|
|
1552
|
+
deleteImportTemporary: (importUrl, params) => {
|
|
1553
|
+
return API$n.delete(`/${importUrl}/temporary`, { params });
|
|
1554
|
+
},
|
|
1555
|
+
postDuplicateImport: (importUrl, body) => {
|
|
1556
|
+
return API$n.post(`/${importUrl}/duplicate`, body);
|
|
1557
|
+
},
|
|
1558
|
+
putEditImport: (importUrl, body) => {
|
|
1559
|
+
return API$n.put(`/${importUrl}`, body);
|
|
1560
|
+
},
|
|
1561
|
+
postImport: (importUrl, controller, body) => {
|
|
1562
|
+
return API$n.post(importUrl, body, { signal: controller.signal });
|
|
1563
|
+
},
|
|
1564
|
+
putImportCancelProgress: (importUrl) => {
|
|
1565
|
+
return API$n.put(`/${importUrl}/cancel-progress`);
|
|
1566
|
+
}
|
|
1567
|
+
};
|
|
1568
|
+
const API$m = createAxiosInstance({
|
|
1569
|
+
prefix: "/settings-attribute/v2/asset-name"
|
|
1570
|
+
});
|
|
1571
|
+
const AssetNameServices = {
|
|
1572
|
+
getDropdown: (params) => {
|
|
1573
|
+
return API$m.get("/dropdown", { params });
|
|
1574
|
+
},
|
|
1575
|
+
getAssetNameDetail: (id) => {
|
|
1576
|
+
return API$m.get(`/${id}`);
|
|
1577
|
+
},
|
|
1578
|
+
getAssetsByAssetName: (id, params) => {
|
|
1579
|
+
return API$m.get(`/${id}/list-asset`, { params });
|
|
1580
|
+
},
|
|
1581
|
+
getAssetNameList: (params) => {
|
|
1582
|
+
return API$m.get("/", { params });
|
|
1583
|
+
},
|
|
1584
|
+
getUnpairedAssetName: (params) => {
|
|
1585
|
+
return API$m.get("/unpaired", { params });
|
|
1586
|
+
},
|
|
1587
|
+
getOptions: (params) => {
|
|
1588
|
+
return API$m.get("/options", { params });
|
|
1589
|
+
}
|
|
1590
|
+
};
|
|
1591
|
+
const API$l = createAxiosInstance({
|
|
1592
|
+
prefix: "/assignment/v2"
|
|
1593
|
+
});
|
|
1594
|
+
const AssignmentServices$1 = {
|
|
1595
|
+
getPreListData: (params) => {
|
|
1596
|
+
return API$l.get("/prelist", { params });
|
|
1597
|
+
},
|
|
1598
|
+
getPreListOptions: (params) => {
|
|
1599
|
+
return API$l.get("/prelist/options", { params });
|
|
1600
|
+
},
|
|
1601
|
+
getRequestData: (params) => {
|
|
1602
|
+
return API$l.get("/prelist/request", { params });
|
|
1603
|
+
},
|
|
1604
|
+
postAddPrelistData: (body) => {
|
|
1605
|
+
return API$l.post("/prelist", body);
|
|
1606
|
+
},
|
|
1607
|
+
getDetailRequestData: (id, params) => {
|
|
1608
|
+
return API$l.get(`/transaction/${id}/request`, { params });
|
|
1609
|
+
},
|
|
1610
|
+
getDetailRequestOption: (params, id) => {
|
|
1611
|
+
return API$l.get(`/transaction/${id}/request/options`, { params });
|
|
1612
|
+
},
|
|
1613
|
+
getTransactionData: (params) => {
|
|
1614
|
+
return API$l.get("/transaction", { params });
|
|
1615
|
+
},
|
|
1616
|
+
getTransactionOptions: (params) => {
|
|
1617
|
+
return API$l.get("/transaction/options", { params });
|
|
1618
|
+
},
|
|
1619
|
+
getDetailTransactionData: (id) => {
|
|
1620
|
+
return API$l.get(`/transaction/${id}`);
|
|
1621
|
+
},
|
|
1622
|
+
getTransactionApproval: (params) => {
|
|
1623
|
+
return API$l.get("/approval", { params });
|
|
1624
|
+
},
|
|
1625
|
+
getApprovalData: (transactionId, params) => {
|
|
1626
|
+
return API$l.get(`/approval/transaction/${transactionId}`, { params });
|
|
1627
|
+
},
|
|
1628
|
+
getTransactionApprovalOptions: (params) => {
|
|
1629
|
+
return API$l.get("/approval/options", { params });
|
|
1630
|
+
},
|
|
1631
|
+
getApprovalOptions: (transactionId, params) => {
|
|
1632
|
+
return API$l.get(`/approval/transaction/${transactionId}/options`, {
|
|
1633
|
+
params
|
|
1634
|
+
});
|
|
1635
|
+
},
|
|
1636
|
+
getTransactionApprovers: (id) => {
|
|
1637
|
+
return API$l.get(`/approval/transaction/${id}/transaction`);
|
|
1638
|
+
},
|
|
1639
|
+
putApproveApproval: (body) => {
|
|
1640
|
+
return API$l.put("/approval/approve", body);
|
|
1641
|
+
},
|
|
1642
|
+
getDetailTransactionLog: (id) => {
|
|
1643
|
+
return API$l.get(`/transaction/request/${id}/transaction-log`);
|
|
1644
|
+
},
|
|
1645
|
+
getVerifyAsset: (params, id) => {
|
|
1646
|
+
return API$l.get(`/transaction/${id}/request/scan`, { params });
|
|
1647
|
+
},
|
|
1648
|
+
putEditAssignedUser: (id, body) => {
|
|
1649
|
+
return API$l.put(`/transaction/${id}/user`, body);
|
|
1650
|
+
},
|
|
1651
|
+
putEditEmailConfirmation: (id, body) => {
|
|
1652
|
+
return API$l.put(`/transaction/${id}/update-email-or-assigned-user`, body);
|
|
1653
|
+
},
|
|
1654
|
+
postSendConfirmationEmail: (id) => {
|
|
1655
|
+
return API$l.post(`/transaction/${id}/send-confirmation-email`);
|
|
1656
|
+
},
|
|
1657
|
+
postTransaction: (body) => {
|
|
1658
|
+
return API$l.post("/transaction", body);
|
|
1659
|
+
},
|
|
1660
|
+
putTransaction: (id, body) => {
|
|
1661
|
+
return API$l.put(`/transaction/${id}/request`, body);
|
|
1662
|
+
},
|
|
1663
|
+
putCancelTransaction: (body) => {
|
|
1664
|
+
return API$l.put("/transaction/cancel", body);
|
|
1665
|
+
},
|
|
1666
|
+
putCancelAssignmentRequest: (body) => {
|
|
1667
|
+
return API$l.put("/transaction/request/cancel", body);
|
|
1668
|
+
},
|
|
1669
|
+
putVerifyRequest: (body, id) => {
|
|
1670
|
+
return API$l.put(`/transaction/${id}/verify-requests`, body);
|
|
1671
|
+
},
|
|
1672
|
+
putVerifyToken: (body) => {
|
|
1673
|
+
return API$l.put("/transaction/verify-token", body);
|
|
1674
|
+
},
|
|
1675
|
+
putHandoverConfirm: (body) => {
|
|
1676
|
+
return API$l.put("/transaction/handover-confirmation", body);
|
|
1677
|
+
},
|
|
1678
|
+
putAssignHandover: (transaction) => {
|
|
1679
|
+
return API$l.put(`/transaction/${transaction}/handover`);
|
|
1680
|
+
},
|
|
1681
|
+
deletePrelistData: (params) => {
|
|
1682
|
+
return API$l.delete("/prelist", { params });
|
|
1683
|
+
},
|
|
1684
|
+
deleteRequestPrelistData: (body) => {
|
|
1685
|
+
return API$l.delete("/prelist/request", { data: body });
|
|
1686
|
+
},
|
|
1687
|
+
getAssignedByAsset: (params) => {
|
|
1688
|
+
return API$l.get("/transaction/request/assigned/by-asset", { params });
|
|
1689
|
+
},
|
|
1690
|
+
getAssignedByAssetOptions: (params) => {
|
|
1691
|
+
return API$l.get("/transaction/request/assigned/by-asset/options", {
|
|
1692
|
+
params
|
|
1693
|
+
});
|
|
1694
|
+
},
|
|
1695
|
+
getAssignedByUser: (params) => {
|
|
1696
|
+
return API$l.get("/transaction/request/assigned/by-user", { params });
|
|
1697
|
+
},
|
|
1698
|
+
getAssignedByUserOptions: (params) => {
|
|
1699
|
+
return API$l.get("/transaction/request/assigned/by-user/options", { params });
|
|
1700
|
+
},
|
|
1701
|
+
postUnassignPrelistAsset: (body) => {
|
|
1702
|
+
return API$l.post("/prelist", body);
|
|
1703
|
+
},
|
|
1704
|
+
postUnassignPrelistUser: (body) => {
|
|
1705
|
+
return API$l.post("/prelist/unassign/by-user", body);
|
|
1706
|
+
},
|
|
1707
|
+
putUnassignRequest: (body) => {
|
|
1708
|
+
return API$l.put("/transaction/request/unassign", body);
|
|
1709
|
+
},
|
|
1710
|
+
putReportDone: (id, body) => {
|
|
1711
|
+
return API$l.put(`/transaction/${id}/confirm-report-done`, body);
|
|
1712
|
+
},
|
|
1713
|
+
getHistory: (type, params) => {
|
|
1714
|
+
const urlType = type.split(" ").join("-").toLowerCase();
|
|
1715
|
+
return API$l.get(`/transaction/history/${urlType}`, { params });
|
|
1716
|
+
},
|
|
1717
|
+
getHistoryOptions: (params) => {
|
|
1718
|
+
return API$l.get("/transaction/history/options", { params });
|
|
1719
|
+
},
|
|
1720
|
+
getHistoryByTransactionOptions: (params) => {
|
|
1721
|
+
return API$l.get("/transaction/history/by-transaction/options", { params });
|
|
1722
|
+
},
|
|
1723
|
+
putCancelReport: (body) => {
|
|
1724
|
+
return API$l.put("/transaction/request/cancel-report", body);
|
|
1725
|
+
},
|
|
1726
|
+
getTaskAssignment: async (params) => {
|
|
1727
|
+
return API$l.get("/transaction/my-asset/task", { params });
|
|
1728
|
+
},
|
|
1729
|
+
getTaskAssignmentOptions: async (params) => {
|
|
1730
|
+
return API$l.get("/transaction/my-asset/task/options", { params });
|
|
1731
|
+
},
|
|
1732
|
+
getAssignedAsset: async (params) => {
|
|
1733
|
+
return API$l.get("/transaction/my-asset/assigned-asset", { params });
|
|
1734
|
+
},
|
|
1735
|
+
getAssignedAssetOptions: async (params) => {
|
|
1736
|
+
return API$l.get("/transaction/my-asset/assigned-asset/options", { params });
|
|
1737
|
+
},
|
|
1738
|
+
putCancelAssignment: async (body) => {
|
|
1739
|
+
return API$l.put("/transaction/cancel", { id: body.id });
|
|
1740
|
+
},
|
|
1741
|
+
putCancelReportById: async (body) => {
|
|
1742
|
+
return API$l.put(`/transaction/request/${body.id}/cancel-report`);
|
|
1743
|
+
}
|
|
1744
|
+
};
|
|
1745
|
+
const API$k = createAxiosInstance({
|
|
1746
|
+
prefix: "/assignment-go/v2"
|
|
1747
|
+
});
|
|
1748
|
+
const AssignmentServices = {
|
|
1749
|
+
getTransactionData: (params) => {
|
|
1750
|
+
return API$k.get("/transaction", { params });
|
|
1751
|
+
},
|
|
1752
|
+
getTransactionOptions: (params) => {
|
|
1753
|
+
return API$k.get("/transaction/options", { params });
|
|
1754
|
+
},
|
|
1755
|
+
getDetailTransactionLog: (id) => {
|
|
1756
|
+
return API$k.get(`/transaction/request/${id}/transaction-log`);
|
|
1757
|
+
},
|
|
1758
|
+
postTransaction: (body) => {
|
|
1759
|
+
return API$k.post("/transaction", body);
|
|
1760
|
+
},
|
|
1761
|
+
putTransaction: (body) => {
|
|
1762
|
+
return API$k.put("/transaction", body);
|
|
1763
|
+
},
|
|
1764
|
+
putUnassignTransaction: (body) => {
|
|
1765
|
+
return API$k.put("/transaction/unassign", body);
|
|
1766
|
+
},
|
|
1767
|
+
putCancelReport: (body) => {
|
|
1768
|
+
return API$k.put("/transaction/request/cancel-report", body);
|
|
1769
|
+
}
|
|
1770
|
+
};
|
|
1771
|
+
const API$j = createAxiosInstance({
|
|
1772
|
+
prefix: "/license/v2"
|
|
1773
|
+
});
|
|
1774
|
+
const TotalLicenseServices$1 = {
|
|
1775
|
+
getTotalLicense: () => {
|
|
1776
|
+
return API$j.get("/total-license");
|
|
1777
|
+
},
|
|
1778
|
+
getPurchasedData: (params) => {
|
|
1779
|
+
return API$j.get("/purchase", { params });
|
|
1780
|
+
},
|
|
1781
|
+
getCompanyData: () => {
|
|
1782
|
+
return API$j.get("/company");
|
|
1783
|
+
}
|
|
1784
|
+
};
|
|
1785
|
+
const LicenseAssetAddonServices = {
|
|
1786
|
+
getFixedAssetPerGroup: (groupId, params) => {
|
|
1787
|
+
return API$j.get(`/${groupId}/fixed-asset-list`, { params });
|
|
1788
|
+
},
|
|
1789
|
+
getAssetNameList: (addOnType, groupId, params) => {
|
|
1790
|
+
return API$j.get(`${groupId}/asset-list/${addOnType}`, { params });
|
|
1791
|
+
},
|
|
1792
|
+
// Get list of assets those already have licenses
|
|
1793
|
+
getLicenseAddonAssetList: (groupId, addOnType, params) => {
|
|
1794
|
+
return API$j.get(`/${groupId}/fixed-asset-list/${addOnType}`, { params });
|
|
1795
|
+
},
|
|
1796
|
+
removeAddOnLicense: (body, addOnType) => {
|
|
1797
|
+
return API$j.put(`/remove-license/${addOnType}`, body);
|
|
1798
|
+
},
|
|
1799
|
+
addNewLicenses: (body, addOnType) => {
|
|
1800
|
+
return API$j.put(`/add-license/${addOnType}`, body);
|
|
1801
|
+
},
|
|
1802
|
+
deleteAssetData: (body) => {
|
|
1803
|
+
return API$j.delete("/assets", { data: body });
|
|
1804
|
+
},
|
|
1805
|
+
putManageLicense: (licenseType, body) => {
|
|
1806
|
+
return API$j.put(
|
|
1807
|
+
`/manage/${licenseType.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}`,
|
|
1808
|
+
body
|
|
1809
|
+
);
|
|
1810
|
+
}
|
|
1811
|
+
};
|
|
1812
|
+
const LicenseAllocationServices = {
|
|
1813
|
+
getGroupQuota: (groupId) => {
|
|
1814
|
+
return API$j.get(`/${groupId}/allocation-quota`);
|
|
1815
|
+
},
|
|
1816
|
+
getSubGroupQuota: (parentId, params) => {
|
|
1817
|
+
return API$j.get(`/${parentId}/subgroup-quota`, { params });
|
|
1818
|
+
},
|
|
1819
|
+
editSubGroupQuota: (subGroupId, body) => {
|
|
1820
|
+
return API$j.put(`/${subGroupId}/set-group-quota`, body);
|
|
1821
|
+
}
|
|
1822
|
+
};
|
|
1823
|
+
const LicenseConcurrentServices$1 = {
|
|
1824
|
+
getConcurrentUserData: () => {
|
|
1825
|
+
return API$j.get("/concurrent-user-data");
|
|
1826
|
+
},
|
|
1827
|
+
getConcurrentUserList: (params) => {
|
|
1828
|
+
return API$j.get("/concurrent-user", { params });
|
|
1829
|
+
},
|
|
1830
|
+
putLogoutUsers: (body) => {
|
|
1831
|
+
return API$j.put("/concurrent-user", body);
|
|
1832
|
+
}
|
|
1833
|
+
};
|
|
1834
|
+
const LicenseServices$1 = {
|
|
1835
|
+
getFilterOptions: (path, params) => {
|
|
1836
|
+
return API$j.get(`/${path}`, { params });
|
|
1837
|
+
},
|
|
1838
|
+
...TotalLicenseServices$1,
|
|
1839
|
+
...LicenseConcurrentServices$1,
|
|
1840
|
+
...LicenseAllocationServices,
|
|
1841
|
+
...LicenseAssetAddonServices
|
|
1842
|
+
};
|
|
1843
|
+
const API$i = createAxiosInstance({
|
|
1844
|
+
prefix: "/license-go/v2"
|
|
1845
|
+
});
|
|
1846
|
+
const TotalLicenseServices = {
|
|
1847
|
+
getTotalLicense: () => {
|
|
1848
|
+
return API$i.get("/total-license");
|
|
1849
|
+
},
|
|
1850
|
+
getPurchasedData: (params) => {
|
|
1851
|
+
return API$i.get("/purchase", { params });
|
|
1852
|
+
}
|
|
1853
|
+
};
|
|
1854
|
+
const LicenseConcurrentServices = {
|
|
1855
|
+
getConcurrentUserData: () => {
|
|
1856
|
+
return API$i.get("/concurrent-user-data");
|
|
1857
|
+
},
|
|
1858
|
+
getConcurrentUserList: (params) => {
|
|
1859
|
+
return API$i.get("/concurrent-user", { params });
|
|
1860
|
+
},
|
|
1861
|
+
putLogoutUsers: (body) => {
|
|
1862
|
+
return API$i.put("/concurrent-user", body);
|
|
1863
|
+
}
|
|
1864
|
+
};
|
|
1865
|
+
const LicenseAssetServices = {
|
|
1866
|
+
getFixedAssetPerGroup: (groupId, params) => {
|
|
1867
|
+
return API$i.get(`/${groupId}/assets`, { params });
|
|
1868
|
+
},
|
|
1869
|
+
deleteAssetData: (body) => {
|
|
1870
|
+
return API$i.delete("/assets", { data: body });
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
const LicenseServices = {
|
|
1874
|
+
getFilterOptions: (path, params) => {
|
|
1875
|
+
return API$i.get(`/${path}`, { params });
|
|
1876
|
+
},
|
|
1877
|
+
...TotalLicenseServices,
|
|
1878
|
+
...LicenseConcurrentServices,
|
|
1879
|
+
...LicenseAssetServices
|
|
1880
|
+
};
|
|
1881
|
+
const API$h = createAxiosInstance({
|
|
1882
|
+
prefix: "/repair/v2/damage"
|
|
1883
|
+
});
|
|
1884
|
+
const DamageServices$1 = {
|
|
1885
|
+
getDamageReportList: (params) => {
|
|
1886
|
+
return API$h.get("/", { params });
|
|
1887
|
+
},
|
|
1888
|
+
getDamageReportListFilterOptions: (params) => {
|
|
1889
|
+
return API$h.get("/options", { params });
|
|
1890
|
+
},
|
|
1891
|
+
getDamageReportDetail: (reportId) => {
|
|
1892
|
+
return API$h.get(`/${reportId}`);
|
|
1893
|
+
},
|
|
1894
|
+
putReportDamage: (id, body) => {
|
|
1895
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
1896
|
+
return API$h.put(`/report-damage/${id}`, body, { headers });
|
|
1897
|
+
},
|
|
1898
|
+
/**
|
|
1899
|
+
* To mark as repaired.
|
|
1900
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
1901
|
+
*/
|
|
1902
|
+
putMarkAsRepaired: (body) => {
|
|
1903
|
+
return API$h.put("/repair", body);
|
|
1904
|
+
}
|
|
1905
|
+
};
|
|
1906
|
+
const API$g = createAxiosInstance({
|
|
1907
|
+
prefix: "/damage-repair-ticketing/v2"
|
|
1908
|
+
});
|
|
1909
|
+
const DamageServices = {
|
|
1910
|
+
getDamageReportList: (params) => {
|
|
1911
|
+
return API$g.get("/", { params });
|
|
1912
|
+
},
|
|
1913
|
+
getDamageReportListFilterOptions: (params) => {
|
|
1914
|
+
return API$g.get("/options", { params });
|
|
1915
|
+
},
|
|
1916
|
+
getDamageReportDetail: (reportId) => {
|
|
1917
|
+
return API$g.get(`/${reportId}`);
|
|
1918
|
+
},
|
|
1919
|
+
putReportDamage: (id, body) => {
|
|
1920
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
1921
|
+
return API$g.put(`/${id}/report-damage`, body, { headers });
|
|
1922
|
+
},
|
|
1923
|
+
putMarkAsRepaired: (body) => {
|
|
1924
|
+
return API$g.put("/repair", body);
|
|
1925
|
+
}
|
|
1926
|
+
};
|
|
1927
|
+
const API$f = createAxiosInstance({
|
|
1928
|
+
prefix: "/borrowing/v2"
|
|
1929
|
+
});
|
|
1930
|
+
const BorrowServices = {
|
|
1931
|
+
getTaskBorrowing: async (params) => {
|
|
1932
|
+
return API$f.get("/transaction/my-asset/task", { params });
|
|
1933
|
+
},
|
|
1934
|
+
getTaskBorrowingOptions: async (params) => {
|
|
1935
|
+
return API$f.get("/transaction/my-asset/task/options", { params });
|
|
1936
|
+
},
|
|
1937
|
+
getBorrowedAsset: async (params) => {
|
|
1938
|
+
return API$f.get("/transaction/my-asset/borrowed-asset", { params });
|
|
1939
|
+
},
|
|
1940
|
+
getBorrowedOptions: async (params) => {
|
|
1941
|
+
return API$f.get("/transaction/my-asset/borrowed-asset/options", { params });
|
|
1942
|
+
},
|
|
1943
|
+
getHistory: async (params) => {
|
|
1944
|
+
return API$f.get("/transaction/my-asset/history", { params });
|
|
1945
|
+
},
|
|
1946
|
+
getHistoryOptions: async (params) => {
|
|
1947
|
+
return API$f.get("/transaction/my-asset/history/options", { params });
|
|
1948
|
+
},
|
|
1949
|
+
postAddPrelistData: (body) => {
|
|
1950
|
+
return API$f.post("/prelist", body);
|
|
1951
|
+
},
|
|
1952
|
+
putCancelBorrowing: async (body) => {
|
|
1953
|
+
return API$f.put("/transaction/cancel", { id: body.id });
|
|
1954
|
+
},
|
|
1955
|
+
putCancelExtensionRequest: async (body) => {
|
|
1956
|
+
return API$f.put(`/transaction/${body.id}/cancel-extension`);
|
|
1957
|
+
},
|
|
1958
|
+
putCancelRequestReport: async (body) => {
|
|
1959
|
+
return API$f.put(`/transaction/request/${body.id}/cancel-report`);
|
|
1960
|
+
},
|
|
1961
|
+
putDeclineExtensionRequest: async (body) => {
|
|
1962
|
+
return API$f.put("transaction/request/decline", body);
|
|
1963
|
+
},
|
|
1964
|
+
putUpdateRequestExtension: async (body) => {
|
|
1965
|
+
return API$f.put("transaction/request/duration", body);
|
|
1966
|
+
},
|
|
1967
|
+
// ------------------------------------------------------------------------------------------------------------ //
|
|
1968
|
+
getBorrowingPrelist: (params) => {
|
|
1969
|
+
return API$f.get("/prelist", { params });
|
|
1970
|
+
},
|
|
1971
|
+
getBorrowingPrelistOptions: (params) => {
|
|
1972
|
+
return API$f.get("/prelist/options", { params });
|
|
1973
|
+
},
|
|
1974
|
+
deleteBorrowingPrelist: (id) => {
|
|
1975
|
+
return API$f.delete("/prelist", { data: { id } });
|
|
1976
|
+
},
|
|
1977
|
+
getBorrowingRequest: (params) => {
|
|
1978
|
+
return API$f.get("/prelist/request", { params });
|
|
1979
|
+
},
|
|
1980
|
+
getBorrowingRequestOptions: (params) => {
|
|
1981
|
+
return API$f.get("/prelist/request/options", { params });
|
|
1982
|
+
},
|
|
1983
|
+
postBorrowingRequest: (data) => {
|
|
1984
|
+
return API$f.post("/prelist/request", data);
|
|
1985
|
+
},
|
|
1986
|
+
putBorrowingRequest: (data) => {
|
|
1987
|
+
return API$f.put("/prelist/request", data);
|
|
1988
|
+
},
|
|
1989
|
+
deleteBorrowingRequest: (id) => {
|
|
1990
|
+
return API$f.delete("/prelist/request", { data: { id } });
|
|
1991
|
+
},
|
|
1992
|
+
postBorrowingTransaction: (data) => {
|
|
1993
|
+
return API$f.post("/transaction", data, { params: { sourceWeb: true } });
|
|
1994
|
+
},
|
|
1995
|
+
getBorrowingTransaction: (params) => {
|
|
1996
|
+
return API$f.get("/transaction", { params });
|
|
1997
|
+
},
|
|
1998
|
+
getBorrowingTransactionOptions: (params) => {
|
|
1999
|
+
return API$f.get("/transaction/options", { params });
|
|
2000
|
+
},
|
|
2001
|
+
putCancelBorrowingTransaction: (id) => {
|
|
2002
|
+
return API$f.put("/transaction/cancel", { id });
|
|
2003
|
+
},
|
|
2004
|
+
putCancelBorrowingRequest: (id) => {
|
|
2005
|
+
return API$f.put("/transaction/request/cancel", { id });
|
|
2006
|
+
},
|
|
2007
|
+
putCancelExtendBorrowingRequest: (id) => {
|
|
2008
|
+
return API$f.put("/transaction/request/extend/cancel", { id });
|
|
2009
|
+
},
|
|
2010
|
+
getBorrowingTransactionDetail: (id) => {
|
|
2011
|
+
return API$f.get(`/transaction/${id}`);
|
|
2012
|
+
},
|
|
2013
|
+
getBorrowingTransactionRequestList: (params) => {
|
|
2014
|
+
return API$f.get("/transaction/request", { params });
|
|
2015
|
+
},
|
|
2016
|
+
getBorrowingTransactionRequest: (id, params) => {
|
|
2017
|
+
return API$f.get(`/transaction/${id}/request`, { params });
|
|
2018
|
+
},
|
|
2019
|
+
getBorrowingTransactionRequestOptions: (id, params) => {
|
|
2020
|
+
return API$f.get(`/transaction/${id}/request/options`, { params });
|
|
2021
|
+
},
|
|
2022
|
+
putBorrowingTransactionRequest: (id, data) => {
|
|
2023
|
+
return API$f.put(`/transaction/${id}/request`, data);
|
|
2024
|
+
},
|
|
2025
|
+
getApprovalList: (id) => {
|
|
2026
|
+
return API$f.get(`/approval/transaction/${id}/transaction`);
|
|
2027
|
+
},
|
|
2028
|
+
putUpdateEmailorBorrower: (id, data) => {
|
|
2029
|
+
return API$f.put(`/transaction/${id}/update-email-or-borrower`, data);
|
|
2030
|
+
},
|
|
2031
|
+
getTransactionRequestScan: (id, tag) => {
|
|
2032
|
+
return API$f.get(`/transaction/${id}/request/scan`, { params: { tag } });
|
|
2033
|
+
},
|
|
2034
|
+
putUpdateBorrower: (id, userId) => {
|
|
2035
|
+
return API$f.put(`/transaction/${id}/user`, { user: userId });
|
|
2036
|
+
},
|
|
2037
|
+
postSendConfirmationEmail: (id) => {
|
|
2038
|
+
return API$f.post(`/transaction/${id}/send-confirmation-email`);
|
|
2039
|
+
},
|
|
2040
|
+
putVerifyRequests: (id, data) => {
|
|
2041
|
+
return API$f.put(`/transaction/${id}/verify-requests`, data);
|
|
2042
|
+
},
|
|
2043
|
+
getBorrowingTransactionHistoryByTransaction: (params) => {
|
|
2044
|
+
return API$f.get("/transaction/history/by-transaction", { params });
|
|
2045
|
+
},
|
|
2046
|
+
getBorrowingTransactionHistoryByAsset: (params) => {
|
|
2047
|
+
return API$f.get("/transaction/history/by-asset", { params });
|
|
2048
|
+
},
|
|
2049
|
+
getBorrowingTransactionHistoryOptions: (params) => {
|
|
2050
|
+
return API$f.get("/transaction/history/options", { params });
|
|
2051
|
+
},
|
|
2052
|
+
putBorrowingVerifyToken: (token) => {
|
|
2053
|
+
return API$f.put("/transaction/verify-token", { token });
|
|
2054
|
+
},
|
|
2055
|
+
putBorrowingHandoverConfirmation: (data) => {
|
|
2056
|
+
return API$f.put("/transaction/handover-confirmation", data);
|
|
2057
|
+
},
|
|
2058
|
+
putBorrowingHandover: (id) => {
|
|
2059
|
+
return API$f.put(`/transaction/${id}/handover`);
|
|
2060
|
+
},
|
|
2061
|
+
putBorrowingExtendRequest: (data) => {
|
|
2062
|
+
return API$f.put("/transaction/request/extend", data);
|
|
2063
|
+
},
|
|
2064
|
+
putBorrowingExtendApproval: (data) => {
|
|
2065
|
+
return API$f.put("/approval/approve/request-extension", data, {
|
|
2066
|
+
params: { sourceWeb: true }
|
|
2067
|
+
});
|
|
2068
|
+
},
|
|
2069
|
+
putBorrowingDeclineExtendRequest: (id) => {
|
|
2070
|
+
return API$f.put("/transaction/request/decline", { id });
|
|
2071
|
+
},
|
|
2072
|
+
getBorrowingBorrowedAsset: (params) => {
|
|
2073
|
+
return API$f.get("/transaction/request/borrowed/by-asset", { params });
|
|
2074
|
+
},
|
|
2075
|
+
getBorrowingBorrowedAssetOptions: (params) => {
|
|
2076
|
+
return API$f.get("/transaction/request/borrowed/by-asset/options", {
|
|
2077
|
+
params
|
|
2078
|
+
});
|
|
2079
|
+
},
|
|
2080
|
+
getBorrowingBorrowedBorrower: (params) => {
|
|
2081
|
+
return API$f.get("/transaction/request/borrowed/by-user", { params });
|
|
2082
|
+
},
|
|
2083
|
+
putBorrowingReportDamaged: (id, data) => {
|
|
2084
|
+
return API$f.put(`/transaction/request/${id}/damaged`, data);
|
|
2085
|
+
},
|
|
2086
|
+
putBorrowingReportMissing: (id, data) => {
|
|
2087
|
+
return API$f.put(`/transaction/request/${id}/missing`, data);
|
|
2088
|
+
},
|
|
2089
|
+
putBorrowingReturn: (id) => {
|
|
2090
|
+
return API$f.put("/transaction/request/return", { id });
|
|
2091
|
+
},
|
|
2092
|
+
getBorrowingLog: (id) => {
|
|
2093
|
+
return API$f.get(`/transaction/request/${id}/transaction-log`);
|
|
2094
|
+
},
|
|
2095
|
+
putConfirmReportDone: (id, data) => {
|
|
2096
|
+
return API$f.put(`/transaction/request/${id}/confirm-report-done`, data);
|
|
2097
|
+
},
|
|
2098
|
+
putCancelReportBulk: (id) => {
|
|
2099
|
+
return API$f.put("/transaction/request/cancel-report", {
|
|
2100
|
+
id
|
|
2101
|
+
});
|
|
2102
|
+
},
|
|
2103
|
+
putBorrowingEditExtension: (data) => {
|
|
2104
|
+
return API$f.put("/transaction/request/duration", data);
|
|
2105
|
+
},
|
|
2106
|
+
getApproval: (params) => {
|
|
2107
|
+
return API$f.get("/approval", { params });
|
|
2108
|
+
},
|
|
2109
|
+
getApprovalOptions: (params) => {
|
|
2110
|
+
return API$f.get("/approval/options", { params });
|
|
2111
|
+
},
|
|
2112
|
+
getApprovalTransactionRequest: (id, params) => {
|
|
2113
|
+
return API$f.get(`/approval/transaction/${id}`, { params });
|
|
2114
|
+
},
|
|
2115
|
+
getApprovalTransactionRequestOptions: (id, params) => {
|
|
2116
|
+
return API$f.get(`/approval/transaction/${id}/options`, { params });
|
|
2117
|
+
},
|
|
2118
|
+
putApprovalApprove: (data) => {
|
|
2119
|
+
return API$f.put("/approval/approve", data, {
|
|
2120
|
+
params: { sourceWeb: true }
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
};
|
|
2124
|
+
const API$e = createAxiosInstance({
|
|
2125
|
+
prefix: "/assets/v2"
|
|
2126
|
+
});
|
|
2127
|
+
const MyAssetServices$1 = {
|
|
2128
|
+
getHistory: async (params) => {
|
|
2129
|
+
return API$e.get("/my-asset", { params });
|
|
2130
|
+
},
|
|
2131
|
+
getHistoryOptions: async (params) => {
|
|
2132
|
+
return API$e.get("/my-asset/options", { params });
|
|
2133
|
+
}
|
|
2134
|
+
};
|
|
2135
|
+
const API$d = createAxiosInstance({
|
|
2136
|
+
prefix: "/assets-go/v2/my-assets"
|
|
2137
|
+
});
|
|
2138
|
+
const MyAssetServices = {
|
|
2139
|
+
getAssigned: async (params) => {
|
|
2140
|
+
return API$d.get("/assigned", { params });
|
|
2141
|
+
},
|
|
2142
|
+
getAssignedOptions: async (params) => {
|
|
2143
|
+
return API$d.get("/assigned/options", { params });
|
|
2144
|
+
},
|
|
2145
|
+
getBorrowed: async (params) => {
|
|
2146
|
+
return API$d.get("/borrowed", { params });
|
|
2147
|
+
},
|
|
2148
|
+
getBorrowedOptions: async (params) => {
|
|
2149
|
+
return API$d.get("/borrowed/options", { params });
|
|
2150
|
+
},
|
|
2151
|
+
getHistory: async (params) => {
|
|
2152
|
+
return API$d.get("/history", { params });
|
|
2153
|
+
},
|
|
2154
|
+
getHistoryOptions: async (params) => {
|
|
2155
|
+
return API$d.get("/history/options", { params });
|
|
2156
|
+
}
|
|
2157
|
+
};
|
|
2158
|
+
const API$c = createAxiosInstance({
|
|
2159
|
+
prefix: "/repair/v2"
|
|
2160
|
+
});
|
|
2161
|
+
const RepairServices = {
|
|
2162
|
+
getRepairList: (params) => {
|
|
2163
|
+
return API$c.get("/my-asset/repair", { params });
|
|
2164
|
+
},
|
|
2165
|
+
getFilterOptions: (params) => {
|
|
2166
|
+
return API$c.get("/my-asset/repair/options", { params });
|
|
2167
|
+
},
|
|
2168
|
+
getAssetRepairTicketing: (assetId, params) => {
|
|
2169
|
+
return API$c.get(`/repair/${assetId}/asset-repair-detail`, { params });
|
|
2170
|
+
},
|
|
2171
|
+
putConfirmRepair: (repairId) => {
|
|
2172
|
+
return API$c.put(`/repair/${repairId}/confirm-repair`);
|
|
2173
|
+
}
|
|
2174
|
+
};
|
|
2175
|
+
const API$b = createAxiosInstance({
|
|
2176
|
+
prefix: "/settings-user-role-go/v2/auth"
|
|
2177
|
+
});
|
|
2178
|
+
const onRejected$1 = (error) => {
|
|
2179
|
+
var _a, _b, _c, _d;
|
|
2180
|
+
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") {
|
|
2181
|
+
window.onblur = void 0;
|
|
2182
|
+
window.onfocus = void 0;
|
|
2183
|
+
window.sessionExpired = true;
|
|
2184
|
+
return window.dispatchEvent(new CustomEvent("user:expired"));
|
|
2185
|
+
}
|
|
2186
|
+
return Promise.reject(error);
|
|
2187
|
+
};
|
|
2188
|
+
const AuthServices$1 = {
|
|
2189
|
+
reLogin: (body) => {
|
|
2190
|
+
API$b.interceptors.response.use((response) => {
|
|
2191
|
+
return response;
|
|
2192
|
+
}, onRejected$1);
|
|
2193
|
+
return API$b.post("/login", body);
|
|
2194
|
+
}
|
|
2195
|
+
};
|
|
2196
|
+
const API$a = createAxiosInstance({
|
|
2197
|
+
env: "APP_GLOBAL_SETTINGS_API",
|
|
2198
|
+
prefix: "/v1/global-settings/auth"
|
|
2199
|
+
});
|
|
2200
|
+
const onRejected = (error) => {
|
|
2201
|
+
var _a, _b, _c, _d;
|
|
2202
|
+
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") {
|
|
2203
|
+
window.onblur = void 0;
|
|
2204
|
+
window.onfocus = void 0;
|
|
2205
|
+
window.sessionExpired = true;
|
|
2206
|
+
return window.dispatchEvent(new CustomEvent("user:expired"));
|
|
2207
|
+
}
|
|
2208
|
+
return Promise.reject(error);
|
|
2209
|
+
};
|
|
2210
|
+
const AuthServices = {
|
|
2211
|
+
login: (form) => {
|
|
2212
|
+
const body = { ...form, isMobile: false };
|
|
2213
|
+
return API$a.post("/login", body);
|
|
2214
|
+
},
|
|
2215
|
+
reLogin: (body) => {
|
|
2216
|
+
API$a.interceptors.response.use((response) => {
|
|
2217
|
+
return response;
|
|
2218
|
+
}, onRejected);
|
|
2219
|
+
return API$a.post("/login", body);
|
|
2220
|
+
},
|
|
2221
|
+
requestOTP: (email) => {
|
|
2222
|
+
const body = { email };
|
|
2223
|
+
return API$a.post("/request-otp", body);
|
|
2224
|
+
},
|
|
2225
|
+
requestResetPassLink: (email) => {
|
|
2226
|
+
const body = { email };
|
|
2227
|
+
return API$a.post("/request-reset-link", body);
|
|
2228
|
+
},
|
|
2229
|
+
setPassword: (body) => {
|
|
2230
|
+
return API$a.post("/set-password", body);
|
|
2231
|
+
},
|
|
2232
|
+
verifyToken: (token) => {
|
|
2233
|
+
return API$a.get(`/verify-token/${token}`);
|
|
2234
|
+
},
|
|
2235
|
+
confirmEmailChange: (token) => {
|
|
2236
|
+
const body = { token };
|
|
2237
|
+
return API$a.put("/confirm-email-change/confirm", body);
|
|
2238
|
+
},
|
|
2239
|
+
postLogout: () => {
|
|
2240
|
+
return API$a.post("/logout");
|
|
2241
|
+
}
|
|
2242
|
+
};
|
|
2243
|
+
const PREFIX = "/transfer/v2";
|
|
2244
|
+
const PrelistAPI = createAxiosInstance({
|
|
2245
|
+
prefix: `${PREFIX}/prelist`
|
|
2246
|
+
});
|
|
2247
|
+
const TransactionAPI = createAxiosInstance({
|
|
2248
|
+
prefix: `${PREFIX}/transaction`
|
|
2249
|
+
});
|
|
2250
|
+
const ApprovalAPI$1 = createAxiosInstance({
|
|
2251
|
+
prefix: `${PREFIX}/approval`
|
|
2252
|
+
});
|
|
2253
|
+
const TransferServices = {
|
|
2254
|
+
// ------ TRANSACTION ------
|
|
2255
|
+
getTransactions: (params) => {
|
|
2256
|
+
return TransactionAPI.get("/", { params });
|
|
2257
|
+
},
|
|
2258
|
+
getTransactionDetail: (id) => {
|
|
2259
|
+
return TransactionAPI.get(`/${id}`);
|
|
2260
|
+
},
|
|
2261
|
+
getTransactionDetailAssets: (id, params) => {
|
|
2262
|
+
return TransactionAPI.get(`/${id}/request`, { params });
|
|
2263
|
+
},
|
|
2264
|
+
getRequestFilterOptions: (id, field) => {
|
|
2265
|
+
const params = {};
|
|
2266
|
+
if (field) {
|
|
2267
|
+
params[field] = true;
|
|
2268
|
+
} else {
|
|
2269
|
+
params.nameOptions = true;
|
|
2270
|
+
params.brandOptions = true;
|
|
2271
|
+
params.modelOptions = true;
|
|
2272
|
+
}
|
|
2273
|
+
return TransactionAPI.get(`/${id}/request/options`, { params });
|
|
2274
|
+
},
|
|
2275
|
+
getTransactionLog: (id) => {
|
|
2276
|
+
return TransactionAPI.get(`/request/${id}/transaction-log`);
|
|
2277
|
+
},
|
|
2278
|
+
getTransactionOptions: (field) => {
|
|
2279
|
+
const params = {};
|
|
2280
|
+
params[field] = true;
|
|
2281
|
+
return TransactionAPI.get("/options", { params });
|
|
2282
|
+
},
|
|
2283
|
+
postCreateTransaction: (body) => {
|
|
2284
|
+
return TransactionAPI.post("/", body);
|
|
2285
|
+
},
|
|
2286
|
+
putCancelTransactions: (ids) => {
|
|
2287
|
+
const body = { id: ids };
|
|
2288
|
+
return TransactionAPI.put("/cancel", body);
|
|
2289
|
+
},
|
|
2290
|
+
putUpdateTransaction: (id, body) => {
|
|
2291
|
+
return TransactionAPI.put(`/${id}`, body);
|
|
2292
|
+
},
|
|
2293
|
+
putCancelRequests: (ids) => {
|
|
2294
|
+
const body = { id: ids };
|
|
2295
|
+
return TransactionAPI.put("/request/cancel", body);
|
|
2296
|
+
},
|
|
2297
|
+
getHistoryByTransaction: (params) => {
|
|
2298
|
+
return TransactionAPI.get("/history", { params });
|
|
2299
|
+
},
|
|
2300
|
+
getHistoryByTransactionOptions: (field) => {
|
|
2301
|
+
const params = {};
|
|
2302
|
+
params[field] = true;
|
|
2303
|
+
return TransactionAPI.get("/history/options", { params });
|
|
2304
|
+
},
|
|
2305
|
+
getHistoryByAsset: (params) => {
|
|
2306
|
+
return TransactionAPI.get("/history/by-asset", { params });
|
|
2307
|
+
},
|
|
2308
|
+
getHistoryByAssetOptions: (field) => {
|
|
2309
|
+
const params = {};
|
|
2310
|
+
params[field] = true;
|
|
2311
|
+
return TransactionAPI.get("/history/by-asset/options", { params });
|
|
2312
|
+
},
|
|
2313
|
+
getApproverList: (tranasctionId) => {
|
|
2314
|
+
return TransactionAPI.get(`/${tranasctionId}/approval-history`);
|
|
2315
|
+
},
|
|
2316
|
+
putHandoverTransaction: (id, body) => {
|
|
2317
|
+
return TransactionAPI.put(`/${id}/handover`, body);
|
|
2318
|
+
},
|
|
2319
|
+
// ------ PRELIST ------
|
|
2320
|
+
getPrelist: (params) => {
|
|
2321
|
+
return PrelistAPI.get("/", { params });
|
|
2322
|
+
},
|
|
2323
|
+
postAddPrelistData: (body) => {
|
|
2324
|
+
return PrelistAPI.post("/", body);
|
|
2325
|
+
},
|
|
2326
|
+
deletePrelist: (ids) => {
|
|
2327
|
+
return PrelistAPI.delete("/", {
|
|
2328
|
+
params: {
|
|
2329
|
+
id: JSON.stringify(ids)
|
|
2330
|
+
}
|
|
2331
|
+
});
|
|
2332
|
+
},
|
|
2333
|
+
getPrelistAssets: (id) => {
|
|
2334
|
+
const params = { id };
|
|
2335
|
+
return PrelistAPI.get("/request", { params });
|
|
2336
|
+
},
|
|
2337
|
+
// APPROVAL
|
|
2338
|
+
getApprovals: (status, params) => {
|
|
2339
|
+
const formattedParams = { ...params, status: JSON.stringify([status]) };
|
|
2340
|
+
return ApprovalAPI$1.get("/", { params: formattedParams });
|
|
2341
|
+
},
|
|
2342
|
+
getApprovalOptions: (status, field) => {
|
|
2343
|
+
const params = {
|
|
2344
|
+
status: JSON.stringify([status])
|
|
2345
|
+
};
|
|
2346
|
+
params[field] = true;
|
|
2347
|
+
return ApprovalAPI$1.get("/options", { params });
|
|
2348
|
+
},
|
|
2349
|
+
getApprovalDetail: (id, approvalType) => {
|
|
2350
|
+
const params = {
|
|
2351
|
+
groupType: approvalType
|
|
2352
|
+
};
|
|
2353
|
+
return ApprovalAPI$1.get(`/transaction/${id}`, { params });
|
|
2354
|
+
},
|
|
2355
|
+
getApprovalDetailOptions: (id, field, approvalType) => {
|
|
2356
|
+
const params = {};
|
|
2357
|
+
params[field] = true;
|
|
2358
|
+
params.groupType = approvalType;
|
|
2359
|
+
return ApprovalAPI$1.get(`/transaction/${id}/options`, { params });
|
|
2360
|
+
},
|
|
2361
|
+
putUpdateApproval: (body) => {
|
|
2362
|
+
return ApprovalAPI$1.put("/approve", body);
|
|
2363
|
+
}
|
|
2364
|
+
};
|
|
2365
|
+
const ReportAPI = createAxiosInstance({
|
|
2366
|
+
prefix: "/disposal/v2/report"
|
|
2367
|
+
});
|
|
2368
|
+
const DisposalAPI = createAxiosInstance({
|
|
2369
|
+
prefix: "/disposal/v2/disposal"
|
|
2370
|
+
});
|
|
2371
|
+
const ApprovalAPI = createAxiosInstance({
|
|
2372
|
+
prefix: "/disposal/v2/approval"
|
|
2373
|
+
});
|
|
2374
|
+
const DisposalServices$1 = {
|
|
2375
|
+
getReportedDisposal: (params) => {
|
|
2376
|
+
return ReportAPI.get("", { params });
|
|
2377
|
+
},
|
|
2378
|
+
getReportedDisposalOptions: (params) => {
|
|
2379
|
+
return ReportAPI.get("/options", { params });
|
|
2380
|
+
},
|
|
2381
|
+
postReportDisposal: (body) => {
|
|
2382
|
+
return ReportAPI.post("", body);
|
|
2383
|
+
},
|
|
2384
|
+
deleteCancelReport: (params) => {
|
|
2385
|
+
params.isFromDisposal = "false";
|
|
2386
|
+
return ReportAPI.delete("/cancel-report", { params });
|
|
2387
|
+
},
|
|
2388
|
+
deleteDeclineReport: (params) => {
|
|
2389
|
+
params.isFromDisposal = "true";
|
|
2390
|
+
return ReportAPI.delete("/cancel-report", { params });
|
|
2391
|
+
},
|
|
2392
|
+
getPrelistDisposal: (params) => {
|
|
2393
|
+
return DisposalAPI.get("/prelist", { params });
|
|
2394
|
+
},
|
|
2395
|
+
getPrelistDisposalRequest: (params) => {
|
|
2396
|
+
return DisposalAPI.get("/prelist/request", { params });
|
|
2397
|
+
},
|
|
2398
|
+
postCreatePrelist: (body) => {
|
|
2399
|
+
return DisposalAPI.post("/prelist", body);
|
|
2400
|
+
},
|
|
2401
|
+
deletePrelistData: (params) => {
|
|
2402
|
+
return DisposalAPI.delete("/prelist", { params });
|
|
2403
|
+
},
|
|
2404
|
+
postCreateTransaction: (body) => {
|
|
2405
|
+
return DisposalAPI.post("/transaction", body);
|
|
2406
|
+
},
|
|
2407
|
+
putTransaction: (id, body) => {
|
|
2408
|
+
return DisposalAPI.put(`/disposal/${id}`, body);
|
|
2409
|
+
},
|
|
2410
|
+
getTransactionData: (params) => {
|
|
2411
|
+
return DisposalAPI.get("/transaction", { params });
|
|
2412
|
+
},
|
|
2413
|
+
getTransactionDetail: (transactionId) => {
|
|
2414
|
+
return DisposalAPI.get(`/transaction/${transactionId}`);
|
|
2415
|
+
},
|
|
2416
|
+
getDisposalTransactionLog: (id) => {
|
|
2417
|
+
return DisposalAPI.get(`/request/${id}/disposal-log`);
|
|
2418
|
+
},
|
|
2419
|
+
getTransactionApprovalHistory: (transactionId) => {
|
|
2420
|
+
return ApprovalAPI.get(`/transaction/${transactionId}/approval-history`);
|
|
2421
|
+
},
|
|
2422
|
+
getTransactionOptions: (params) => {
|
|
2423
|
+
return DisposalAPI.get("/transaction/options", { params });
|
|
2424
|
+
},
|
|
2425
|
+
putCancelTransaction: (params) => {
|
|
2426
|
+
return DisposalAPI.put("/cancel", void 0, { params });
|
|
2427
|
+
},
|
|
2428
|
+
putCancelRequest: (body) => {
|
|
2429
|
+
return DisposalAPI.put("/request/cancel", body);
|
|
2430
|
+
},
|
|
2431
|
+
putDisposalVerification: (body, transactionId) => {
|
|
2432
|
+
return DisposalAPI.put(`/${transactionId}/verification`, body);
|
|
2433
|
+
},
|
|
2434
|
+
putDisposalCompletion: (body, transactionId) => {
|
|
2435
|
+
const headers = { "Content-Type": "multipart/form-data" };
|
|
2436
|
+
return DisposalAPI.put(`/${transactionId}/completion`, body, { headers });
|
|
2437
|
+
},
|
|
2438
|
+
getDisposalRequest: (params) => {
|
|
2439
|
+
return DisposalAPI.get("/request", { params });
|
|
2440
|
+
},
|
|
2441
|
+
getDisposalRequestOptions: (params) => {
|
|
2442
|
+
return DisposalAPI.get("/request/options", { params });
|
|
2443
|
+
},
|
|
2444
|
+
getVerifyAsset: (params) => {
|
|
2445
|
+
return DisposalAPI.get("/request/scan", { params });
|
|
2446
|
+
},
|
|
2447
|
+
getDisposalHistory: (additionalPath, params) => {
|
|
2448
|
+
return DisposalAPI.get(`/history${additionalPath}`, { params });
|
|
2449
|
+
},
|
|
2450
|
+
getHistoryByTransactionOptions: (params) => {
|
|
2451
|
+
return DisposalAPI.get("/history/options", { params });
|
|
2452
|
+
},
|
|
2453
|
+
getHistoryByAssetOptions: (params) => {
|
|
2454
|
+
return DisposalAPI.get("/history/by-asset/options", { params });
|
|
2455
|
+
}
|
|
2456
|
+
};
|
|
2457
|
+
const API$9 = createAxiosInstance({
|
|
2458
|
+
prefix: "/transfer-go/v2"
|
|
2459
|
+
});
|
|
2460
|
+
const TransferServicesGo = {
|
|
2461
|
+
getTransactionData: (params) => {
|
|
2462
|
+
return API$9.get("/transaction", { params });
|
|
2463
|
+
},
|
|
2464
|
+
getTransactionOptions: (params) => {
|
|
2465
|
+
return API$9.get("/transaction/options", { params });
|
|
2466
|
+
},
|
|
2467
|
+
getTransactionLog: (id) => {
|
|
2468
|
+
return API$9.get(`/transaction/request/${id}/transaction-log`);
|
|
2469
|
+
},
|
|
2470
|
+
postCreateTransaction: (body) => {
|
|
2471
|
+
return API$9.post("/transaction", body);
|
|
2472
|
+
}
|
|
2473
|
+
};
|
|
2474
|
+
const API$8 = createAxiosInstance({
|
|
2475
|
+
prefix: "/audit/v2"
|
|
2476
|
+
});
|
|
2477
|
+
const AuditServices = {
|
|
2478
|
+
getAudit: (assetId, params) => {
|
|
2479
|
+
return API$8.get(`/audit/schedule/asset-detail/${assetId}`, { params });
|
|
2480
|
+
},
|
|
2481
|
+
getAuditOption: (assetId, params) => {
|
|
2482
|
+
return API$8.get(`/audit/schedule/asset-detail/${assetId}/options`, {
|
|
2483
|
+
params
|
|
2484
|
+
});
|
|
2485
|
+
},
|
|
2486
|
+
putSetActive: (body) => {
|
|
2487
|
+
return API$8.put("/audit/asset/activation", body);
|
|
2488
|
+
}
|
|
2489
|
+
};
|
|
2490
|
+
const API$7 = createAxiosInstance({
|
|
2491
|
+
prefix: "/routine/v2"
|
|
2492
|
+
});
|
|
2493
|
+
const RoutineServices = {
|
|
2494
|
+
getMaintenance: (assetId, params) => {
|
|
2495
|
+
return API$7.get(`/routine-task/${assetId}`, { params });
|
|
2496
|
+
},
|
|
2497
|
+
getMaintenanceOption: (assetId, params) => {
|
|
2498
|
+
return API$7.get(`/routine-task/${assetId}/options`, { params });
|
|
2499
|
+
},
|
|
2500
|
+
putSetActive: (body) => {
|
|
2501
|
+
return API$7.put("/maintenable-asset/set-active", body);
|
|
2502
|
+
}
|
|
2503
|
+
};
|
|
2504
|
+
const API$6 = createAxiosInstance({
|
|
2505
|
+
prefix: "/settings-attribute/v2/models"
|
|
2506
|
+
});
|
|
2507
|
+
const ModelTypeServices = {
|
|
2508
|
+
getDropdown: (params) => {
|
|
2509
|
+
return API$6.get("/dropdown", { params });
|
|
2510
|
+
}
|
|
2511
|
+
};
|
|
2512
|
+
const API$5 = createAxiosInstance({
|
|
2513
|
+
prefix: "/settings-attribute/v2/transaction-settings"
|
|
2514
|
+
});
|
|
2515
|
+
const TransactionSettingServices = {
|
|
2516
|
+
getData: () => {
|
|
2517
|
+
return API$5.get("/");
|
|
2518
|
+
},
|
|
2519
|
+
putData: (data) => {
|
|
2520
|
+
return API$5.put("/", data);
|
|
2521
|
+
}
|
|
2522
|
+
};
|
|
2523
|
+
const API$4 = createAxiosInstance({
|
|
2524
|
+
prefix: "/borrowing-go/v2"
|
|
2525
|
+
});
|
|
2526
|
+
const BorrowServicesGo = {
|
|
2527
|
+
getTransactions: async (params) => {
|
|
2528
|
+
return API$4.get("/transaction", { params });
|
|
2529
|
+
},
|
|
2530
|
+
getTransactionOptions: async (params) => {
|
|
2531
|
+
return API$4.get("/transaction/options", { params });
|
|
2532
|
+
},
|
|
2533
|
+
getTransactionLog: async (id) => {
|
|
2534
|
+
return API$4.get(`/transaction/request/${id}/transaction-log`);
|
|
2535
|
+
},
|
|
2536
|
+
postTransaction: async (body) => {
|
|
2537
|
+
return API$4.post("/transaction", body);
|
|
2538
|
+
},
|
|
2539
|
+
putTransaction: async (body) => {
|
|
2540
|
+
return API$4.put("/transaction", body);
|
|
2541
|
+
},
|
|
2542
|
+
putTransactionReturn: async (requestIds) => {
|
|
2543
|
+
const body = { id: requestIds };
|
|
2544
|
+
return API$4.put("/transaction/return", body);
|
|
2545
|
+
},
|
|
2546
|
+
putCancelReport: async (requestIds) => {
|
|
2547
|
+
const body = { id: requestIds };
|
|
2548
|
+
return API$4.put("/transaction/request/cancel-report", body);
|
|
2549
|
+
}
|
|
2550
|
+
};
|
|
2551
|
+
const API$3 = createAxiosInstance({
|
|
2552
|
+
prefix: "/disposal-go/v2/"
|
|
2553
|
+
});
|
|
2554
|
+
const DisposalServices = {
|
|
2555
|
+
getReportedDisposal: (params) => {
|
|
2556
|
+
return API$3.get("/report", { params });
|
|
2557
|
+
},
|
|
2558
|
+
getReportedDisposalOptions: (params) => {
|
|
2559
|
+
return API$3.get("/report/options", { params });
|
|
2560
|
+
},
|
|
2561
|
+
postReportDisposal: (body) => {
|
|
2562
|
+
return API$3.post("/report", body);
|
|
2563
|
+
},
|
|
2564
|
+
deleteCancelReport: (params) => {
|
|
2565
|
+
params.isFromDisposal = "false";
|
|
2566
|
+
return API$3.delete("/report/cancel-report", { params });
|
|
2567
|
+
},
|
|
2568
|
+
deleteDeclineReport: (params) => {
|
|
2569
|
+
params.isFromDisposal = "true";
|
|
2570
|
+
return API$3.delete("/report/cancel-report", { params });
|
|
2571
|
+
},
|
|
2572
|
+
getDisposalHistory: (params) => {
|
|
2573
|
+
return API$3.get("/transaction", { params });
|
|
2574
|
+
},
|
|
2575
|
+
getHistoryByAssetOptions: (params) => {
|
|
2576
|
+
return API$3.get("/transaction/options", { params });
|
|
2577
|
+
},
|
|
2578
|
+
getDisposalTransactionLog: (requestId) => {
|
|
2579
|
+
return API$3.get(`/transaction/request/${requestId}/transaction-log`);
|
|
2580
|
+
},
|
|
2581
|
+
postCreateTransaction: (body) => {
|
|
2582
|
+
return API$3.post("/transaction", body);
|
|
2583
|
+
}
|
|
2584
|
+
};
|
|
2585
|
+
const API$2 = createAxiosInstance({
|
|
2586
|
+
prefix: "/report/v2/reports"
|
|
2587
|
+
});
|
|
2588
|
+
const ReportServices$1 = {
|
|
2589
|
+
getReportList: (params) => {
|
|
2590
|
+
return API$2.get("/schedules", { params });
|
|
2591
|
+
},
|
|
2592
|
+
getReportSchedule: (scheduleId) => {
|
|
2593
|
+
return API$2.get("/schedules/" + scheduleId);
|
|
2594
|
+
},
|
|
2595
|
+
getUniqueScheduleName: (name) => {
|
|
2596
|
+
return API$2.get("/schedules/unique-name", { params: { name } });
|
|
2597
|
+
},
|
|
2598
|
+
getFilterOptions: (params) => {
|
|
2599
|
+
return API$2.get("/schedules/options", { params });
|
|
2600
|
+
},
|
|
2601
|
+
putSetActive: (body) => {
|
|
2602
|
+
return API$2.put("/schedules/activation", body);
|
|
2603
|
+
},
|
|
2604
|
+
putEditSchedule: (body) => {
|
|
2605
|
+
return API$2.put("/schedules/" + body._id, body);
|
|
2606
|
+
},
|
|
2607
|
+
deleteReports: (reportIds) => {
|
|
2608
|
+
return API$2.delete("/schedules", { params: { reportIds } });
|
|
2609
|
+
},
|
|
2610
|
+
postCreateSchedule: (data) => {
|
|
2611
|
+
return API$2.post("/schedules/create", data);
|
|
2612
|
+
},
|
|
2613
|
+
postDownloadReport: (data) => {
|
|
2614
|
+
return API$2.post("/download", data, { responseType: "arraybuffer" });
|
|
2615
|
+
},
|
|
2616
|
+
postGenerateReport: (data) => {
|
|
2617
|
+
return API$2.post("/generate", data);
|
|
2618
|
+
}
|
|
2619
|
+
};
|
|
2620
|
+
const API$1 = createAxiosInstance({
|
|
2621
|
+
prefix: "/report-go/v2/reports"
|
|
2622
|
+
});
|
|
2623
|
+
const ReportServices = {
|
|
2624
|
+
getReportList: (params) => {
|
|
2625
|
+
return API$1.get("/schedules", { params });
|
|
2626
|
+
},
|
|
2627
|
+
getReportSchedule: (scheduleId) => {
|
|
2628
|
+
return API$1.get("/schedules/" + scheduleId);
|
|
2629
|
+
},
|
|
2630
|
+
getUniqueScheduleName: (name) => {
|
|
2631
|
+
return API$1.get("/schedules/unique-name", { params: { name } });
|
|
2632
|
+
},
|
|
2633
|
+
getFilterOptions: (params) => {
|
|
2634
|
+
return API$1.get("/schedules/options", { params });
|
|
2635
|
+
},
|
|
2636
|
+
putSetActive: (body) => {
|
|
2637
|
+
return API$1.put("/schedules/set-active", body);
|
|
2638
|
+
},
|
|
2639
|
+
putEditSchedule: (id, body) => {
|
|
2640
|
+
return API$1.put(`/schedules/${id}`, body);
|
|
2641
|
+
},
|
|
2642
|
+
deleteReports: (id) => {
|
|
2643
|
+
return API$1.delete("/schedules", { params: { id } });
|
|
2644
|
+
},
|
|
2645
|
+
postCreateSchedule: (data) => {
|
|
2646
|
+
return API$1.post("/schedules", data);
|
|
2647
|
+
},
|
|
2648
|
+
postDownloadReport: (data) => {
|
|
2649
|
+
return API$1.post("/download", data, { responseType: "arraybuffer" });
|
|
2650
|
+
},
|
|
2651
|
+
postGenerateReport: (data) => {
|
|
2652
|
+
return API$1.post("/generate", data);
|
|
2653
|
+
}
|
|
2654
|
+
};
|
|
2655
|
+
const API = createAxiosInstance({
|
|
2656
|
+
prefix: `${SERVER_PREFIX.SETTINGS_ATTRIBUTES}/v2/asset-name-policy`
|
|
2657
|
+
});
|
|
2658
|
+
const AssetPolicyServices = {
|
|
2659
|
+
getList: (params) => {
|
|
2660
|
+
return API.get("/", { params });
|
|
2661
|
+
},
|
|
2662
|
+
getListFilterOptions: (params) => {
|
|
2663
|
+
return API.get("/options");
|
|
2664
|
+
},
|
|
2665
|
+
putUpdatePolicy: (body) => {
|
|
2666
|
+
return API.put("/", body);
|
|
2667
|
+
}
|
|
215
2668
|
};
|
|
216
2669
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
2670
|
+
AliasCodeServices$1 as AliasCodeServices,
|
|
2671
|
+
AliasCodeServices as AliasCodeServicesGo,
|
|
2672
|
+
AssetNameServices,
|
|
2673
|
+
AssetPolicyServices,
|
|
2674
|
+
AssetServices$1 as AssetServices,
|
|
2675
|
+
AssetServices as AssetServicesGo,
|
|
2676
|
+
AssignmentServices$1 as AssignmentServices,
|
|
2677
|
+
AssignmentServices as AssignmentServicesGo,
|
|
2678
|
+
AuditServices,
|
|
2679
|
+
AuthServices$1 as AuthServices,
|
|
2680
|
+
BorrowServices,
|
|
2681
|
+
BorrowServicesGo,
|
|
2682
|
+
BrandServices,
|
|
2683
|
+
ChangelogServices$1 as ChangelogServices,
|
|
2684
|
+
CountryStateServices,
|
|
2685
|
+
CustomFieldServices$1 as CustomFieldServices,
|
|
2686
|
+
CustomFieldServices as CustomFieldServicesGo,
|
|
2687
|
+
DamageServices$1 as DamageServices,
|
|
2688
|
+
DamageServices as DamageServicesGo,
|
|
2689
|
+
DashboardServices,
|
|
2690
|
+
DisposalServices$1 as DisposalServices,
|
|
2691
|
+
DisposalServices as DisposalServicesGo,
|
|
2692
|
+
FileManagerServices$1 as FileManagerServices,
|
|
2693
|
+
FileManagerServices as FileManagerServicesGo,
|
|
2694
|
+
GeneralSettingsServices$1 as GeneralSettingsServices,
|
|
2695
|
+
GeneralSettingsServices as GeneralSettingsServicesGo,
|
|
2696
|
+
AuthServices as GlobalAuthServices,
|
|
2697
|
+
GroupCategoryServices$1 as GroupCategoryServices,
|
|
2698
|
+
GroupCategoryServices as GroupCategoryServicesGo,
|
|
2699
|
+
I18nService,
|
|
2700
|
+
ImportServices$1 as ImportServices,
|
|
2701
|
+
ImportServices as ImportServicesGo,
|
|
2702
|
+
LicenseServices$1 as LicenseServices,
|
|
2703
|
+
LicenseServices as LicenseServicesGo,
|
|
2704
|
+
ChangelogServices as LogServicesGo,
|
|
2705
|
+
MissingServices$2 as MissingServices,
|
|
2706
|
+
MissingServices$1 as MissingServicesGo,
|
|
2707
|
+
ModelTypeServices,
|
|
2708
|
+
MyAssetServices$1 as MyAssetServices,
|
|
2709
|
+
MyAssetServices as MyAssetServicesGo,
|
|
2710
|
+
NotificationApprovalServices,
|
|
2711
|
+
NotificationServices$1 as NotificationServices,
|
|
2712
|
+
NotificationServices as NotificationServicesGo,
|
|
2713
|
+
OpenAPIServices$1 as OpenAPIServices,
|
|
2714
|
+
OpenAPIServices as OpenAPIServicesGo,
|
|
2715
|
+
ReaderServices,
|
|
2716
|
+
RepairServices,
|
|
2717
|
+
ReportServices$1 as ReportServices,
|
|
2718
|
+
ReportServices as ReportServicesGo,
|
|
2719
|
+
RoleServices$1 as RoleServices,
|
|
2720
|
+
RoleServices as RoleServicesGo,
|
|
2721
|
+
RoutineServices,
|
|
2722
|
+
ServiceCenterServices,
|
|
2723
|
+
SessionLogServices,
|
|
2724
|
+
SubUserServices$1 as SubUserServices,
|
|
2725
|
+
SubUserServices as SubUserServicesGo,
|
|
2726
|
+
TAGServices,
|
|
2727
|
+
MissingServices as TrackingServices,
|
|
2728
|
+
TransactionSettingServices,
|
|
2729
|
+
TransferServices,
|
|
2730
|
+
TransferServicesGo,
|
|
2731
|
+
UserServices$1 as UserServices,
|
|
2732
|
+
UserServices as UserServicesGo,
|
|
2733
|
+
getAssetsFile,
|
|
2734
|
+
getBaseURL,
|
|
2735
|
+
getImageURL,
|
|
2736
|
+
getImageURL$1 as getImageURLGo,
|
|
2737
|
+
queryParamsStringfy
|
|
232
2738
|
};
|