@tagsamurai/fats-api-services 1.0.0-alpha.24 → 1.0.0-alpha.241

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.
Files changed (149) hide show
  1. package/api-services.es.js +2079 -201
  2. package/api-services.system.js +2084 -1
  3. package/main.d.ts +40 -11
  4. package/package.json +6 -3
  5. package/src/dto/accountCode.dto.d.ts +4 -0
  6. package/src/dto/assetDetail.dto.d.ts +91 -0
  7. package/src/dto/assetName.dto.d.ts +8 -0
  8. package/src/dto/assetPolicyService.dto.d.ts +19 -0
  9. package/src/dto/assetService.dto.d.ts +136 -0
  10. package/src/dto/assignment.dto.d.ts +81 -0
  11. package/src/dto/audit.dto.d.ts +14 -0
  12. package/src/dto/borrow.dto.d.ts +35 -0
  13. package/src/dto/customField.dto.d.ts +25 -0
  14. package/src/dto/damageService.dto.d.ts +23 -0
  15. package/src/dto/depreciationData.dto.d.ts +15 -0
  16. package/src/dto/disposal.dto.d.ts +66 -0
  17. package/src/dto/fileManager.dto.d.ts +25 -0
  18. package/src/dto/globalAuth.dto.d.ts +18 -0
  19. package/src/dto/groupCategoryService.dto.d.ts +1 -1
  20. package/src/dto/importData.dto.d.ts +7 -0
  21. package/src/dto/importTemporaryData.dto.d.ts +6 -0
  22. package/src/dto/license.dto.d.ts +76 -0
  23. package/src/dto/log.dto.d.ts +11 -11
  24. package/src/dto/maintenanceRoutine.dto.d.ts +12 -0
  25. package/src/dto/missing.dto.d.ts +12 -0
  26. package/src/dto/myAsset.dro.d.ts +12 -0
  27. package/src/dto/notification.dto.d.ts +3 -1
  28. package/src/dto/oldBorrowService.dto.d.ts +102 -0
  29. package/src/dto/oldDamageService.dto.d.ts +7 -0
  30. package/src/dto/oldRepairService.dto.d.ts +29 -0
  31. package/src/dto/oldReportService.dto.d.ts +80 -0
  32. package/src/dto/oldTagService.dto.d.ts +59 -0
  33. package/src/dto/oldTrackingService.dto.d.ts +6 -0
  34. package/src/dto/oldTransferService.dto.d.ts +221 -0
  35. package/src/dto/openApi.dto.d.ts +3 -0
  36. package/src/dto/report.dto.d.ts +42 -0
  37. package/src/dto/role.dto.d.ts +50 -0
  38. package/src/dto/serviceCenter.dto.d.ts +22 -0
  39. package/src/dto/subUser.dto.d.ts +46 -0
  40. package/src/dto/transactionLog.dto.d.ts +17 -0
  41. package/src/dto/transfer.dto.d.ts +29 -0
  42. package/src/dto/user.dto.d.ts +126 -33
  43. package/src/services/accounting.service.d.ts +19 -0
  44. package/src/services/asset.service.d.ts +44 -0
  45. package/src/services/assetPolicy.service.d.ts +10 -0
  46. package/src/services/assignment.service.d.ts +85 -0
  47. package/src/services/borrow.service.d.ts +84 -0
  48. package/src/services/countryState.service.d.ts +7 -0
  49. package/src/services/customField.service.d.ts +22 -0
  50. package/src/services/damage.service.d.ts +13 -0
  51. package/src/services/damageService.type.d.ts +104 -0
  52. package/src/services/disposal.service.d.ts +18 -0
  53. package/src/services/fileManager.service.d.ts +53 -0
  54. package/src/services/globalAuth.service.d.ts +27 -0
  55. package/src/services/groupCategory.service.d.ts +6 -3
  56. package/src/services/importData.service.d.ts +24 -0
  57. package/src/services/license.service.d.ts +23 -0
  58. package/src/services/log.service.d.ts +29 -0
  59. package/src/services/missing.service.d.ts +12 -0
  60. package/src/services/moduleAuth.service.d.ts +19 -0
  61. package/src/services/myAsset.service.d.ts +13 -0
  62. package/src/services/notification.service.d.ts +9 -0
  63. package/src/services/oldAsset.service.d.ts +38 -5
  64. package/src/services/oldAssetName.service.d.ts +14 -0
  65. package/src/services/oldAssignment.service.d.ts +84 -0
  66. package/src/services/oldAudit.service.d.ts +56 -0
  67. package/src/services/oldBorrow.service.d.ts +77 -0
  68. package/src/services/oldBrand.service.d.ts +7 -0
  69. package/src/services/oldDamage.service.d.ts +17 -0
  70. package/src/services/oldDisposal.service.d.ts +44 -0
  71. package/src/services/oldFileManager.service.d.ts +53 -0
  72. package/src/services/oldImportData.service.d.ts +22 -0
  73. package/src/services/oldLicense.service.d.ts +39 -0
  74. package/src/services/oldLog.service.d.ts +17 -0
  75. package/src/services/oldMaintenanceRoutine.service.d.ts +11 -0
  76. package/src/services/oldMissing.service.d.ts +12 -1
  77. package/src/services/oldModelType.service.d.ts +7 -0
  78. package/src/services/oldMyAsset.service.d.ts +7 -0
  79. package/src/services/oldOpenApi.service.d.ts +10 -0
  80. package/src/services/oldReader.service.d.ts +13 -0
  81. package/src/services/oldRepair.service.d.ts +10 -0
  82. package/src/services/oldReport.service.d.ts +31 -0
  83. package/src/services/oldRole.service.d.ts +56 -0
  84. package/src/services/oldServiceCenter.service.d.ts +19 -0
  85. package/src/services/oldSubUser.service.d.ts +15 -0
  86. package/src/services/oldTag.service.d.ts +25 -1
  87. package/src/services/oldTracking.service.d.ts +4 -0
  88. package/src/services/oldTransactionSetting.service.d.ts +21 -0
  89. package/src/services/oldTransfer.service.d.ts +30 -0
  90. package/src/services/oldUser.service.d.ts +28 -15
  91. package/src/services/openApi.service.d.ts +10 -0
  92. package/src/services/report.service.d.ts +32 -0
  93. package/src/services/role.service.d.ts +58 -0
  94. package/src/services/subUser.service.d.ts +17 -0
  95. package/src/services/transfer.service.d.ts +36 -0
  96. package/src/services/user.service.d.ts +42 -0
  97. package/src/types/accountCode.type.d.ts +7 -0
  98. package/src/types/approval.type.d.ts +17 -0
  99. package/src/types/asset.type.d.ts +229 -0
  100. package/src/types/assetDetail.type.d.ts +120 -0
  101. package/src/types/assetPolicyService.type.d.ts +18 -0
  102. package/src/types/assignedAsset.type.d.ts +60 -0
  103. package/src/types/assignment.type.d.ts +318 -0
  104. package/src/types/audit.type.d.ts +26 -0
  105. package/src/types/borrow.type.d.ts +86 -0
  106. package/src/types/customField.type.d.ts +43 -0
  107. package/src/types/dataTable.type.d.ts +7 -0
  108. package/src/types/depreciationData.type.d.ts +15 -0
  109. package/src/types/disposal/history.type.d.ts +51 -0
  110. package/src/types/disposal/prelist.type.d.ts +18 -0
  111. package/src/types/disposal/reported.type.d.ts +54 -0
  112. package/src/types/disposal/requestDisposal.type.d.ts +80 -0
  113. package/src/types/disposal/transaction.type.d.ts +62 -0
  114. package/src/types/disposal/user.type.d.ts +5 -0
  115. package/src/types/disposal.type.d.ts +1 -0
  116. package/src/types/fetchResponse.type.d.ts +4 -2
  117. package/src/types/fileManager.type.d.ts +24 -0
  118. package/src/types/groupCategoryData.type.d.ts +2 -7
  119. package/src/types/importData.type.d.ts +92 -0
  120. package/src/types/license.type.d.ts +43 -0
  121. package/src/types/licenseAddon.type.d.ts +35 -0
  122. package/src/types/licenseAllocation.type.d.ts +64 -0
  123. package/src/types/licenseAsset.type.d.ts +77 -0
  124. package/src/types/licenseConcurrent.type.d.ts +11 -0
  125. package/src/types/licensePurchased.type.d.ts +16 -0
  126. package/src/types/maintenanceRoutine.type.d.ts +10 -0
  127. package/src/types/myAsset.type.d.ts +65 -0
  128. package/src/types/notification.type.d.ts +17 -0
  129. package/src/types/oldAuditService.type.d.ts +154 -0
  130. package/src/types/oldBorrowingService.type.d.ts +549 -0
  131. package/src/types/oldTagService.type.d.ts +109 -0
  132. package/src/types/options.type.d.ts +6 -10
  133. package/src/types/reader.d.ts +55 -0
  134. package/src/types/role.type.d.ts +111 -6
  135. package/src/types/serviceCenter.type.d.ts +29 -0
  136. package/src/types/subUser.type.d.ts +28 -0
  137. package/src/types/transfer.type.d.ts +64 -0
  138. package/src/types/user.type.d.ts +43 -1
  139. package/src/types/userGlobalRole.type.d.ts +1 -1
  140. package/src/types/userGroupRole.type.d.ts +3 -2
  141. package/src/types/userTransactionRole.type.d.ts +3 -1
  142. package/src/utils/createInstance.util.d.ts +17 -0
  143. package/src/utils/getAssetsFile.util.d.ts +1 -0
  144. package/src/utils/index.d.ts +1 -0
  145. package/src/dto/oldAssetService.dto.d.ts +0 -26
  146. package/src/services/oldGroupCategory.service.d.ts +0 -14
  147. package/src/types/userSystemRole.type.d.ts +0 -14
  148. /package/src/services/{oldAliasCode.service.d.ts → aliasCode.service.d.ts} +0 -0
  149. /package/src/services/{oldGeneralSettings.service.d.ts → generalSettings.service.d.ts} +0 -0
@@ -1,186 +1,1791 @@
1
- import $ from "axios";
2
- const m = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_ADMIN_API: "https://dev-admin-api.tagsamurai.com", VITE_APP_API: "https://dev-api.tagsamurai.com", VITE_APP_COUNTRY_STATE_API: "https://api.countrystatecity.in", VITE_APP_COUNTRY_STATE_API_KEY: "ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, _ = (t = "APP_API") => m["VITE_" + t], n = (t = {}, e = !1) => {
3
- const { env: r = "APP_API", prefix: a = "", headers: l = {}, ...S } = t, v = `${_(r)}${a}`, A = JSON.parse(localStorage.getItem("user") ?? "{}"), f = A.jwt ?? A.token ?? "";
4
- return $.create({
5
- ...S,
6
- baseURL: v,
7
- headers: e ? l : {
1
+ import axios from "axios";
2
+ const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false, "VITE_APP_ADMIN_API": "https://dev-admin-api.tagsamurai.com", "VITE_APP_API": "https://dev-api.tagsamurai.com/fam", "VITE_APP_ASSETS_URL": "https://assets.tagsamurai.com", "VITE_APP_COUNTRY_STATE_API": "https://api.countrystatecity.in", "VITE_APP_COUNTRY_STATE_API_KEY": "ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==", "VITE_APP_GLOBAL_SETTINGS_API": "https://dev-api.global-settings.tagsamurai.com", "VITE_APP_LOGS_NOTIFICATION_API": "https://dev-api-logs-notification.tagsamurai.com", "VITE_APP_TAGSAMURAI_API": "https://dev-api.tagsamurai.com" };
3
+ const getBaseURL = (env = "APP_API") => {
4
+ return __vite_import_meta_env__["VITE_" + env];
5
+ };
6
+ const createAxiosInstance = (config = {}, useDifferentHeaders = false) => {
7
+ const { env = "APP_API", prefix = "", headers = {}, ...restConfig } = config;
8
+ const baseURL = `${getBaseURL(env)}${prefix}`;
9
+ const instance = axios.create({
10
+ ...restConfig,
11
+ baseURL,
12
+ headers: useDifferentHeaders ? headers : {
8
13
  "Content-Type": "application/json",
9
- Authorization: `Bearer ${f}`,
10
- ...l
14
+ ...headers
11
15
  }
12
16
  });
13
- }, h = (t) => {
14
- if (!t || typeof t == "string")
17
+ instance.interceptors.request.use((request) => {
18
+ const user = JSON.parse(localStorage.getItem("user") ?? "{}");
19
+ const jwt = user.jwt ?? user.token ?? "";
20
+ request.headers["Authorization"] = `Bearer ${jwt}`;
21
+ return request;
22
+ });
23
+ return instance;
24
+ };
25
+ const queryParamsStringfy = (data) => {
26
+ if (!data || typeof data === "string") {
15
27
  return;
16
- const e = {};
17
- return Object.keys(t).forEach((r) => {
18
- Array.isArray(t[r]) ? t[r].length > 0 && Object.assign(e, {
19
- [r]: JSON.stringify(t[r])
20
- }) : t[r] !== void 0 && Object.assign(e, {
21
- [r]: t[r]
22
- });
23
- }), e;
24
- }, D = (t) => {
25
- if (!t) return;
26
- const e = _("APP_TAGSAMURAI_API");
27
- return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
28
- }, i = n({
29
- prefix: "/settings-attribute/v2",
30
- env: "APP_TAGSAMURAI_API"
31
- }), C = {
32
- getGroupCategory: (t, e) => {
33
- const r = t === "category" ? t : "groups";
34
- return i.get(`/${r}/tree`, { params: e });
35
- },
36
- getGroupCategoryList: (t, e, r) => {
37
- const a = t === "category" ? t : "groups";
38
- return i.get(`/${a}/${e}`, { params: r });
39
- },
40
- getNames: (t) => {
41
- const e = t === "category" ? t : "groups";
42
- return i.get(`/${e}/names`);
43
- },
44
- postCreateGroupCategory: (t, e) => {
45
- const r = t === "category" ? t : "groups";
46
- return i.post(`/${r}`, e);
47
- },
48
- putEditGroupCategory: (t, e, r) => {
49
- const a = t === "category" ? t : "groups";
50
- return i.put(`/${a}/${r}`, e);
51
- },
52
- putMoveGroup: (t, e) => i.put(`/groups/${e}/move-group`, t),
53
- putEditBulkGroups: async (t) => i.put("/groups/bulk", t),
54
- deleteGroupCategory: (t, e, r) => {
55
- const a = t === "category" ? t : "groups";
56
- return i.delete(`/${a}/${r}`, { data: e });
57
- }
58
- }, T = n({
59
- prefix: "/v2",
60
- env: "APP_LOGS_NOTIFICATION_API"
61
- }), N = {
62
- getTotalApprovals: () => T.get("/approval/count")
63
- }, g = n({
64
- prefix: "/v2",
65
- env: "APP_LOGS_NOTIFICATION_API"
66
- }), G = {
67
- getActionLog: (t) => g.get("/change-log", { params: t }),
68
- getActionLogOption: (t) => g.get("/change-log/options", { params: t }),
69
- getSessionLogList: (t) => g.get("/session-log", { params: t }),
70
- getUserDetailSystemLogList: (t) => g.get("/change-log", { params: t }),
71
- getUserDetailSystemLogOption: (t) => g.get("/change-log/options", { params: t })
72
- }, o = n({
28
+ }
29
+ const assignedData = {};
30
+ Object.keys(data).forEach((item) => {
31
+ if (Array.isArray(data[item])) {
32
+ if (data[item].length > 0) {
33
+ Object.assign(assignedData, {
34
+ [item]: JSON.stringify(data[item])
35
+ });
36
+ }
37
+ } else if (data[item] !== void 0) {
38
+ Object.assign(assignedData, {
39
+ [item]: data[item]
40
+ });
41
+ }
42
+ });
43
+ return assignedData;
44
+ };
45
+ const getImageURL = (name, width, height) => {
46
+ if (!name) return;
47
+ const BASE_URL = getBaseURL("APP_API");
48
+ const filePath = name.startsWith("http") ? name : `${BASE_URL}/utility/v2/files/${name.replace(/^\/+/, "")}`;
49
+ if (width || height) {
50
+ const params = new URLSearchParams();
51
+ if (width) {
52
+ params.set("width", width.toString());
53
+ params.set("height", height ? height == null ? void 0 : height.toString() : width.toString());
54
+ }
55
+ return `${filePath}?${params.toString()}`;
56
+ }
57
+ return filePath;
58
+ };
59
+ const getAssetsFile = async (file, type = "excel") => {
60
+ const response = await fetch(
61
+ `${getBaseURL("APP_ASSETS_URL")}/${type}/${file}`
62
+ );
63
+ return response;
64
+ };
65
+ const API$G = createAxiosInstance({
66
+ prefix: "/utility/v2"
67
+ });
68
+ const ChangelogServices$1 = {
69
+ getActionLog: (params) => {
70
+ return API$G.get("/change-log", { params });
71
+ },
72
+ getActionLogOption: (params) => {
73
+ return API$G.get("/change-log/options", { params });
74
+ },
75
+ getSessionLogList: (params) => {
76
+ return API$G.get("/session-log", { params });
77
+ },
78
+ getTransactionLog: (params) => {
79
+ return API$G.get("/transaction-log", { params });
80
+ },
81
+ /**
82
+ * Retrieves the transaction log options.
83
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
84
+ */
85
+ getTransactionLogOption: (params) => {
86
+ return API$G.get("/transaction-log/options", { params });
87
+ },
88
+ getUserDetailSystemLogList: (params) => {
89
+ return API$G.get("/change-log", { params });
90
+ },
91
+ getUserDetailSystemLogOption: (params) => {
92
+ return API$G.get("/change-log/options", { params });
93
+ },
94
+ getUserDetailUserLogBorrowingList: (userId, params) => {
95
+ return API$G.get(`/borrowing-log/${userId}`, { params });
96
+ },
97
+ getUserDetailUserLogAssignmentList: (userId, params) => {
98
+ return API$G.get(`/assignment-log/${userId}`, { params });
99
+ },
100
+ getUserDetailUserLogBorrowingOption: (userId, params) => {
101
+ return API$G.get(`/borrowing-log/${userId}/options`, { params });
102
+ },
103
+ getUserDetailUserLogAssignmentOption: (userId, params) => {
104
+ return API$G.get(`/assignment-log/${userId}/options`, { params });
105
+ }
106
+ };
107
+ const AssetsAPIs = createAxiosInstance({
73
108
  prefix: "/assets/v2/assets"
74
- }), R = {
75
- getScanTag: (t) => o.get("/scan", { params: { tag: t } }),
76
- getAllAssets: (t) => o.get("/", { params: t }),
77
- getAvailableAssets: (t) => o.get("/available", { params: t }),
78
- scanAsset: (t) => o.get("", { params: { tag: t } }),
79
- getAssetsById: (t, e) => o.get("/by-id", { params: { _id: t, ...e } }),
80
- getOptions: (t, e) => o.get(t ? `/${t}/options` : "/options", { params: e }),
81
- getUnlinkedAssets: (t) => o.get("/unlinked", { params: t }),
82
- getAssetDetail: (t, e) => o.get(`/${t}`, { params: e }),
83
- getLinkedAssetFamily: (t) => o.get("/family", { params: { id: t } }),
84
- matchAssetWithTag: (t, e) => {
85
- const r = {
86
- _id: JSON.stringify([t]),
87
- tag: e
109
+ });
110
+ const AssetServices = {
111
+ getAllAssets: (params) => {
112
+ return AssetsAPIs.get("/", { params });
113
+ },
114
+ getAllAssetsOptions: (params) => {
115
+ return AssetsAPIs.get("/options", { params });
116
+ },
117
+ getOptions: (endpoint, params) => {
118
+ return AssetsAPIs.get(endpoint ? `/${endpoint}/options` : "/options", {
119
+ params
120
+ });
121
+ },
122
+ getUnlinkedAssets: (params) => {
123
+ return AssetsAPIs.get("/unlinked", { params });
124
+ },
125
+ getAssetDetail: (id, params) => {
126
+ return AssetsAPIs.get(`/${id}`, { params });
127
+ },
128
+ getAssetNameTotal: () => {
129
+ return AssetsAPIs.get("/name-amount");
130
+ },
131
+ postRegisterAsset: (body) => {
132
+ const headers = { "Content-Type": "multipart/form-data" };
133
+ return AssetsAPIs.post("", body, { headers });
134
+ },
135
+ putEditAsset: (id, body) => {
136
+ const headers = { "Content-Type": "multipart/form-data" };
137
+ return AssetsAPIs.put(`/${id}`, body, { headers });
138
+ },
139
+ putEditDetailCustomField: (id, body) => {
140
+ const headers = { "Content-Type": "multipart/form-data" };
141
+ return AssetsAPIs.put(`/${id}`, body, { headers });
142
+ },
143
+ getLinkedAsset: (assetId, params) => {
144
+ return AssetsAPIs.get(`/${assetId}/linked-assets`, { params });
145
+ },
146
+ getPurchase: (assetId) => {
147
+ return AssetsAPIs.get(`/${assetId}/purchase`);
148
+ },
149
+ putPurchase: (body, assetId) => {
150
+ return AssetsAPIs.put(`/${assetId}/purchase`, body);
151
+ },
152
+ getAccounting: (assetId, params) => {
153
+ return AssetsAPIs.get(`/${assetId}/accounting`, { params });
154
+ },
155
+ getLinkedAssetOption: (parentId, params) => {
156
+ return AssetsAPIs.get(`/${parentId}/linked-assets/options`, { params });
157
+ },
158
+ putLinkAsset: (body, parentId) => {
159
+ return AssetsAPIs.put(`/${parentId}/linked-assets`, body);
160
+ },
161
+ putUnlinkAsset: (body, parentId) => {
162
+ return AssetsAPIs.put(`/${parentId}/unlink-assets`, body);
163
+ },
164
+ putEditUsefulLife: (body) => {
165
+ return AssetsAPIs.put("/useful-life", body);
166
+ },
167
+ getAttachment: (assetId, params) => {
168
+ return AssetsAPIs.get(`/attachment/${assetId}`, { params });
169
+ },
170
+ postAttachment: (body, assetId) => {
171
+ const headers = { "Content-Type": "multipart/form-data" };
172
+ return AssetsAPIs.post(`/attachment/${assetId}`, body, { headers });
173
+ },
174
+ putAttachment: (body, id) => {
175
+ const headers = { "Content-Type": "multipart/form-data" };
176
+ return AssetsAPIs.put(`/attachment/${id}`, body, { headers });
177
+ },
178
+ /**
179
+ * Deletes the attachment with the given IDs.
180
+ * @param {object} params - The request params containing the IDs of the attachments to delete.
181
+ * @returns {Promise<AxiosResponse>}
182
+ */
183
+ deleteAttachment: (params) => {
184
+ return AssetsAPIs.delete("/attachment/bulk", { params });
185
+ }
186
+ };
187
+ const API$F = createAxiosInstance({
188
+ prefix: "/missing-tracking/v2"
189
+ });
190
+ const MissingServices$1 = {
191
+ putFoundAsset: (body) => {
192
+ return API$F.put("/found", body);
193
+ },
194
+ putReportMissing: (id, body) => {
195
+ return API$F.put(`/${id}/report-missing`, body);
196
+ },
197
+ getData: (params) => {
198
+ return API$F.get("/", { params });
199
+ },
200
+ getDataOptions: (params) => {
201
+ return API$F.get("/options", { params });
202
+ },
203
+ getDetail: (id) => {
204
+ return API$F.get(`/${id}`);
205
+ }
206
+ };
207
+ const API$E = createAxiosInstance({
208
+ prefix: "/utility/v2/notification"
209
+ });
210
+ const NotificationServices = {
211
+ getNotifications: (params) => {
212
+ return API$E.get("/", { params });
213
+ },
214
+ readNotification: (id) => {
215
+ return API$E.put(`/${id}`);
216
+ }
217
+ };
218
+ const API$D = createAxiosInstance({
219
+ prefix: "/settings-user-role/v2"
220
+ });
221
+ const UserServices = {
222
+ /**
223
+ * Retrieves the user list as dropdown options.
224
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
225
+ */
226
+ getUserDropdown: (params) => {
227
+ return API$D.get("/users/dropdown", { params });
228
+ },
229
+ getUserOptions: (params) => {
230
+ return API$D.get("/users/options", { params });
231
+ },
232
+ getUserList: (params) => {
233
+ return API$D.get("/users", { params });
234
+ },
235
+ getUserDetail: (id) => {
236
+ return API$D.get(`/users/${id}`);
237
+ },
238
+ putSetActiveBulk: (data) => {
239
+ return API$D.put("/users/set-active-bulk", data);
240
+ },
241
+ // User Detail
242
+ /**
243
+ *
244
+ * @param id {string} User's _id
245
+ * @param type {"Global" | "Group"} Whether the system role's type is global or group
246
+ * @param params {Record<string, unknown>}
247
+ */
248
+ getUserDetailSystemRoles: (id, params, permissionType) => {
249
+ const additionalPath = permissionType ? `/${permissionType}/groups` : "";
250
+ return API$D.get(`/users/${id}/system-roles${additionalPath}`, {
251
+ params
252
+ });
253
+ },
254
+ getUserDetailTransactionRoleList: (id, params) => {
255
+ return API$D.get(`/users/${id}/transaction-roles`, { params });
256
+ },
257
+ postUserDetailAddTransactionRole: (userId, data) => {
258
+ return API$D.post(`/users/${userId}/add-transaction-role`, data);
259
+ },
260
+ deleteUserDetailTransactionRole: (userId, body) => {
261
+ return API$D.put(`/users/${userId}/delete-transaction-role`, body);
262
+ },
263
+ putUserDetailEditTransactionRole: (userId, data) => {
264
+ return API$D.put(`/users/${userId}/edit-transaction-role`, data);
265
+ },
266
+ putAssignGroup: (data, permissionType, id) => {
267
+ return API$D.put(`/users/${id}/system-roles/${permissionType}/groups`, data);
268
+ },
269
+ putRoleSetActive: (body, userId) => {
270
+ return API$D.put(`/users/${userId}/system-roles/set-active-bulk`, body);
271
+ },
272
+ getUserDetailTransactionAdminLogList: (userId, params) => {
273
+ return API$D.get(`/users/${userId}/transaction-log`, { params });
274
+ },
275
+ getUserDetailTransactionAdminLogOption: (userId, params) => {
276
+ return API$D.get(`/users/${userId}/transaction-log/option`, { params });
277
+ },
278
+ getUserDetailUserAssetBorrowedList: (userId, params) => {
279
+ return API$D.get(`/users/${userId}/borrowed-asset`, { params });
280
+ },
281
+ getUserDetailUserAssetAssignedList: (userId, params) => {
282
+ return API$D.get(`/users/${userId}/assigned-asset`, { params });
283
+ },
284
+ getUserDetailUserAssetBorrowedOption: (userId, params) => {
285
+ return API$D.get(`/users/${userId}/borrowed-asset/option`, { params });
286
+ },
287
+ getUserDetailUserAssetAssignedOption: (userId, params) => {
288
+ return API$D.get(`/users/${userId}/assigned-asset/option`, { params });
289
+ }
290
+ };
291
+ const API$C = createAxiosInstance({
292
+ prefix: "/settings-user-role/v2/users"
293
+ });
294
+ const SubUserServices = {
295
+ // Sub User
296
+ getSubUserList: (userId, params) => {
297
+ return API$C.get(`/${userId}/sub-users`, { params });
298
+ },
299
+ getSubUserOptions: (userId, params) => {
300
+ return API$C.get(`/${userId}/sub-users/option`, { params });
301
+ },
302
+ postCreateSubUser: (userId, data) => {
303
+ const headers = { "Content-Type": "multipart/form-data" };
304
+ return API$C.post(`/${userId}/sub-users`, data, { headers });
305
+ },
306
+ putSubUserSetActiveBulk: (userId, data) => {
307
+ return API$C.put(`/${userId}/sub-users/set-active-bulk`, data);
308
+ },
309
+ deleteSubUser: (userId, subUserIds) => {
310
+ return API$C.put(`/${userId}/sub-users/bulk`, { subUserIds });
311
+ },
312
+ putEditSubUser: (userId, subUserId, data) => {
313
+ const headers = { "Content-Type": "multipart/form-data" };
314
+ return API$C.put(`/${userId}/sub-users/${subUserId}`, data, {
315
+ headers
316
+ });
317
+ },
318
+ getBorrowedAsset: (userId, subUserId, params) => {
319
+ return API$C.get(`/${userId}/sub-users/${subUserId}/borrowed-asset`, {
320
+ params
321
+ });
322
+ },
323
+ getBorrowedAssetOptions: (userId, subUserId, params) => {
324
+ return API$C.get(`/${userId}/sub-users/${subUserId}/borrowed-asset/options`, {
325
+ params
326
+ });
327
+ },
328
+ getAssignedAsset: (userId, subUserId, params) => {
329
+ return API$C.get(`/${userId}/sub-users/${subUserId}/assigned-asset`, {
330
+ params
331
+ });
332
+ },
333
+ getAssignedAssetOptions: (userId, subUserId, params) => {
334
+ return API$C.get(`/${userId}/sub-users/${subUserId}/assigned-asset/options`, {
335
+ params
336
+ });
337
+ }
338
+ };
339
+ const API$B = createAxiosInstance({
340
+ prefix: "/utility/v2"
341
+ });
342
+ const FileManagerServices = {
343
+ /**
344
+ * Get storage information.
345
+ *
346
+ * @returns {Promise<AxiosResponse>} The Axios Response.
347
+ */
348
+ getStorageInformation: () => {
349
+ return API$B.get("/files/storage");
350
+ },
351
+ /**
352
+ * Get file manager data.
353
+ *
354
+ * @param {FileType} type - The type of the file.
355
+ * @param {FileManagerFilterParams} [params] - The parameters for filtering.
356
+ * @returns {Promise<AxiosResponse>} The Axios Response.
357
+ */
358
+ getFileManager: (type, params) => {
359
+ return API$B.get(`/${type}`, { params });
360
+ },
361
+ /**
362
+ * Get file manager options.
363
+ *
364
+ * @param {FileType} type - The type of the file.
365
+ * @param {FileManagerOptionBoolean} [params] - The parameters for options.
366
+ * @returns {Promise<AxiosResponse>} The Axios Response.
367
+ */
368
+ getFileManagerOption: (type, params) => {
369
+ return API$B.get(`/${type}/options`, { params });
370
+ },
371
+ /**
372
+ * Recover files.
373
+ *
374
+ * @param {FileType} type - The type of the file.
375
+ * @param {object} body - The body of the request.
376
+ * @returns {Promise<AxiosResponse>} The Axios Response.
377
+ */
378
+ recoverFiles: (type, body) => {
379
+ return API$B.put(`/${type}/recover`, body);
380
+ },
381
+ /**
382
+ * Delete files.
383
+ *
384
+ * @param {FileType} type - The type of the file.
385
+ * @param {DeleteFileManagerDto} params - The params of the request.
386
+ * @returns {Promise<AxiosResponse>} The Axios Response.
387
+ */
388
+ deleteFiles: (type, params) => {
389
+ return API$B.delete(`/${type}`, { params });
390
+ },
391
+ /**
392
+ * Delete files permanently.
393
+ *
394
+ * @param {FileType} type - The type of the file.
395
+ * @param {object} body - The body of the request.
396
+ * @returns {Promise<AxiosResponse>} The Axios Response.
397
+ */
398
+ deletePermanently: (type, params) => {
399
+ return API$B.delete(`/${type}/delete-permanent`, { params });
400
+ }
401
+ };
402
+ const API$A = createAxiosInstance({
403
+ prefix: "/settings-user-role/v2"
404
+ });
405
+ const RoleServices = {
406
+ /**
407
+ * Retrieves the transaction role for the given group and transaction name.
408
+ * @param {string} groupId - The ID of the group to retrieve the transaction role for.
409
+ * @param {string} transactionName - The name of the transaction to retrieve the role for.
410
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
411
+ */
412
+ getTransactionRole: (groupId, transactionName) => {
413
+ return API$A.get(`/transaction-roles/${groupId}/${transactionName}`);
414
+ },
415
+ getTransactionRoleTypes: (groupKeys, transactionName) => {
416
+ return API$A.get(`/transaction-roles/${transactionName}/types`, {
417
+ params: { groupKeys }
418
+ });
419
+ },
420
+ /**
421
+ * Updates the users assigned to the given transaction role.
422
+ * @param {string} groupId - The ID of the group the transaction role belongs to.
423
+ * @param {string} transactionName - The name of the transaction to update.
424
+ * @param {UpdateUser} body - The request body containing the updated user information.
425
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
426
+ */
427
+ putUpdateUsers: (groupId, transactionName, body) => {
428
+ return API$A.put(
429
+ `/transaction-roles/${groupId}/${transactionName}/update-user`,
430
+ body
431
+ );
432
+ },
433
+ /**
434
+ * Updates the approval level for the given transaction role.
435
+ * @param {string} groupId - The ID of the group the transaction role belongs to.
436
+ * @param {string} transactionName - The name of the transaction to update.
437
+ * @param {UserApprovalLevel} body - The request body containing the updated approval level.
438
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
439
+ */
440
+ putUpdateLevel: (groupId, transactionName, body) => {
441
+ return API$A.put(
442
+ `/transaction-roles/${groupId}/${transactionName}/update-approval-level`,
443
+ body
444
+ );
445
+ },
446
+ /**
447
+ * Updates the group management settings for the given transaction role.
448
+ * @param {string} groupId - The ID of the group the transaction role belongs to.
449
+ * @param {string} transactionName - The name of the transaction to update.
450
+ * @param {GroupManageByParent} body - The request body containing the updated management settings.
451
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
452
+ */
453
+ putUpdateGroupManage: (groupId, transactionName, body) => {
454
+ return API$A.put(
455
+ `/transaction-roles/${groupId}/${transactionName}/update-manage-by-parent`,
456
+ body
457
+ );
458
+ },
459
+ getUserAssignedSystemRole: (userId) => {
460
+ return API$A.get(`/system-roles/user/${userId}`);
461
+ },
462
+ getAssignedUserAmounts: () => {
463
+ return API$A.get("/system-roles/amounts");
464
+ },
465
+ getPermissionUser: (permissionType, params) => {
466
+ if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
467
+ const type = permissionType === "totalControl" ? "total-control" : "read-only";
468
+ return API$A.get(`/system-roles/total-control-read-only/${type}`, {
469
+ params
470
+ });
471
+ }
472
+ return API$A.get(`/system-roles/permission/${permissionType}`, { params });
473
+ },
474
+ getPermissionUserOptions: (permissionType, params) => {
475
+ if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
476
+ const type = permissionType === "totalControl" ? "total-control" : "read-only";
477
+ return API$A.get(`/system-roles/total-control-read-only/${type}/options`, {
478
+ params
479
+ });
480
+ }
481
+ return API$A.get(`/system-roles/permission/${permissionType}/options`, {
482
+ params
483
+ });
484
+ },
485
+ getUserGroups: (params, permissionType) => {
486
+ return API$A.get(`/system-roles/permission/${permissionType}/groups`, {
487
+ params
488
+ });
489
+ },
490
+ postAssignUser: (body, permissionType) => {
491
+ if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
492
+ const type = permissionType === "totalControl" ? "total-control" : "read-only";
493
+ return API$A.post(`/system-roles/total-control-read-only/${type}`, body);
494
+ }
495
+ return API$A.post(`/system-roles/permission/${permissionType}`, body);
496
+ },
497
+ putEditUser: (body, roleId) => {
498
+ return API$A.put(`/system-roles/${roleId}`, body);
499
+ },
500
+ deleteRemoveUser: (body, permissionType) => {
501
+ if (["totalControl", "readOnly"].includes(permissionType ?? "")) {
502
+ const type = permissionType === "totalControl" ? "total-control" : "read-only";
503
+ return API$A.put(`/system-roles/total-control-read-only/${type}`, body);
504
+ }
505
+ return API$A.put("/system-roles", body);
506
+ }
507
+ };
508
+ const API$z = createAxiosInstance({
509
+ prefix: "/settings-attribute/v2/open-api"
510
+ });
511
+ const OpenAPIServices = {
512
+ getOpenAPIDocs: (params) => {
513
+ return API$z.get(`/${params.doc}`);
514
+ },
515
+ putGenerateToken: () => {
516
+ return API$z.put("/generate");
517
+ },
518
+ // This is if the dummy was not dummy
519
+ getToken: () => {
520
+ return API$z.get("");
521
+ },
522
+ putRequestOpenAPI: () => {
523
+ return API$z.put("/request");
524
+ },
525
+ putCancelRequestOpenAPI: () => {
526
+ return API$z.put("/cancel-request");
527
+ }
528
+ };
529
+ const API$y = createAxiosInstance({
530
+ prefix: "/import/v2"
531
+ });
532
+ const ImportServices = {
533
+ getImport: (importUrl, params) => {
534
+ return API$y.get(`/${importUrl}`, { params });
535
+ },
536
+ postImportTemporary: (importUrl, data) => {
537
+ const headers = { "Content-Type": "multipart/form-data" };
538
+ return API$y.post(`/${importUrl}/temporary`, data, { headers });
539
+ },
540
+ deleteImportTemporary: (importUrl, params) => {
541
+ return API$y.delete(`/${importUrl}/temporary`, { params });
542
+ },
543
+ postDuplicateImport: (importUrl, body) => {
544
+ return API$y.post(`/${importUrl}/duplicate`, body);
545
+ },
546
+ putEditImport: (importUrl, body) => {
547
+ return API$y.put(`/${importUrl}`, body);
548
+ },
549
+ postImport: (importUrl, controller, body) => {
550
+ return API$y.post(importUrl, body, { signal: controller.signal });
551
+ },
552
+ putImportCancelProgress: (importUrl) => {
553
+ return API$y.put(`/${importUrl}/cancel-progress`);
554
+ }
555
+ };
556
+ const API$x = createAxiosInstance({
557
+ env: "APP_TAGSAMURAI_API",
558
+ prefix: "/assignment/v2"
559
+ });
560
+ const AssignmentServices$1 = {
561
+ getPreListData: (params) => {
562
+ return API$x.get("/prelist", { params });
563
+ },
564
+ getPreListOptions: (params) => {
565
+ return API$x.get("/prelist/options", { params });
566
+ },
567
+ getRequestData: (params) => {
568
+ return API$x.get("/prelist/request", { params });
569
+ },
570
+ postAddPrelistData: (body) => {
571
+ return API$x.post("/prelist", body);
572
+ },
573
+ getDetailRequestData: (id, params) => {
574
+ return API$x.get(`/transaction/${id}/request`, { params });
575
+ },
576
+ getDetailRequestOption: (params, id) => {
577
+ return API$x.get(`/transaction/${id}/request/options`, { params });
578
+ },
579
+ getTransactionData: (params) => {
580
+ return API$x.get("/transaction", { params });
581
+ },
582
+ getTransactionOptions: (params) => {
583
+ return API$x.get("/transaction/options", { params });
584
+ },
585
+ getDetailTransactionData: (id) => {
586
+ return API$x.get(`/transaction/${id}`);
587
+ },
588
+ getTransactionApproval: (params) => {
589
+ return API$x.get("/approval", { params });
590
+ },
591
+ getApprovalData: (transactionId, params) => {
592
+ return API$x.get(`/approval/transaction/${transactionId}`, { params });
593
+ },
594
+ getTransactionApprovalOptions: (params) => {
595
+ return API$x.get("/approval/options", { params });
596
+ },
597
+ getApprovalOptions: (transactionId, params) => {
598
+ return API$x.get(`/approval/transaction/${transactionId}/options`, {
599
+ params
600
+ });
601
+ },
602
+ getTransactionApprovers: (id) => {
603
+ return API$x.get(`/approval/transaction/${id}/transaction`);
604
+ },
605
+ putApproveApproval: (body) => {
606
+ return API$x.put("/approval/approve", body);
607
+ },
608
+ getDetailTransactionLog: (id) => {
609
+ return API$x.get(`/transaction/request/${id}/transaction-log`);
610
+ },
611
+ getVerifyAsset: (params, id) => {
612
+ return API$x.get(`/transaction/${id}/request/scan`, { params });
613
+ },
614
+ putEditAssignedUser: (id, body) => {
615
+ return API$x.put(`/transaction/${id}/user`, body);
616
+ },
617
+ putEditEmailConfirmation: (id, body) => {
618
+ return API$x.put(`/transaction/${id}/update-email-or-assigned-user`, body);
619
+ },
620
+ postSendConfirmationEmail: (id) => {
621
+ return API$x.post(`/transaction/${id}/send-confirmation-email`);
622
+ },
623
+ postTransaction: (body) => {
624
+ return API$x.post("/transaction", body);
625
+ },
626
+ putTransactionRequest: (id, body) => {
627
+ return API$x.put(`/transaction/${id}/request`, body);
628
+ },
629
+ putCancelTransaction: (body) => {
630
+ return API$x.put("/transaction/cancel", body);
631
+ },
632
+ putCancelAssignmentRequest: (body) => {
633
+ return API$x.put("/transaction/request/cancel", body);
634
+ },
635
+ putVerifyRequest: (body, id) => {
636
+ return API$x.put(`/transaction/${id}/verify-requests`, body);
637
+ },
638
+ putVerifyToken: (body) => {
639
+ return API$x.put("/transaction/verify-token", body);
640
+ },
641
+ putHandoverConfirm: (body) => {
642
+ return API$x.put("/transaction/handover-confirmation", body);
643
+ },
644
+ putAssignHandover: (transaction) => {
645
+ return API$x.put(`/transaction/${transaction}/handover`);
646
+ },
647
+ deletePrelistData: (params) => {
648
+ return API$x.delete("/prelist", { params });
649
+ },
650
+ deleteRequestPrelistData: (body) => {
651
+ return API$x.delete("/prelist/request", { data: body });
652
+ },
653
+ getAssignedByAsset: (params) => {
654
+ return API$x.get("/transaction/request/assigned/by-asset", { params });
655
+ },
656
+ getAssignedByAssetOptions: (params) => {
657
+ return API$x.get("/transaction/request/assigned/by-asset/options", {
658
+ params
659
+ });
660
+ },
661
+ getAssignedByUser: (params) => {
662
+ return API$x.get("/transaction/request/assigned/by-user", { params });
663
+ },
664
+ getAssignedByUserOptions: (params) => {
665
+ return API$x.get("/transaction/request/assigned/by-user/options", { params });
666
+ },
667
+ postUnassignPrelistAsset: (body) => {
668
+ return API$x.post("/prelist", body);
669
+ },
670
+ postUnassignPrelistUser: (body) => {
671
+ return API$x.post("/prelist/unassign/by-user", body);
672
+ },
673
+ putUnassignRequest: (body) => {
674
+ return API$x.put("/transaction/request/unassign", body);
675
+ },
676
+ putReportDone: (id, body) => {
677
+ return API$x.put(`/transaction/${id}/confirm-report-done`, body);
678
+ },
679
+ getHistory: (type, params) => {
680
+ const urlType = type.split(" ").join("-").toLowerCase();
681
+ return API$x.get(`/transaction/history/${urlType}`, { params });
682
+ },
683
+ getHistoryOptions: (params) => {
684
+ return API$x.get("/transaction/history/options", { params });
685
+ },
686
+ getHistoryByTransactionOptions: (params) => {
687
+ return API$x.get("/transaction/history/by-transaction/options", { params });
688
+ },
689
+ putCancelReport: (body) => {
690
+ return API$x.put("/transaction/request/cancel-report", body);
691
+ },
692
+ getTaskAssignment: async (params) => {
693
+ return API$x.get("/transaction/my-asset/task", { params });
694
+ },
695
+ getTaskAssignmentOptions: async (params) => {
696
+ return API$x.get("/transaction/my-asset/task/options", { params });
697
+ },
698
+ getAssignedAsset: async (params) => {
699
+ return API$x.get("/transaction/my-asset/assigned-asset", { params });
700
+ },
701
+ getAssignedAssetOptions: async (params) => {
702
+ return API$x.get("/transaction/my-asset/assigned-asset/options", { params });
703
+ },
704
+ putCancelAssignment: async (body) => {
705
+ return API$x.put("/transaction/cancel", { id: body.id });
706
+ },
707
+ putCancelReportById: async (body) => {
708
+ return API$x.put(`/transaction/request/${body.id}/cancel-report`);
709
+ }
710
+ };
711
+ const API$w = createAxiosInstance({
712
+ prefix: "/assignment/v2"
713
+ });
714
+ const AssignmentServices = {
715
+ ...AssignmentServices$1,
716
+ // Temporary inclusion of methods from OldAssignmentServices. Move individual methods here once they are refactored and ready.
717
+ getTransactionData: (params) => {
718
+ return API$w.get("/transaction", { params });
719
+ },
720
+ getTransactionOptions: (params) => {
721
+ return API$w.get("/transaction/options", { params });
722
+ },
723
+ getDetailTransactionLog: (id) => {
724
+ return API$w.get(`/transaction/request/${id}/transaction-log`);
725
+ },
726
+ postTransaction: (body) => {
727
+ return API$w.post("/transaction", body);
728
+ },
729
+ putTransaction: (body) => {
730
+ return API$w.put("/transaction", body);
731
+ },
732
+ putUnassignTransaction: (body) => {
733
+ return API$w.put("/transaction/unassign", body);
734
+ },
735
+ putCancelReport: (body) => {
736
+ return API$w.put("/transaction/request/cancel-report", body);
737
+ }
738
+ };
739
+ const API$v = createAxiosInstance({
740
+ prefix: "/license/v2"
741
+ });
742
+ const TotalLicenseServices = {
743
+ getTotalLicense: () => {
744
+ return API$v.get("/total-license");
745
+ },
746
+ getPurchasedData: (params) => {
747
+ return API$v.get("/purchase", { params });
748
+ }
749
+ };
750
+ const LicenseConcurrentServices = {
751
+ getConcurrentUserData: () => {
752
+ return API$v.get("/concurrent-user-data");
753
+ },
754
+ getConcurrentUserList: (params) => {
755
+ return API$v.get("/concurrent-user", { params });
756
+ },
757
+ putLogoutUsers: (body) => {
758
+ return API$v.put("/concurrent-user", body);
759
+ }
760
+ };
761
+ const LicenseAssetServices = {
762
+ getFixedAssetPerGroup: (groupId, params) => {
763
+ return API$v.get(`/${groupId}/assets`, { params });
764
+ },
765
+ deleteAssetData: (body) => {
766
+ return API$v.delete("/assets", { data: body });
767
+ }
768
+ };
769
+ const LicenseServices = {
770
+ getFilterOptions: (path, params) => {
771
+ return API$v.get(`/${path}`, { params });
772
+ },
773
+ ...TotalLicenseServices,
774
+ ...LicenseConcurrentServices,
775
+ ...LicenseAssetServices
776
+ };
777
+ const API$u = createAxiosInstance({
778
+ prefix: "/damage-repair-ticketing/v2"
779
+ });
780
+ const DamageServices = {
781
+ getDamageReportList: (params) => {
782
+ return API$u.get("/", { params });
783
+ },
784
+ getDamageReportListFilterOptions: (params) => {
785
+ return API$u.get("/options", { params });
786
+ },
787
+ getDamageReportDetail: (reportId) => {
788
+ return API$u.get(`/${reportId}`);
789
+ },
790
+ putReportDamage: (id, body) => {
791
+ const headers = { "Content-Type": "multipart/form-data" };
792
+ return API$u.put(`/${id}/report-damage`, body, { headers });
793
+ },
794
+ putMarkAsRepaired: (body) => {
795
+ return API$u.put("/repair", body);
796
+ }
797
+ };
798
+ const API$t = createAxiosInstance({
799
+ prefix: "/assets/v2/my-assets"
800
+ });
801
+ const MyAssetServices = {
802
+ getAssigned: async (params) => {
803
+ return API$t.get("/assigned", { params });
804
+ },
805
+ getAssignedOptions: async (params) => {
806
+ return API$t.get("/assigned/options", { params });
807
+ },
808
+ getBorrowed: async (params) => {
809
+ return API$t.get("/borrowed", { params });
810
+ },
811
+ getBorrowedOptions: async (params) => {
812
+ return API$t.get("/borrowed/options", { params });
813
+ },
814
+ getHistory: async (params) => {
815
+ return API$t.get("/history", { params });
816
+ },
817
+ getHistoryOptions: async (params) => {
818
+ return API$t.get("/history/options", { params });
819
+ }
820
+ };
821
+ const PREFIX = "/transfer/v2";
822
+ const PrelistAPI = createAxiosInstance({
823
+ env: "APP_TAGSAMURAI_API",
824
+ prefix: `${PREFIX}/prelist`
825
+ });
826
+ const TransactionAPI = createAxiosInstance({
827
+ env: "APP_TAGSAMURAI_API",
828
+ prefix: `${PREFIX}/transaction`
829
+ });
830
+ const ApprovalAPI = createAxiosInstance({
831
+ env: "APP_TAGSAMURAI_API",
832
+ prefix: `${PREFIX}/approval`
833
+ });
834
+ const TransferServices = {
835
+ // ------ TRANSACTION ------
836
+ getTransactions: (params) => {
837
+ return TransactionAPI.get("/", { params });
838
+ },
839
+ getTransactionDetail: (id) => {
840
+ return TransactionAPI.get(`/${id}`);
841
+ },
842
+ getTransactionDetailAssets: (id, params) => {
843
+ return TransactionAPI.get(`/${id}/request`, { params });
844
+ },
845
+ getRequestFilterOptions: (id, field) => {
846
+ const params = {};
847
+ if (field) {
848
+ params[field] = true;
849
+ } else {
850
+ params.nameOptions = true;
851
+ params.brandOptions = true;
852
+ params.modelOptions = true;
853
+ }
854
+ return TransactionAPI.get(`/${id}/request/options`, { params });
855
+ },
856
+ getOldTransactionLog: (id) => {
857
+ return TransactionAPI.get(`/request/${id}/transaction-log`);
858
+ },
859
+ getOldTransactionOptions: (field) => {
860
+ const params = {};
861
+ params[field] = true;
862
+ return TransactionAPI.get("/options", { params });
863
+ },
864
+ postOldCreateTransaction: (body) => {
865
+ return TransactionAPI.post("/", body);
866
+ },
867
+ putCancelTransactions: (ids) => {
868
+ const body = { id: ids };
869
+ return TransactionAPI.put("/cancel", body);
870
+ },
871
+ putUpdateTransaction: (id, body) => {
872
+ return TransactionAPI.put(`/${id}`, body);
873
+ },
874
+ putCancelRequests: (ids) => {
875
+ const body = { id: ids };
876
+ return TransactionAPI.put("/request/cancel", body);
877
+ },
878
+ getHistoryByTransaction: (params) => {
879
+ return TransactionAPI.get("/history", { params });
880
+ },
881
+ getHistoryByTransactionOptions: (field) => {
882
+ const params = {};
883
+ params[field] = true;
884
+ return TransactionAPI.get("/history/options", { params });
885
+ },
886
+ getHistoryByAsset: (params) => {
887
+ return TransactionAPI.get("/history/by-asset", { params });
888
+ },
889
+ getHistoryByAssetOptions: (field) => {
890
+ const params = {};
891
+ params[field] = true;
892
+ return TransactionAPI.get("/history/by-asset/options", { params });
893
+ },
894
+ getApproverList: (tranasctionId) => {
895
+ return TransactionAPI.get(`/${tranasctionId}/approval-history`);
896
+ },
897
+ putHandoverTransaction: (id, body) => {
898
+ return TransactionAPI.put(`/${id}/handover`, body);
899
+ },
900
+ // ------ PRELIST ------
901
+ getPrelist: (params) => {
902
+ return PrelistAPI.get("/", { params });
903
+ },
904
+ postAddPrelistData: (body) => {
905
+ return PrelistAPI.post("/", body);
906
+ },
907
+ deletePrelist: (ids) => {
908
+ return PrelistAPI.delete("/", {
909
+ params: {
910
+ id: JSON.stringify(ids)
911
+ }
912
+ });
913
+ },
914
+ getPrelistAssets: (id) => {
915
+ const params = { id };
916
+ return PrelistAPI.get("/request", { params });
917
+ },
918
+ // APPROVAL
919
+ getApprovals: (status, params) => {
920
+ const formattedParams = { ...params, status: JSON.stringify([status]) };
921
+ return ApprovalAPI.get("/", { params: formattedParams });
922
+ },
923
+ getApprovalOptions: (status, field) => {
924
+ const params = {
925
+ status: JSON.stringify([status])
926
+ };
927
+ params[field] = true;
928
+ return ApprovalAPI.get("/options", { params });
929
+ },
930
+ getApprovalDetail: (id, approvalType) => {
931
+ const params = {
932
+ groupType: approvalType
88
933
  };
89
- return o.get("/by-id", { params: r });
934
+ return ApprovalAPI.get(`/transaction/${id}`, { params });
935
+ },
936
+ getApprovalDetailOptions: (id, field, approvalType) => {
937
+ const params = {};
938
+ params[field] = true;
939
+ params.groupType = approvalType;
940
+ return ApprovalAPI.get(`/transaction/${id}/options`, { params });
941
+ },
942
+ putUpdateApproval: (body) => {
943
+ return ApprovalAPI.put("/approve", body);
944
+ }
945
+ };
946
+ const API$s = createAxiosInstance({
947
+ prefix: "/transfer/v2"
948
+ });
949
+ const TransferServicesGo = {
950
+ ...TransferServices,
951
+ getTransactionData: (params) => {
952
+ return API$s.get("/transaction", { params });
953
+ },
954
+ getTransactionOptions: (params) => {
955
+ return API$s.get("/transaction/options", { params });
956
+ },
957
+ getTransactionLog: (id) => {
958
+ return API$s.get(`/transaction/request/${id}/transaction-log`);
959
+ },
960
+ postCreateTransaction: (body) => {
961
+ return API$s.post("/transaction", body);
962
+ }
963
+ };
964
+ const API$r = createAxiosInstance({
965
+ env: "APP_TAGSAMURAI_API",
966
+ prefix: "/borrowing/v2"
967
+ });
968
+ const BorrowServices = {
969
+ getTaskBorrowing: async (params) => {
970
+ return API$r.get("/transaction/my-asset/task", { params });
971
+ },
972
+ getTaskBorrowingOptions: async (params) => {
973
+ return API$r.get("/transaction/my-asset/task/options", { params });
974
+ },
975
+ getBorrowedAsset: async (params) => {
976
+ return API$r.get("/transaction/my-asset/borrowed-asset", { params });
977
+ },
978
+ getBorrowedOptions: async (params) => {
979
+ return API$r.get("/transaction/my-asset/borrowed-asset/options", { params });
980
+ },
981
+ getHistory: async (params) => {
982
+ return API$r.get("/transaction/my-asset/history", { params });
983
+ },
984
+ getHistoryOptions: async (params) => {
985
+ return API$r.get("/transaction/my-asset/history/options", { params });
986
+ },
987
+ postAddPrelistData: (body) => {
988
+ return API$r.post("/prelist", body);
989
+ },
990
+ putCancelBorrowing: async (body) => {
991
+ return API$r.put("/transaction/cancel", { id: body.id });
992
+ },
993
+ putCancelExtensionRequest: async (body) => {
994
+ return API$r.put(`/transaction/${body.id}/cancel-extension`);
995
+ },
996
+ putCancelRequestReport: async (body) => {
997
+ return API$r.put(`/transaction/request/${body.id}/cancel-report`);
998
+ },
999
+ putDeclineExtensionRequest: async (body) => {
1000
+ return API$r.put("transaction/request/decline", body);
1001
+ },
1002
+ putUpdateRequestExtension: async (body) => {
1003
+ return API$r.put("transaction/request/duration", body);
1004
+ },
1005
+ // ------------------------------------------------------------------------------------------------------------ //
1006
+ getBorrowingPrelist: (params) => {
1007
+ return API$r.get("/prelist", { params });
1008
+ },
1009
+ getBorrowingPrelistOptions: (params) => {
1010
+ return API$r.get("/prelist/options", { params });
1011
+ },
1012
+ deleteBorrowingPrelist: (id) => {
1013
+ return API$r.delete("/prelist", { data: { id } });
1014
+ },
1015
+ getBorrowingRequest: (params) => {
1016
+ return API$r.get("/prelist/request", { params });
1017
+ },
1018
+ getBorrowingRequestOptions: (params) => {
1019
+ return API$r.get("/prelist/request/options", { params });
1020
+ },
1021
+ postBorrowingRequest: (data) => {
1022
+ return API$r.post("/prelist/request", data);
1023
+ },
1024
+ putBorrowingRequest: (data) => {
1025
+ return API$r.put("/prelist/request", data);
1026
+ },
1027
+ deleteBorrowingRequest: (id) => {
1028
+ return API$r.delete("/prelist/request", { data: { id } });
1029
+ },
1030
+ postBorrowingTransaction: (data) => {
1031
+ return API$r.post("/transaction", data, { params: { sourceWeb: true } });
1032
+ },
1033
+ getBorrowingTransaction: (params) => {
1034
+ return API$r.get("/transaction", { params });
1035
+ },
1036
+ getBorrowingTransactionOptions: (params) => {
1037
+ return API$r.get("/transaction/options", { params });
1038
+ },
1039
+ putCancelBorrowingTransaction: (id) => {
1040
+ return API$r.put("/transaction/cancel", { id });
1041
+ },
1042
+ putCancelBorrowingRequest: (id) => {
1043
+ return API$r.put("/transaction/request/cancel", { id });
1044
+ },
1045
+ putCancelExtendBorrowingRequest: (id) => {
1046
+ return API$r.put("/transaction/request/extend/cancel", { id });
1047
+ },
1048
+ getBorrowingTransactionDetail: (id) => {
1049
+ return API$r.get(`/transaction/${id}`);
1050
+ },
1051
+ getBorrowingTransactionRequestList: (params) => {
1052
+ return API$r.get("/transaction/request", { params });
1053
+ },
1054
+ getBorrowingTransactionRequest: (id, params) => {
1055
+ return API$r.get(`/transaction/${id}/request`, { params });
1056
+ },
1057
+ getBorrowingTransactionRequestOptions: (id, params) => {
1058
+ return API$r.get(`/transaction/${id}/request/options`, { params });
1059
+ },
1060
+ putBorrowingTransactionRequest: (id, data) => {
1061
+ return API$r.put(`/transaction/${id}/request`, data);
1062
+ },
1063
+ getApprovalList: (id) => {
1064
+ return API$r.get(`/approval/transaction/${id}/transaction`);
1065
+ },
1066
+ putUpdateEmailorBorrower: (id, data) => {
1067
+ return API$r.put(`/transaction/${id}/update-email-or-borrower`, data);
1068
+ },
1069
+ getTransactionRequestScan: (id, tag) => {
1070
+ return API$r.get(`/transaction/${id}/request/scan`, { params: { tag } });
1071
+ },
1072
+ putUpdateBorrower: (id, userId) => {
1073
+ return API$r.put(`/transaction/${id}/user`, { user: userId });
1074
+ },
1075
+ postSendConfirmationEmail: (id) => {
1076
+ return API$r.post(`/transaction/${id}/send-confirmation-email`);
1077
+ },
1078
+ putVerifyRequests: (id, data) => {
1079
+ return API$r.put(`/transaction/${id}/verify-requests`, data);
1080
+ },
1081
+ getBorrowingTransactionHistoryByTransaction: (params) => {
1082
+ return API$r.get("/transaction/history/by-transaction", { params });
1083
+ },
1084
+ getBorrowingTransactionHistoryByAsset: (params) => {
1085
+ return API$r.get("/transaction/history/by-asset", { params });
1086
+ },
1087
+ getBorrowingTransactionHistoryOptions: (params) => {
1088
+ return API$r.get("/transaction/history/options", { params });
1089
+ },
1090
+ putBorrowingVerifyToken: (token) => {
1091
+ return API$r.put("/transaction/verify-token", { token });
1092
+ },
1093
+ putBorrowingHandoverConfirmation: (data) => {
1094
+ return API$r.put("/transaction/handover-confirmation", data);
1095
+ },
1096
+ putBorrowingHandover: (id) => {
1097
+ return API$r.put(`/transaction/${id}/handover`);
1098
+ },
1099
+ putBorrowingExtendRequest: (data) => {
1100
+ return API$r.put("/transaction/request/extend", data);
1101
+ },
1102
+ putBorrowingExtendApproval: (data) => {
1103
+ return API$r.put("/approval/approve/request-extension", data, {
1104
+ params: { sourceWeb: true }
1105
+ });
1106
+ },
1107
+ putBorrowingDeclineExtendRequest: (id) => {
1108
+ return API$r.put("/transaction/request/decline", { id });
1109
+ },
1110
+ getBorrowingBorrowedAsset: (params) => {
1111
+ return API$r.get("/transaction/request/borrowed/by-asset", { params });
1112
+ },
1113
+ getBorrowingBorrowedAssetOptions: (params) => {
1114
+ return API$r.get("/transaction/request/borrowed/by-asset/options", {
1115
+ params
1116
+ });
1117
+ },
1118
+ getBorrowingBorrowedBorrower: (params) => {
1119
+ return API$r.get("/transaction/request/borrowed/by-user", { params });
1120
+ },
1121
+ putBorrowingReportDamaged: (id, data) => {
1122
+ return API$r.put(`/transaction/request/${id}/damaged`, data);
1123
+ },
1124
+ putBorrowingReportMissing: (id, data) => {
1125
+ return API$r.put(`/transaction/request/${id}/missing`, data);
1126
+ },
1127
+ putBorrowingReturn: (id) => {
1128
+ return API$r.put("/transaction/request/return", { id });
1129
+ },
1130
+ getBorrowingLog: (id) => {
1131
+ return API$r.get(`/transaction/request/${id}/transaction-log`);
1132
+ },
1133
+ putConfirmReportDone: (id, data) => {
1134
+ return API$r.put(`/transaction/request/${id}/confirm-report-done`, data);
1135
+ },
1136
+ putCancelReportBulk: (id) => {
1137
+ return API$r.put("/transaction/request/cancel-report", {
1138
+ id
1139
+ });
1140
+ },
1141
+ putBorrowingEditExtension: (data) => {
1142
+ return API$r.put("/transaction/request/duration", data);
1143
+ },
1144
+ getApproval: (params) => {
1145
+ return API$r.get("/approval", { params });
1146
+ },
1147
+ getApprovalOptions: (params) => {
1148
+ return API$r.get("/approval/options", { params });
1149
+ },
1150
+ getApprovalTransactionRequest: (id, params) => {
1151
+ return API$r.get(`/approval/transaction/${id}`, { params });
1152
+ },
1153
+ getApprovalTransactionRequestOptions: (id, params) => {
1154
+ return API$r.get(`/approval/transaction/${id}/options`, { params });
1155
+ },
1156
+ putApprovalApprove: (data) => {
1157
+ return API$r.put("/approval/approve", data, {
1158
+ params: { sourceWeb: true }
1159
+ });
1160
+ }
1161
+ };
1162
+ const API$q = createAxiosInstance({
1163
+ prefix: "/borrowing/v2"
1164
+ });
1165
+ const BorrowServicesGo = {
1166
+ ...BorrowServices,
1167
+ // Temporary inclusion of methods from OldBorrowServices. Move individual methods here once they are refactored and ready.
1168
+ getTransactions: async (params) => {
1169
+ return API$q.get("/transaction", { params });
1170
+ },
1171
+ getTransactionOptions: async (params) => {
1172
+ return API$q.get("/transaction/options", { params });
1173
+ },
1174
+ getTransactionLog: async (id) => {
1175
+ return API$q.get(`/transaction/request/${id}/transaction-log`);
1176
+ },
1177
+ postTransaction: async (body) => {
1178
+ return API$q.post("/transaction", body);
1179
+ },
1180
+ putTransaction: async (body) => {
1181
+ return API$q.put("/transaction", body);
1182
+ },
1183
+ putTransactionReturn: async (requestIds) => {
1184
+ const body = { id: requestIds };
1185
+ return API$q.put("/transaction/return", body);
1186
+ },
1187
+ putCancelReport: async (requestIds) => {
1188
+ const body = { id: requestIds };
1189
+ return API$q.put("/transaction/request/cancel-report", body);
1190
+ }
1191
+ };
1192
+ const API$p = createAxiosInstance({
1193
+ prefix: "/disposal/v2/"
1194
+ });
1195
+ const DisposalServices = {
1196
+ getReportedDisposal: (params) => {
1197
+ return API$p.get("/report", { params });
1198
+ },
1199
+ getReportedDisposalOptions: (params) => {
1200
+ return API$p.get("/report/options", { params });
1201
+ },
1202
+ postReportDisposal: (body) => {
1203
+ return API$p.post("/report", body);
1204
+ },
1205
+ deleteCancelReport: (params) => {
1206
+ params.isFromDisposal = "false";
1207
+ return API$p.delete("/report/cancel-report", { params });
1208
+ },
1209
+ deleteDeclineReport: (params) => {
1210
+ params.isFromDisposal = "true";
1211
+ return API$p.delete("/report/cancel-report", { params });
1212
+ },
1213
+ getDisposalHistory: (params) => {
1214
+ return API$p.get("/transaction", { params });
1215
+ },
1216
+ getHistoryByAssetOptions: (params) => {
1217
+ return API$p.get("/transaction/options", { params });
1218
+ },
1219
+ getDisposalTransactionLog: (requestId) => {
1220
+ return API$p.get(`/transaction/request/${requestId}/transaction-log`);
1221
+ },
1222
+ postCreateTransaction: (body) => {
1223
+ return API$p.post("/transaction", body);
1224
+ }
1225
+ };
1226
+ const API$o = createAxiosInstance({
1227
+ prefix: "/report/v2/reports"
1228
+ });
1229
+ const ReportServices = {
1230
+ getReportList: (params) => {
1231
+ return API$o.get("/schedules", { params });
1232
+ },
1233
+ getReportSchedule: (scheduleId) => {
1234
+ return API$o.get("/schedules/" + scheduleId);
1235
+ },
1236
+ getUniqueScheduleName: (name) => {
1237
+ return API$o.get("/schedules/unique-name", { params: { name } });
1238
+ },
1239
+ getFilterOptions: (params) => {
1240
+ return API$o.get("/schedules/options", { params });
1241
+ },
1242
+ putSetActive: (body) => {
1243
+ return API$o.put("/schedules/set-active", body);
1244
+ },
1245
+ putEditSchedule: (id, body) => {
1246
+ return API$o.put(`/schedules/${id}`, body);
1247
+ },
1248
+ deleteReports: (id) => {
1249
+ return API$o.delete("/schedules", { params: { id } });
1250
+ },
1251
+ postCreateSchedule: (data) => {
1252
+ return API$o.post("/schedules", data);
1253
+ },
1254
+ postDownloadReport: (data) => {
1255
+ return API$o.post("/download", data, { responseType: "arraybuffer" });
1256
+ },
1257
+ postGenerateReport: (data) => {
1258
+ return API$o.post("/generate", data);
90
1259
  }
91
- }, y = n({
92
- prefix: "/tracking/v2/missing"
93
- }), b = {
94
- putFoundAsset: (t, e) => {
95
- const r = { ids: [t], serialNumber: e };
96
- return y.put("/found", r);
1260
+ };
1261
+ const API$n = createAxiosInstance({
1262
+ prefix: "/settings-attribute/v2"
1263
+ });
1264
+ const getEndpoint = (type) => {
1265
+ return type === "category" ? "category" : "groups";
1266
+ };
1267
+ const GroupCategoryServices = {
1268
+ getGroupCategory: (type, params) => {
1269
+ return API$n.get(`/${getEndpoint(type)}/tree`, { params });
1270
+ },
1271
+ // Doesn't exist in company plan other than "Basic"
1272
+ getGroupCategoryList: (type, groupId, params) => {
1273
+ return API$n.get(`/${getEndpoint(type)}/${groupId}`, { params });
1274
+ },
1275
+ getNames: (type) => {
1276
+ return API$n.get(`/${getEndpoint(type)}/names`);
1277
+ },
1278
+ getCodes: (type) => {
1279
+ return API$n.get(`/${getEndpoint(type)}/codes`);
1280
+ },
1281
+ postCreateGroupCategory: (type, body) => {
1282
+ return API$n.post(`/${getEndpoint(type)}`, body);
1283
+ },
1284
+ putEditGroupCategory: (type, body, objectId) => {
1285
+ return API$n.put(`/${getEndpoint(type)}/${objectId}`, body);
1286
+ },
1287
+ // Doesn't exist in company plan other than "Enterprise"
1288
+ putMoveGroup: (body, objectId) => {
1289
+ return API$n.put(`/groups/${objectId}/move-group`, body);
1290
+ },
1291
+ // Doesn't exist in company plan other than "Enterprise"
1292
+ putEditBulkGroups: async (body) => {
1293
+ return API$n.put("/groups/bulk", body);
1294
+ },
1295
+ deleteGroupCategory: (type, body, objectId) => {
1296
+ return API$n.delete(`/${getEndpoint(type)}/${objectId}`, { data: body });
97
1297
  }
98
- }, P = n({
99
- prefix: "/v2/notification",
100
- env: "APP_LOGS_NOTIFICATION_API"
101
- }), E = {
102
- getNotifications: (t) => P.get("/", { params: t }),
103
- readNotification: (t) => P.put(`/${t}`)
104
- }, L = n({
105
- prefix: "/v2/session-log",
106
- env: "APP_LOGS_NOTIFICATION_API"
107
- }), x = {
108
- postLogout: () => L.post("/logout")
109
- }, c = n({
110
- prefix: "/tag/v2"
111
- }), w = {
112
- getScanQR: (t) => c.get("/qr", { params: { tag: t } }),
113
- getScanRFID: (t) => c.get("/rfid", { params: { tag: t } }),
114
- getRFIDQRTAG: (t) => c.get("/rfid-qr/scan", { params: t })
115
- }, O = n({
116
- prefix: "/tracking/v2/tracking"
117
- }), k = {
118
- putFoundAsset: (t, e, r) => {
119
- const a = {
120
- tag: t,
121
- group: e,
122
- serialNumber: r,
123
- type: "Global"
124
- };
125
- return O.put("/found", { params: a });
1298
+ };
1299
+ const API$m = createAxiosInstance({
1300
+ prefix: "/settings-attribute/v2/alias-code"
1301
+ });
1302
+ const AliasCodeServices = {
1303
+ getAliasCode: () => {
1304
+ return API$m.get("/");
1305
+ },
1306
+ postAliasCode: (data) => {
1307
+ return API$m.post("/", data);
1308
+ },
1309
+ getAliasCodeList: (params) => {
1310
+ return API$m.get(`/${params.object}/code-list`, { params });
126
1311
  }
127
- }, s = n({
128
- prefix: "/settings-user-role/v2"
129
- }), F = {
130
- reLogin: (t) => s.post("/auth/login", t),
131
- changePassword: (t) => s.put("/users/change-password", t),
132
- getUserDetail: (t) => s.get(`/users/${t}`),
133
- putEditUser: (t, e) => {
134
- const r = { "Content-Type": "multipart/form-data" };
135
- return s.put(`/users/${t}`, e, { headers: r });
136
- },
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
- }),
1312
+ };
1313
+ const API$l = createAxiosInstance({
1314
+ prefix: "/settings-attribute/v2/general-settings"
1315
+ });
1316
+ const GeneralSettingsServices = {
1317
+ getGeneralSettings: () => {
1318
+ return API$l.get("/");
1319
+ },
1320
+ putUpdateGeneralSettings: (data) => {
1321
+ return API$l.put("/", data);
1322
+ }
1323
+ };
1324
+ const API$k = createAxiosInstance({
1325
+ prefix: "/settings-attribute/v2/custom-field"
1326
+ });
1327
+ const CustomFieldServices = {
1328
+ getCustomField: async (params) => {
1329
+ return API$k.get("/", { params });
1330
+ },
1331
+ getCustomFieldsByCategory: (category, params) => {
1332
+ return API$k.get(`/${category}`, { params });
1333
+ },
1334
+ getOptions: async (params) => {
1335
+ return API$k.get("/options", { params });
1336
+ },
1337
+ postCreateCustomField: async (params, data) => {
1338
+ return API$k.post("/", data, { params });
1339
+ },
1340
+ putEditCustomField: async (params, data, id) => {
1341
+ return API$k.put(`/${id}`, data, { params });
1342
+ },
1343
+ putChangeStatus: async (params, data) => {
1344
+ return API$k.put("/bulk", data, { params });
1345
+ },
1346
+ deleteCustomField: async (params) => {
1347
+ return API$k.delete("/bulk", { params });
1348
+ },
1349
+ getUsedCustomFields: async () => {
1350
+ return API$k.get("/used-by-assets");
1351
+ }
1352
+ };
1353
+ const API$j = createAxiosInstance({
1354
+ prefix: "/settings-attribute/v2/asset-name-policy"
1355
+ });
1356
+ const AssetPolicyServices = {
1357
+ getList: (params) => {
1358
+ return API$j.get("/", { params });
1359
+ },
1360
+ getListFilterOptions: (params) => {
1361
+ return API$j.get("/options");
1362
+ },
1363
+ putUpdatePolicy: (body) => {
1364
+ return API$j.put("/", body);
1365
+ }
1366
+ };
1367
+ const API$i = createAxiosInstance({
1368
+ prefix: "/settings-user-role/v2/auth"
1369
+ });
1370
+ const onRejected$1 = (error) => {
1371
+ var _a, _b, _c, _d;
1372
+ 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") {
1373
+ window.onblur = void 0;
1374
+ window.onfocus = void 0;
1375
+ window.sessionExpired = true;
1376
+ return window.dispatchEvent(new CustomEvent("user:expired"));
1377
+ }
1378
+ return Promise.reject(error);
1379
+ };
1380
+ const AuthServices$1 = {
1381
+ reLogin: (body) => {
1382
+ API$i.interceptors.response.use((response) => {
1383
+ return response;
1384
+ }, onRejected$1);
1385
+ return API$i.post("/login", body);
1386
+ }
1387
+ };
1388
+ const DepreciationMethodAPI = createAxiosInstance({
1389
+ prefix: "/settings-attribute/v2/depreciaction-method"
1390
+ });
1391
+ const DepreciationGroupAPI = createAxiosInstance({
1392
+ prefix: "/settings-attribute/v2/depreciaction-group"
1393
+ });
1394
+ const AccountCodeAPI = createAxiosInstance({
1395
+ prefix: "/settings-attribute/v2/account-code"
1396
+ });
1397
+ const AccountingServices = {
1398
+ // Depreciation Method API Services
1399
+ getDepreciationMethod: () => {
1400
+ return DepreciationMethodAPI.get("");
1401
+ },
1402
+ changeDepreciationMethod: (body) => {
1403
+ return DepreciationMethodAPI.put("", {
1404
+ depreciationMethod: body
1405
+ });
1406
+ },
1407
+ cancelChangeDepreciationMethod: () => {
1408
+ return DepreciationMethodAPI.put("/cancel");
1409
+ },
1410
+ // Depreciation Group API Services
1411
+ getDepreciationList: (params) => {
1412
+ return DepreciationGroupAPI.get("", { params });
1413
+ },
1414
+ deleteDepreciationGroup: (id) => {
1415
+ return DepreciationGroupAPI.delete("", {
1416
+ data: { id }
1417
+ });
1418
+ },
1419
+ createNewDepreciationGroup: (body) => {
1420
+ return DepreciationGroupAPI.post("", body);
1421
+ },
1422
+ editDepreciationGroup: (body, id) => {
1423
+ return DepreciationGroupAPI.put(`/${id}`, body);
1424
+ },
1425
+ getFilterOptions: (params) => {
1426
+ return DepreciationGroupAPI.get("/options", { params });
1427
+ },
1428
+ // Account Code API Services
1429
+ getAccountCodeList: (params) => {
1430
+ return AccountCodeAPI.get("/account-code", { params });
1431
+ },
1432
+ deleteAccountCode: (id) => {
1433
+ return AccountCodeAPI.delete("/account-code", {
1434
+ data: { id }
1435
+ });
1436
+ },
1437
+ createNewAccountCode: (body) => {
1438
+ return AccountCodeAPI.post("/account-code", body);
1439
+ },
1440
+ editAccountCode: (body, id) => {
1441
+ return AccountCodeAPI.put("/account-code/" + id, body);
1442
+ }
1443
+ };
1444
+ const API$h = createAxiosInstance({
1445
+ env: "APP_TAGSAMURAI_API",
1446
+ prefix: "/settings-attribute/v2/asset-name"
1447
+ });
1448
+ const AssetNameServices = {
1449
+ getDropdown: (params) => {
1450
+ return API$h.get("/dropdown", { params });
1451
+ },
1452
+ getAssetNameDetail: (id) => {
1453
+ return API$h.get(`/${id}`);
1454
+ },
1455
+ getAssetsByAssetName: (id, params) => {
1456
+ return API$h.get(`/${id}/list-asset`, { params });
1457
+ },
1458
+ getAssetNameList: (params) => {
1459
+ return API$h.get("/", { params });
1460
+ },
1461
+ getUnpairedAssetName: (params) => {
1462
+ return API$h.get("/unpaired", { params });
1463
+ },
1464
+ getOptions: (params) => {
1465
+ return API$h.get("/options", { params });
1466
+ }
1467
+ };
1468
+ const API$g = createAxiosInstance({
1469
+ env: "APP_TAGSAMURAI_API",
1470
+ prefix: "/audit/v2"
1471
+ });
1472
+ const API_IOT = createAxiosInstance({
1473
+ env: "APP_TAGSAMURAI_API",
1474
+ prefix: "/iot/v2"
1475
+ });
1476
+ const TaskServices = {
1477
+ getTaskList: (params) => {
1478
+ return API$g.get("/audit/task", { params });
1479
+ },
1480
+ getTaskHistory: (params) => {
1481
+ return API$g.get("/audit/task/history", { params });
1482
+ },
1483
+ extendAuditDuration: (body, id) => {
1484
+ return API$g.put(`/audit/task/${id}/extend`, body);
1485
+ },
1486
+ stopAudit: (id, body) => {
1487
+ return API$g.put(`/audit/task/${id}/stop`, body);
1488
+ },
1489
+ cancelAuditTask: (id) => {
1490
+ return API$g.put(`/audit/task/${id}/cancel`);
1491
+ },
1492
+ getTaskDetail: (id) => {
1493
+ return API$g.get(`/audit/task/${id}`);
1494
+ },
1495
+ getInAuditTask: (params) => {
1496
+ return API$g.get("/audit/scheduled-asset/in-audit", { params });
1497
+ },
1498
+ getTaskDetailAssets: (params, taskId) => {
1499
+ return API$g.get(`/audit/task/${taskId}/view-asset-detail`, { params });
1500
+ },
1501
+ getAuditedTask: (params) => {
1502
+ return API$g.get("/audit/scheduled-asset/audited", { params });
1503
+ },
1504
+ getAuditLog: (id) => {
1505
+ return API$g.get(`/audit/scheduled-asset/${id}/log`);
1506
+ },
1507
+ getTaskEventLog: (params) => {
1508
+ return API$g.get("/audit/task/task-event-log", { params });
1509
+ },
1510
+ getTaskTimelineEventLog: (idTask) => {
1511
+ return API$g.get(`/audit/task/${idTask}/event-log`);
1512
+ },
1513
+ scanAssetTAG: (body, idTask) => {
1514
+ return API$g.put(`/audit/task/${idTask}/scan`, body);
1515
+ },
1516
+ submitAssetCondition: (body, idAsset) => {
1517
+ const headers = body.picture ? { "Content-Type": "multipart/form-data" } : { "Content-Type": "application/json" };
1518
+ return API$g.put(`/audit/scheduled-asset/${idAsset}/update/condition`, body, {
1519
+ headers
1520
+ });
1521
+ },
1522
+ submitAuditedAsset: (idTask) => {
1523
+ return API$g.put(`/audit/task/${idTask}/submit`);
1524
+ },
1525
+ reportTAGMissing: (note, idAsset) => {
1526
+ return API$g.put(`/audit/scheduled-asset/${idAsset}/report-missing`, {
1527
+ note
1528
+ });
1529
+ },
1530
+ reportTAG: (id, body) => {
1531
+ return API$g.put(`/audit/scheduled-asset/${id}/tag-reported`, body);
1532
+ },
1533
+ getTaskInitialState: (idTask) => {
1534
+ return API$g.get(`/audit/scheduled-asset/${idTask}`);
1535
+ },
1536
+ cancelTaskReport: (scheduledAssetId) => {
1537
+ return API$g.put(`/audit/scheduled-asset/${scheduledAssetId}/cancel-report`);
1538
+ }
1539
+ };
1540
+ const ScheduleServices = {
1541
+ getScheduleList: (params) => {
1542
+ return API$g.get("/audit/schedule", { params });
1543
+ },
1544
+ getScheduleDetail: (id) => {
1545
+ return API$g.get("/audit/schedule/" + id);
1546
+ },
1547
+ deleteSchedule: (scheduleId) => {
1548
+ return API$g.put("/audit/schedule/bulk-delete", {
1549
+ id: scheduleId
1550
+ });
1551
+ },
1552
+ inactivateSchedule: (id) => {
1553
+ return API$g.put("/audit/schedule/bulk-inactive", { id });
1554
+ },
1555
+ activateSchedule: (id) => {
1556
+ return API$g.put("/audit/schedule/bulk-active", { id });
1557
+ },
1558
+ createNewSchedule: (body) => {
1559
+ return API$g.post("/audit/schedule", body);
1560
+ },
1561
+ editSchedule: (body, id) => {
1562
+ return API$g.put("/audit/schedule/" + id, body);
1563
+ },
1564
+ getActiveAsset: (id, params) => {
1565
+ return API$g.get(`/audit/asset/schedule/${id}`, { params });
1566
+ },
1567
+ setAssetActivation: (body) => {
1568
+ return API$g.put("/audit/asset/activation", body);
1569
+ },
1570
+ getAuditableAssetAmount: (params) => {
1571
+ return API$g.get("/audit/asset/auditable/total-asset", { params });
1572
+ }
1573
+ };
1574
+ const IOTAuditServices = {
1575
+ getReaderList: (params) => {
1576
+ return API_IOT.get("/iot/antenna/available", { params });
1577
+ },
1578
+ putSetReaderParams: (body) => {
1579
+ return API_IOT.put("/iot/reader/set-scan-params", body);
1580
+ },
1581
+ putAuditUsingIOT: (auditId, body) => {
1582
+ return API_IOT.put(`/iot/audit/${auditId}`, body);
1583
+ },
1584
+ getReaderTotalAsset: (taskId, params) => {
1585
+ return API$g.get(`/audit/task/${taskId}/reader/total-assets`, {
1586
+ params
1587
+ });
1588
+ },
1589
+ getAssetList: (params) => {
1590
+ return API$g.get("/audit/scheduled-asset", { params });
1591
+ }
1592
+ };
1593
+ const FilterServices = {
1594
+ getFilterOptions: (path, params) => {
1595
+ return API$g.get(`/${path}/options`, { params });
1596
+ },
1597
+ getIOTFilterOptions: (path, params) => {
1598
+ return API_IOT.get(`/${path}/options`, { params });
1599
+ }
1600
+ };
1601
+ const AuditableAssetServices = {
1602
+ getAudiableAssetList: (params) => {
1603
+ return API$g.get("/audit/asset/auditable", { params });
1604
+ },
1605
+ getAuditableAssetDetail: (id) => {
1606
+ return API$g.get("/audit/asset/auditable/" + id);
1607
+ }
1608
+ };
1609
+ const ApprovalServices = {
1610
+ getApprovalList: (idTask, approvalRound) => {
1611
+ return API$g.get(`/audit/approval/task/${idTask}/transaction`, {
1612
+ params: {
1613
+ approvalRound
1614
+ }
1615
+ });
1616
+ }
1617
+ };
1618
+ const AuditServices = {
1619
+ getAudit: (assetId, params) => {
1620
+ return API$g.get(`/audit/schedule/asset-detail/${assetId}`, { params });
1621
+ },
1622
+ getAuditOption: (assetId, params) => {
1623
+ return API$g.get(`/audit/schedule/asset-detail/${assetId}/options`, {
1624
+ params
1625
+ });
1626
+ },
1627
+ putSetActive: (body) => {
1628
+ return API$g.put("/audit/asset/activation", body);
1629
+ },
1630
+ ...TaskServices,
1631
+ ...ScheduleServices,
1632
+ ...IOTAuditServices,
1633
+ ...FilterServices,
1634
+ ...AuditableAssetServices,
1635
+ ...ApprovalServices
1636
+ };
1637
+ const API$f = createAxiosInstance({
1638
+ env: "APP_TAGSAMURAI_API",
1639
+ prefix: "/settings-attribute/v2/brands"
1640
+ });
1641
+ const BrandServices = {
1642
+ getDropdown: (params) => {
1643
+ return API$f.get("/dropdown", { params });
1644
+ }
1645
+ };
1646
+ const API$e = createAxiosInstance({
1647
+ prefix: "/v2",
1648
+ env: "APP_LOGS_NOTIFICATION_API"
1649
+ });
1650
+ const ChangelogServices = {
1651
+ getActionLog: (params) => {
1652
+ return API$e.get("/change-log", { params });
1653
+ },
1654
+ getActionLogOption: (params) => {
1655
+ return API$e.get("/change-log/options", { params });
1656
+ },
1657
+ getSessionLogList: (params) => {
1658
+ return API$e.get("/session-log", { params });
1659
+ },
1660
+ getUserDetailSystemLogList: (params) => {
1661
+ return API$e.get("/change-log", { params });
1662
+ },
1663
+ getUserDetailSystemLogOption: (params) => {
1664
+ return API$e.get("/change-log/options", { params });
1665
+ },
142
1666
  /**
143
- *
144
- * @param id {string} User's _id
145
- * @param type {"Global" | "Group"} Whether the system role's type is global or group
146
- * @param params {Record<string, unknown>}
1667
+ * Retrieves the transaction log.
1668
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
147
1669
  */
148
- getUserDetailSystemRoles: (t, e, r) => s.get(`/user-detail/${t}/system-roles`, {
149
- params: {
150
- ...r,
151
- type: e
152
- }
153
- }),
154
- // 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({
1670
+ getTransactionLog: (params) => {
1671
+ return API$e.get("/transaction-log", { params });
1672
+ },
1673
+ /**
1674
+ * Retrieves the transaction log options.
1675
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
1676
+ */
1677
+ getTransactionLogOption: (params) => {
1678
+ return API$e.get("/transaction-log/options", { params });
1679
+ },
1680
+ postScanLog: (body) => {
1681
+ return API$e.post("/transaction-log/scan-log", body);
1682
+ }
1683
+ };
1684
+ const API$d = ({ headers = {}, params = {} } = {}) => {
1685
+ const BASE_URL = getBaseURL("APP_COUNTRY_STATE_API");
1686
+ const API_KEY = getBaseURL("APP_COUNTRY_STATE_API_KEY");
1687
+ const instance = axios.create({
1688
+ baseURL: `${BASE_URL}/v1`,
1689
+ headers: {
1690
+ "Content-type": "application/json",
1691
+ "X-CSCAPI-KEY": API_KEY,
1692
+ ...headers
1693
+ },
1694
+ params
1695
+ });
1696
+ return instance;
1697
+ };
1698
+ const CountryStateServices = {
1699
+ getCountry: () => {
1700
+ return API$d().get("/countries");
1701
+ },
1702
+ getState: (country) => {
1703
+ return API$d().get(`/countries/${country}/states`);
1704
+ },
1705
+ getCity: (country, state) => {
1706
+ return API$d().get(`/countries/${country}/states/${state}/cities`);
1707
+ }
1708
+ };
1709
+ const API$c = createAxiosInstance({
1710
+ env: "APP_TAGSAMURAI_API",
1711
+ prefix: "/dashboard/v2/dashboard"
1712
+ });
1713
+ const DashboardServices = {
1714
+ getLatestTask: (params) => {
1715
+ return API$c.get("/latest-task", { params });
1716
+ },
1717
+ getSummary: (params) => {
1718
+ return API$c.get("/summary", { params });
1719
+ }
1720
+ };
1721
+ const API$b = createAxiosInstance({
1722
+ env: "APP_GLOBAL_SETTINGS_API",
1723
+ prefix: "/v1/global-settings/auth"
1724
+ });
1725
+ const onRejected = (error) => {
1726
+ var _a, _b, _c, _d;
1727
+ 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") {
1728
+ window.onblur = void 0;
1729
+ window.onfocus = void 0;
1730
+ window.sessionExpired = true;
1731
+ return window.dispatchEvent(new CustomEvent("user:expired"));
1732
+ }
1733
+ return Promise.reject(error);
1734
+ };
1735
+ const AuthServices = {
1736
+ login: (form) => {
1737
+ const body = { ...form, isMobile: false };
1738
+ return API$b.post("/login", body);
1739
+ },
1740
+ reLogin: (body) => {
1741
+ API$b.interceptors.response.use((response) => {
1742
+ return response;
1743
+ }, onRejected);
1744
+ return API$b.post("/login", body);
1745
+ },
1746
+ requestOTP: (email) => {
1747
+ const body = { email };
1748
+ return API$b.post("/request-otp", body);
1749
+ },
1750
+ requestResetPassLink: (email) => {
1751
+ const body = { email };
1752
+ return API$b.post("/request-reset-link", body);
1753
+ },
1754
+ setPassword: (body) => {
1755
+ return API$b.post("/set-password", body);
1756
+ },
1757
+ verifyToken: (token) => {
1758
+ return API$b.get(`/verify-token/${token}`);
1759
+ },
1760
+ confirmEmailChange: (token) => {
1761
+ const body = { token };
1762
+ return API$b.put("/confirm-email-change/confirm", body);
1763
+ },
1764
+ postLogout: () => {
1765
+ return API$b.post("/logout");
1766
+ }
1767
+ };
1768
+ const API$a = createAxiosInstance({
165
1769
  env: "APP_ADMIN_API",
166
1770
  prefix: "/settings-attribute/languages"
167
- }), M = {
1771
+ });
1772
+ const I18nService = {
168
1773
  /**
169
1774
  * Fetch all translation messages for a specific locale.
170
1775
  * @param locale The locale code (e.g., 'en', 'id').
171
1776
  * @returns A promise resolving to a key-value record of messages.
172
1777
  */
173
- getMessages: (t) => u.get(`/${t}/translations`),
1778
+ getMessages: (isoCode) => {
1779
+ return API$a.get(`/${isoCode}/translations`);
1780
+ },
174
1781
  /**
175
1782
  * Fetch all available lang options for LanguageDropdown and LanguageSwitcher
176
1783
  *
177
1784
  * @returns Promise Array of options
178
1785
  */
179
1786
  getLanguageOptions: async () => {
180
- const { data: t } = await u.get(
181
- "/dropdown"
182
- );
183
- return t.data;
1787
+ const { data } = await API$a.get("/dropdown");
1788
+ return data.data;
184
1789
  },
185
1790
  /**
186
1791
  * Fetch single lang option meta data
@@ -188,11 +1793,11 @@ const m = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
188
1793
  * @param isoCode The locale code (e.g., 'en', 'id').
189
1794
  * @returns Promise LanguageMeta
190
1795
  */
191
- getLanguageOptionMeta: async (t) => {
192
- const { data: e } = await u.get(
193
- "/dropdown/" + t
1796
+ getLanguageOptionMeta: async (isoCode) => {
1797
+ const { data } = await API$a.get(
1798
+ "/dropdown/" + isoCode
194
1799
  );
195
- return e.data;
1800
+ return data.data;
196
1801
  },
197
1802
  /**
198
1803
  * Translate a specific text to the target locale.
@@ -200,46 +1805,319 @@ const m = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
200
1805
  * @param key Unique translation key.
201
1806
  * @param locale Target locale code.
202
1807
  */
203
- translateText: async (t, e) => {
204
- const { data: r } = await u.post("/translate", {
205
- q: t,
206
- target: e
1808
+ translateText: async (key, locale) => {
1809
+ const { data } = await API$a.post("/translate", {
1810
+ q: key,
1811
+ target: locale
207
1812
  });
208
- return r.data.translations[t];
1813
+ return data.data.translations[key];
1814
+ }
1815
+ };
1816
+ const API$9 = createAxiosInstance({
1817
+ env: "APP_TAGSAMURAI_API",
1818
+ prefix: "/settings-attribute/v2/models"
1819
+ });
1820
+ const ModelTypeServices = {
1821
+ getDropdown: (params) => {
1822
+ return API$9.get("/dropdown", { params });
1823
+ }
1824
+ };
1825
+ const API$8 = createAxiosInstance({
1826
+ prefix: "/v2",
1827
+ env: "APP_LOGS_NOTIFICATION_API"
1828
+ });
1829
+ const NotificationApprovalServices = {
1830
+ getTotalApprovals: () => {
1831
+ return API$8.get("/approval/count");
1832
+ }
1833
+ };
1834
+ const API$7 = createAxiosInstance({
1835
+ env: "APP_TAGSAMURAI_API",
1836
+ prefix: "/iot/v2/reader"
1837
+ });
1838
+ const ReaderServices = {
1839
+ getData: (params) => {
1840
+ return API$7.get("/", { params });
1841
+ },
1842
+ getDataOptions: (params) => {
1843
+ return API$7.get("/options", { params });
1844
+ },
1845
+ getActivityLogData: (params) => {
1846
+ return API$7.get("/activity-log", { params });
1847
+ },
1848
+ getActivityLogOptions: (params) => {
1849
+ return API$7.get("/activity-log/options", { params });
1850
+ },
1851
+ getDataById: (id) => {
1852
+ return API$7.get(`/${id}`);
1853
+ },
1854
+ getChangeLog: (params) => {
1855
+ return API$7.get(`/${params.id}/change-log`, { params });
1856
+ },
1857
+ getChangeLogOptions: (params) => {
1858
+ return API$7.get(`/${params.id}/change-log/options`, { params });
1859
+ },
1860
+ putData: (id, body) => {
1861
+ return API$7.put(`/${id}`, body);
1862
+ }
1863
+ };
1864
+ const API$6 = createAxiosInstance({
1865
+ env: "APP_TAGSAMURAI_API",
1866
+ prefix: "/repair/v2"
1867
+ });
1868
+ const RepairServices = {
1869
+ getRepairList: (params) => {
1870
+ return API$6.get("/my-asset/repair", { params });
1871
+ },
1872
+ getFilterOptions: (params) => {
1873
+ return API$6.get("/my-asset/repair/options", { params });
1874
+ },
1875
+ getAssetRepairTicketing: (assetId, params) => {
1876
+ return API$6.get(`/repair/${assetId}/asset-repair-detail`, { params });
1877
+ },
1878
+ putConfirmRepair: (repairId) => {
1879
+ return API$6.put(`/repair/${repairId}/confirm-repair`);
1880
+ }
1881
+ };
1882
+ const API$5 = createAxiosInstance({
1883
+ env: "APP_TAGSAMURAI_API",
1884
+ prefix: "/routine/v2"
1885
+ });
1886
+ const RoutineServices = {
1887
+ getMaintenance: (assetId, params) => {
1888
+ return API$5.get(`/routine-task/${assetId}`, { params });
1889
+ },
1890
+ getMaintenanceOption: (assetId, params) => {
1891
+ return API$5.get(`/routine-task/${assetId}/options`, { params });
1892
+ },
1893
+ putSetActive: (body) => {
1894
+ return API$5.put("/maintenable-asset/set-active", body);
1895
+ }
1896
+ };
1897
+ const API$4 = createAxiosInstance({
1898
+ env: "APP_TAGSAMURAI_API",
1899
+ prefix: "/routine/v2"
1900
+ });
1901
+ const ServiceCenterServices = {
1902
+ getList: (params) => {
1903
+ return API$4.get("/service-center", { params });
1904
+ },
1905
+ postList: (body) => {
1906
+ return API$4.post("/service-center", body);
1907
+ },
1908
+ putList: (id, body) => {
1909
+ return API$4.put(`/service-center/${id}`, body);
1910
+ },
1911
+ putActivate: (body) => {
1912
+ return API$4.put("/service-center/bulk", body);
1913
+ },
1914
+ getDetailList: (id) => {
1915
+ return API$4.get(`/service-center/${id}`);
1916
+ },
1917
+ getListOptions: (params) => {
1918
+ return API$4.get("/service-center/options", { params });
1919
+ },
1920
+ deleteList: (params) => {
1921
+ return API$4.delete("/service-center", { params });
1922
+ },
1923
+ // Activities
1924
+ getActivities: (params) => {
1925
+ return API$4.get("/service-activities", { params });
1926
+ },
1927
+ getActivityOptions: (params) => {
1928
+ return API$4.get("/service-activities/options", { params });
1929
+ },
1930
+ getActivityDetail: (id) => {
1931
+ return API$4.get(`/service-activities/${id}`);
1932
+ },
1933
+ getActivityLog: (id) => {
1934
+ return API$4.get(`/service-activities/${id}/activity-log`);
1935
+ }
1936
+ };
1937
+ const API$3 = createAxiosInstance({
1938
+ prefix: "/v2/session-log",
1939
+ env: "APP_LOGS_NOTIFICATION_API"
1940
+ });
1941
+ const SessionLogServices = {
1942
+ postLogout: () => {
1943
+ return API$3.post("/logout");
1944
+ }
1945
+ };
1946
+ const API$2 = createAxiosInstance({
1947
+ env: "APP_TAGSAMURAI_API",
1948
+ prefix: "/tag/v2"
1949
+ });
1950
+ const TAGServices = {
1951
+ getScanQR: (tag) => {
1952
+ return API$2.get("/qr", { params: { tag } });
1953
+ },
1954
+ getScanRFID: (tag) => {
1955
+ return API$2.get("/rfid", { params: { tag } });
1956
+ },
1957
+ getRFIDQRTAG: (params) => {
1958
+ return API$2.get("/rfid-qr/scan", { params });
1959
+ },
1960
+ getEventLog: (params) => {
1961
+ return API$2.get("/tag-transaction/event-log", { params });
1962
+ },
1963
+ // Tab All
1964
+ getRfidQrAll: (path, params) => {
1965
+ return API$2.get(`/${path}`, { params });
1966
+ },
1967
+ // Tab Paired
1968
+ getRfidQrPaired: (tagType, viewBy, params) => {
1969
+ return API$2.get(`/${tagType}/paired/${viewBy}`, { params });
1970
+ },
1971
+ postAddTAGtoPrelist: (body, destination) => {
1972
+ return API$2.post(`/prelist/${destination}/asset-name`, body);
1973
+ },
1974
+ postAddTAGtoReplacePrelist: (body) => {
1975
+ return API$2.post("/prelist/replace-tag", body);
1976
+ },
1977
+ postAddTAGToPrelistUnpair: (body) => {
1978
+ return API$2.post("/prelist/unpair-tag", body);
1979
+ },
1980
+ postAddTAGtoPending: (body) => {
1981
+ return API$2.post("/pending-changes", body);
1982
+ },
1983
+ // Available Tab
1984
+ getRFIDQrAvailable: (tagType, params) => {
1985
+ return API$2.get(`/${tagType}/available`, { params });
1986
+ },
1987
+ // Damaged TAB
1988
+ getRFIDQrDamaged: (tagType, params) => {
1989
+ return API$2.get(`/${tagType}/damaged`, { params });
1990
+ },
1991
+ // RFID and QR Module
1992
+ getRFIDandQRList: (params) => {
1993
+ return API$2.get("/rfid-qr", { params });
1994
+ },
1995
+ deleteUnpairTAG: (body) => {
1996
+ return API$2.delete("/rfid-qr", { data: { data: body } });
1997
+ },
1998
+ postPairTAG: (body) => {
1999
+ return API$2.post("/rfid-qr", { body: { data: body } });
2000
+ },
2001
+ // RFID To Be Returned
2002
+ getToBeReturnedTAGList: (params) => {
2003
+ return API$2.get("/rfid/to-be-returned", { params });
2004
+ },
2005
+ // Handover TAG
2006
+ putHandoverTAG: (body) => {
2007
+ return API$2.put("/rfid/handover", { body: { data: body } });
2008
+ },
2009
+ // Table Filter
2010
+ getFilterOptions: (path, params) => {
2011
+ return API$2.get(`/${path}/options`, { params });
2012
+ },
2013
+ getHolderListOptions: (params) => {
2014
+ return API$2.get("/rfid/holder-list/options", { params });
2015
+ },
2016
+ getHolderList: (params) => {
2017
+ return API$2.get("/rfid/holder-list", { params });
2018
+ },
2019
+ putAuditTAG: (body, tagType) => {
2020
+ return API$2.put(`/${tagType}/audit`, body);
2021
+ },
2022
+ postLogAudit: (body) => {
2023
+ return API$2.post("/tag-transaction/log-audit", body);
2024
+ },
2025
+ postCreateQr: (amount) => {
2026
+ const body = { amount };
2027
+ return API$2.post("/qr", body);
2028
+ },
2029
+ putReportTAG: (id, body) => {
2030
+ return API$2.put(`/tag-transaction/report/${id}`, body);
2031
+ },
2032
+ putReportTAGBulk: (body) => {
2033
+ return API$2.put("/tag-transaction/report/bulk", body);
2034
+ },
2035
+ putDeclineReport: (body, tagType) => {
2036
+ return API$2.put(`/report/decline-report/${tagType}`, body);
2037
+ }
2038
+ };
2039
+ const API$1 = createAxiosInstance({
2040
+ env: "APP_TAGSAMURAI_API",
2041
+ prefix: "/tracking/v2/tracking"
2042
+ });
2043
+ const MissingServices = {
2044
+ getTrackingDetail: (trackingId) => {
2045
+ return API$1.get(`/${trackingId}`);
2046
+ },
2047
+ putFoundAsset: (tag, groupId, serialNumber) => {
2048
+ const params = {
2049
+ tag,
2050
+ group: groupId,
2051
+ serialNumber,
2052
+ type: "Global"
2053
+ };
2054
+ return API$1.put("/scan", void 0, { params });
2055
+ },
2056
+ putReportPermanentlyMissing: (trackingId, body) => {
2057
+ return API$1.put(`/report-permanently-missing/${trackingId}`, body);
2058
+ },
2059
+ putMoveBack: (body) => {
2060
+ return API$1.put("/tracking/move-back", body);
2061
+ }
2062
+ };
2063
+ const API = createAxiosInstance({
2064
+ env: "APP_TAGSAMURAI_API",
2065
+ prefix: "/settings-attribute/v2/transaction-settings"
2066
+ });
2067
+ const TransactionSettingServices = {
2068
+ getData: () => {
2069
+ return API.get("/");
2070
+ },
2071
+ putData: (data) => {
2072
+ return API.put("/", data);
209
2073
  }
210
- }, d = n({
211
- prefix: "/dashboard/v2/dashboard"
212
- }), V = {
213
- getLatestTask: (t) => d.get("/latest-task", { params: t }),
214
- getSummary: (t) => d.get("/summary", { params: t })
215
- }, p = n({
216
- prefix: "/alias-code/api/alias-code"
217
- }), B = {
218
- getAliasCode: () => p.get("/"),
219
- postAliasCode: (t) => p.post("/", t),
220
- getAliasCodeList: (t) => p.get(`/${t.object}/code-list`, { params: t })
221
- }, I = n({
222
- prefix: "/settings-attribute/v2/general-settings"
223
- }), j = {
224
- getGeneralSettings: () => I.get("/"),
225
- putUpdateGeneralSettings: (t) => I.put("/", t)
226
2074
  };
227
2075
  export {
228
- B as AliasCodeServices,
229
- R as AssetServices,
230
- G as ChangelogServices,
231
- V as DashboardServices,
232
- j as GeneralSettingsServices,
233
- C as GroupCategoryServices,
234
- M as I18nService,
235
- b as MissingServices,
236
- N as NotificationApprovalServices,
237
- E as NotificationServices,
238
- x as SessionLogServices,
239
- w as TAGServices,
240
- k as TrackingServices,
241
- F as UserServices,
242
- _ as getBaseURL,
243
- D as getImageURL,
244
- h as queryParamsStringfy
2076
+ AccountingServices,
2077
+ AliasCodeServices,
2078
+ AssetNameServices,
2079
+ AssetPolicyServices,
2080
+ AssetServices,
2081
+ AssignmentServices,
2082
+ AuditServices,
2083
+ AuthServices$1 as AuthServices,
2084
+ BorrowServicesGo as BorrowServices,
2085
+ BrandServices,
2086
+ ChangelogServices,
2087
+ CountryStateServices,
2088
+ CustomFieldServices,
2089
+ DamageServices,
2090
+ DashboardServices,
2091
+ DisposalServices,
2092
+ FileManagerServices,
2093
+ GeneralSettingsServices,
2094
+ AuthServices as GlobalAuthServices,
2095
+ GroupCategoryServices,
2096
+ I18nService,
2097
+ ImportServices,
2098
+ LicenseServices,
2099
+ ChangelogServices$1 as LogServices,
2100
+ MissingServices$1 as MissingServices,
2101
+ ModelTypeServices,
2102
+ MyAssetServices,
2103
+ NotificationApprovalServices,
2104
+ NotificationServices,
2105
+ OpenAPIServices,
2106
+ ReaderServices,
2107
+ RepairServices,
2108
+ ReportServices,
2109
+ RoleServices,
2110
+ RoutineServices,
2111
+ ServiceCenterServices,
2112
+ SessionLogServices,
2113
+ SubUserServices,
2114
+ TAGServices,
2115
+ MissingServices as TrackingServices,
2116
+ TransactionSettingServices,
2117
+ TransferServicesGo as TransferServices,
2118
+ UserServices,
2119
+ getAssetsFile,
2120
+ getBaseURL,
2121
+ getImageURL,
2122
+ queryParamsStringfy
245
2123
  };