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