@tagsamurai/fats-api-services 1.0.0-alpha.4 → 1.0.0-alpha.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-services.es.js +497 -66
- package/api-services.system.js +1 -1
- package/main.d.ts +24 -4
- package/package.json +1 -1
- package/src/dto/aliasCode.dto.d.ts +4 -0
- package/src/dto/customField.dto.d.ts +16 -0
- package/src/dto/dashboard.dto.d.ts +15 -0
- package/src/dto/fileManager.dto.d.ts +25 -0
- package/src/dto/groupCategoryService.dto.d.ts +4 -3
- package/src/dto/log.dto.d.ts +63 -0
- package/src/dto/notification.dto.d.ts +9 -0
- package/src/dto/oldAssetService.dto.d.ts +26 -0
- package/src/dto/role.dto.d.ts +61 -0
- package/src/dto/serviceCenter.dto.d.ts +22 -0
- package/src/dto/user.dto.d.ts +139 -0
- package/src/services/countryState.service.d.ts +7 -0
- package/src/services/fileManager.service.d.ts +53 -0
- package/src/services/groupCategory.service.d.ts +3 -2
- package/src/services/i18n.service.d.ts +32 -0
- package/src/services/notification.service.d.ts +9 -0
- package/src/services/oldAliasCode.service.d.ts +10 -0
- package/src/services/oldAsset.service.d.ts +20 -0
- package/src/services/oldBrand.service.d.ts +7 -0
- package/src/services/oldCustomField.service.d.ts +16 -0
- package/src/services/oldDashboard.service.d.ts +7 -0
- package/src/services/oldFileManager.service.d.ts +53 -0
- package/src/services/oldGeneralSettings.service.d.ts +6 -0
- package/src/services/oldGroupCategory.service.d.ts +5 -4
- package/src/services/oldLog.service.d.ts +14 -0
- package/src/services/oldMissing.service.d.ts +5 -0
- package/src/services/oldNotification.service.d.ts +7 -0
- package/src/services/oldReader.service.d.ts +13 -0
- package/src/services/oldRole.service.d.ts +53 -0
- package/src/services/oldServiceCenter.service.d.ts +19 -0
- package/src/services/oldSessionLog.service.d.ts +5 -0
- package/src/services/oldTag.service.d.ts +10 -0
- package/src/services/oldTracking.service.d.ts +5 -0
- package/src/services/oldUser.service.d.ts +58 -0
- package/src/types/aliasCode.type.d.ts +16 -0
- package/src/types/customField.type.d.ts +43 -0
- package/src/types/fetchResponse.type.d.ts +7 -0
- package/src/types/fileManager.type.d.ts +24 -0
- package/src/types/group.type.d.ts +5 -0
- package/src/types/groupCategoryData.type.d.ts +1 -3
- package/src/types/i18nService.type.d.ts +22 -0
- package/src/types/{changelog.type.d.ts → log.type.d.ts} +21 -0
- package/src/types/notification.type.d.ts +17 -0
- package/src/types/oldAssetService.type.d.ts +98 -0
- package/src/types/oldTagService.type.d.ts +9 -0
- package/src/types/reader.d.ts +55 -0
- package/src/types/role.type.d.ts +121 -0
- package/src/types/serviceCenter.type.d.ts +29 -0
- package/src/types/user.type.d.ts +177 -0
- package/src/types/userAsset.type.d.ts +18 -0
- package/src/types/userGlobalRole.type.d.ts +28 -0
- package/src/types/userGroupRole.type.d.ts +30 -0
- package/src/types/userLog.type.d.ts +18 -0
- package/src/types/userSystemRole.type.d.ts +14 -0
- package/src/types/userTransactionRole.type.d.ts +9 -0
- package/src/dto/changelog.dto.d.ts +0 -30
- package/src/services/oldChangelog.service.d.ts +0 -9
package/api-services.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const { env: r = "APP_API", prefix:
|
|
4
|
-
return
|
|
5
|
-
...
|
|
6
|
-
baseURL:
|
|
7
|
-
headers: e ?
|
|
1
|
+
import U from "axios";
|
|
2
|
+
const D = { 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" }, y = (t = "APP_API") => D["VITE_" + t], s = (t = {}, e = !1) => {
|
|
3
|
+
const { env: r = "APP_API", prefix: i = "", headers: P = {}, ...T } = t, h = `${y(r)}${i}`, m = JSON.parse(localStorage.getItem("user") ?? "{}"), G = m.jwt ?? m.token ?? "";
|
|
4
|
+
return U.create({
|
|
5
|
+
...T,
|
|
6
|
+
baseURL: h,
|
|
7
|
+
headers: e ? P : {
|
|
8
8
|
"Content-Type": "application/json",
|
|
9
|
-
Authorization: `Bearer ${
|
|
10
|
-
...
|
|
9
|
+
Authorization: `Bearer ${G}`,
|
|
10
|
+
...P
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
},
|
|
13
|
+
}, M = (t) => {
|
|
14
14
|
if (!t || typeof t == "string")
|
|
15
15
|
return;
|
|
16
16
|
const e = {};
|
|
@@ -21,94 +21,525 @@ const I = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
21
21
|
[r]: t[r]
|
|
22
22
|
});
|
|
23
23
|
}), e;
|
|
24
|
-
},
|
|
24
|
+
}, w = (t) => {
|
|
25
25
|
if (!t) return;
|
|
26
|
-
const
|
|
27
|
-
if (e || r) {
|
|
28
|
-
const g = new URLSearchParams();
|
|
29
|
-
return e && (g.set("width", e.toString()), g.set("height", r ? r == null ? void 0 : r.toString() : e.toString())), `${a}?${g.toString()}`;
|
|
30
|
-
}
|
|
31
|
-
return a;
|
|
32
|
-
}, T = (t) => {
|
|
33
|
-
if (!t) return;
|
|
34
|
-
const e = i("APP_TAGSAMURAI_API");
|
|
26
|
+
const e = y("APP_TAGSAMURAI_API");
|
|
35
27
|
return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
|
|
36
|
-
},
|
|
37
|
-
prefix: "/settings-attribute/v2"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return s.get(`/${e}/tree`);
|
|
42
|
-
},
|
|
43
|
-
getGroupCategoryList: (t, e) => {
|
|
28
|
+
}, u = s({
|
|
29
|
+
prefix: "/settings-attribute/v2",
|
|
30
|
+
env: "APP_TAGSAMURAI_API"
|
|
31
|
+
}), k = {
|
|
32
|
+
getGroupCategory: (t, e) => {
|
|
44
33
|
const r = t === "category" ? t : "groups";
|
|
45
|
-
return
|
|
34
|
+
return u.get(`/${r}/tree`, { params: e });
|
|
35
|
+
},
|
|
36
|
+
getGroupCategoryList: (t, e, r) => {
|
|
37
|
+
const i = t === "category" ? t : "groups";
|
|
38
|
+
return u.get(`/${i}/${e}`, { params: r });
|
|
46
39
|
},
|
|
47
40
|
getNames: (t) => {
|
|
48
41
|
const e = t === "category" ? t : "groups";
|
|
49
|
-
return
|
|
42
|
+
return u.get(`/${e}/names`);
|
|
43
|
+
},
|
|
44
|
+
getCodes: (t) => {
|
|
45
|
+
const e = t === "category" ? t : "groups";
|
|
46
|
+
return u.get(`/${e}/codes`);
|
|
50
47
|
},
|
|
51
48
|
postCreateGroupCategory: (t, e) => {
|
|
52
49
|
const r = t === "category" ? t : "groups";
|
|
53
|
-
return
|
|
50
|
+
return u.post(`/${r}`, e);
|
|
54
51
|
},
|
|
55
52
|
putEditGroupCategory: (t, e, r) => {
|
|
56
|
-
const
|
|
57
|
-
return
|
|
53
|
+
const i = t === "category" ? t : "groups";
|
|
54
|
+
return u.put(`/${i}/${r}`, e);
|
|
58
55
|
},
|
|
56
|
+
putMoveGroup: (t, e) => u.put(`/groups/${e}/move-group`, t),
|
|
57
|
+
putEditBulkGroups: async (t) => u.put("/groups/bulk", t),
|
|
59
58
|
deleteGroupCategory: (t, e, r) => {
|
|
60
|
-
const
|
|
61
|
-
return
|
|
59
|
+
const i = t === "category" ? t : "groups";
|
|
60
|
+
return u.delete(`/${i}/${r}`, { data: e });
|
|
62
61
|
}
|
|
63
|
-
},
|
|
64
|
-
prefix: "/settings-attribute/v2"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return n.get(`/${e}/tree`);
|
|
62
|
+
}, l = s({
|
|
63
|
+
prefix: "/settings-attribute-go/v2"
|
|
64
|
+
}), B = {
|
|
65
|
+
getGroupCategory: (t, e) => {
|
|
66
|
+
const r = t === "category" ? t : "groups";
|
|
67
|
+
return l.get(`/${r}/tree`, { params: e });
|
|
70
68
|
},
|
|
71
69
|
getGroupCategoryList: (t, e) => {
|
|
72
70
|
const r = t === "category" ? t : "groups";
|
|
73
|
-
return
|
|
71
|
+
return l.get(`/${r}/${e}`);
|
|
74
72
|
},
|
|
75
73
|
getNames: (t) => {
|
|
76
74
|
const e = t === "category" ? t : "groups";
|
|
77
|
-
return
|
|
75
|
+
return l.get(`/${e}/names`);
|
|
76
|
+
},
|
|
77
|
+
getCodes: (t) => {
|
|
78
|
+
const e = t === "category" ? t : "groups";
|
|
79
|
+
return l.get(`/${e}/codes`);
|
|
78
80
|
},
|
|
79
81
|
postCreateGroupCategory: (t, e) => {
|
|
80
82
|
const r = t === "category" ? t : "groups";
|
|
81
|
-
return
|
|
83
|
+
return l.post(`/${r}`, e);
|
|
82
84
|
},
|
|
83
85
|
putEditGroupCategory: (t, e, r) => {
|
|
84
|
-
const
|
|
85
|
-
return
|
|
86
|
+
const i = t === "category" ? t : "groups";
|
|
87
|
+
return l.put(`/${i}/${r}`, e);
|
|
86
88
|
},
|
|
87
|
-
putMoveGroup: (t, e) => n.put(`/groups/${e}/move-group`, t),
|
|
88
|
-
putEditBulkGroups: async (t) => n.put("/bulk", t),
|
|
89
89
|
deleteGroupCategory: (t, e, r) => {
|
|
90
|
-
const
|
|
91
|
-
return
|
|
90
|
+
const i = t === "category" ? t : "groups";
|
|
91
|
+
return l.delete(`/${i}/${r}`, { data: e });
|
|
92
92
|
}
|
|
93
|
-
},
|
|
93
|
+
}, N = s({
|
|
94
94
|
prefix: "/v2",
|
|
95
95
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
96
|
-
}),
|
|
97
|
-
getTotalApprovals: () =>
|
|
98
|
-
},
|
|
96
|
+
}), V = {
|
|
97
|
+
getTotalApprovals: () => N.get("/approval/count")
|
|
98
|
+
}, $ = s({
|
|
99
99
|
prefix: "/v2",
|
|
100
100
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
101
|
-
}),
|
|
102
|
-
getActionLog: (t) =>
|
|
103
|
-
getActionLogOption: (t) =>
|
|
101
|
+
}), j = {
|
|
102
|
+
getActionLog: (t) => $.get("/change-log", { params: t }),
|
|
103
|
+
getActionLogOption: (t) => $.get("/change-log/options", { params: t }),
|
|
104
|
+
getSessionLogList: (t) => $.get("/session-log", { params: t }),
|
|
105
|
+
getUserDetailSystemLogList: (t) => $.get("/change-log", { params: t }),
|
|
106
|
+
getUserDetailSystemLogOption: (t) => $.get("/change-log/options", { params: t })
|
|
107
|
+
}, g = s({
|
|
108
|
+
prefix: "/assets/v2/assets"
|
|
109
|
+
}), Y = {
|
|
110
|
+
getScanTag: (t) => g.get("/scan", { params: { tag: t } }),
|
|
111
|
+
getAllAssets: (t) => g.get("/", { params: t }),
|
|
112
|
+
getAvailableAssets: (t) => g.get("/available", { params: t }),
|
|
113
|
+
scanAsset: (t) => g.get("", { params: { tag: t } }),
|
|
114
|
+
getAssetsById: (t, e) => g.get("/by-id", { params: { _id: t, ...e } }),
|
|
115
|
+
getOptions: (t, e) => g.get(t ? `/${t}/options` : "/options", { params: e }),
|
|
116
|
+
getUnlinkedAssets: (t) => g.get("/unlinked", { params: t }),
|
|
117
|
+
getAssetDetail: (t, e) => g.get(`/${t}`, { params: e }),
|
|
118
|
+
getLinkedAssetFamily: (t) => g.get("/family", { params: { id: t } }),
|
|
119
|
+
matchAssetWithTag: (t, e) => {
|
|
120
|
+
const r = {
|
|
121
|
+
_id: JSON.stringify([t]),
|
|
122
|
+
tag: e
|
|
123
|
+
};
|
|
124
|
+
return g.get("/by-id", { params: r });
|
|
125
|
+
}
|
|
126
|
+
}, F = s({
|
|
127
|
+
prefix: "/tracking/v2/missing"
|
|
128
|
+
}), J = {
|
|
129
|
+
putFoundAsset: (t, e) => {
|
|
130
|
+
const r = { ids: [t], serialNumber: e };
|
|
131
|
+
return F.put("/found", r);
|
|
132
|
+
}
|
|
133
|
+
}, C = s({
|
|
134
|
+
prefix: "/v2/notification",
|
|
135
|
+
env: "APP_LOGS_NOTIFICATION_API"
|
|
136
|
+
}), q = {
|
|
137
|
+
getNotifications: (t) => C.get("/", { params: t }),
|
|
138
|
+
readNotification: (t) => C.put(`/${t}`)
|
|
139
|
+
}, _ = s({
|
|
140
|
+
prefix: "/utility/v2/notification"
|
|
141
|
+
}), K = {
|
|
142
|
+
getNotifications: (t) => _.get("/", { params: t }),
|
|
143
|
+
readNotification: (t) => _.put(`/${t}`)
|
|
144
|
+
}, R = s({
|
|
145
|
+
prefix: "/v2/session-log",
|
|
146
|
+
env: "APP_LOGS_NOTIFICATION_API"
|
|
147
|
+
}), W = {
|
|
148
|
+
postLogout: () => R.post("/logout")
|
|
149
|
+
}, I = s({
|
|
150
|
+
prefix: "/tag/v2"
|
|
151
|
+
}), z = {
|
|
152
|
+
getScanQR: (t) => I.get("/qr", { params: { tag: t } }),
|
|
153
|
+
getScanRFID: (t) => I.get("/rfid", { params: { tag: t } }),
|
|
154
|
+
getRFIDQRTAG: (t) => I.get("/rfid-qr/scan", { params: t })
|
|
155
|
+
}, E = s({
|
|
156
|
+
prefix: "/tracking/v2/tracking"
|
|
157
|
+
}), Q = {
|
|
158
|
+
putFoundAsset: (t, e, r) => {
|
|
159
|
+
const i = {
|
|
160
|
+
tag: t,
|
|
161
|
+
group: e,
|
|
162
|
+
serialNumber: r,
|
|
163
|
+
type: "Global"
|
|
164
|
+
};
|
|
165
|
+
return E.put("/found", { params: i });
|
|
166
|
+
}
|
|
167
|
+
}, n = s({
|
|
168
|
+
prefix: "/settings-user-role/v2"
|
|
169
|
+
}), Z = {
|
|
170
|
+
reLogin: (t) => n.post("/auth/login", t),
|
|
171
|
+
changePassword: (t) => n.put("/users/change-password", t),
|
|
172
|
+
/**
|
|
173
|
+
* Retrieves the user list as dropdown options.
|
|
174
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
175
|
+
*/
|
|
176
|
+
getUserDropdown: (t) => n.get("/users/dropdown", { params: t }),
|
|
177
|
+
getUserOptions: (t) => n.get("/users/options", { params: t }),
|
|
178
|
+
getUserList: (t) => n.get("/users", { params: t }),
|
|
179
|
+
getUserDetail: (t) => n.get(`/users/${t}`),
|
|
180
|
+
putEditUser: (t, e) => {
|
|
181
|
+
const r = { "Content-Type": "multipart/form-data" };
|
|
182
|
+
return n.put(`/users/${t}`, e, { headers: r });
|
|
183
|
+
},
|
|
184
|
+
putDeleteProfilePicture: (t) => n.put(`/users/${t}/delete-profile-picture`),
|
|
185
|
+
putCancelEmailChange: (t, e) => n.put("/auth/confirm-email-change/cancel", {
|
|
186
|
+
user: t,
|
|
187
|
+
companyCode: e
|
|
188
|
+
}),
|
|
189
|
+
/**
|
|
190
|
+
*
|
|
191
|
+
* @param id {string} User's _id
|
|
192
|
+
* @param type {"Global" | "Group"} Whether the system role's type is global or group
|
|
193
|
+
* @param params {Record<string, unknown>}
|
|
194
|
+
*/
|
|
195
|
+
getUserDetailSystemRoles: (t, e, r) => n.get(`/user-detail/${t}/system-roles`, {
|
|
196
|
+
params: {
|
|
197
|
+
...r,
|
|
198
|
+
type: e
|
|
199
|
+
}
|
|
200
|
+
}),
|
|
201
|
+
// User Detail
|
|
202
|
+
getUserDetailSystemRoleList: (t, e) => n.get(`/user-detail/${t}/system-role-list`, { params: e }),
|
|
203
|
+
getUserDetailSystemRoleOptions: (t, e) => n.get(`/user-detail/${t}/system-role/option`, { params: e }),
|
|
204
|
+
getUserDetailTransactionRoleList: (t, e) => n.get(`/user-detail/${t}/transaction-role-list`, { params: e }),
|
|
205
|
+
getUserDetailUserLogBorrowingList: (t, e) => n.get(`/users-log/${t}/borrowing`, { params: e }),
|
|
206
|
+
getUserDetailUserLogAssignmentList: (t, e) => n.get(`/users-log/${t}/assignment`, { params: e }),
|
|
207
|
+
getUserDetailUserLogBorrowingOption: (t, e) => n.get(`/users-log/${t}/borrowing/option`, { params: e }),
|
|
208
|
+
getUserDetailUserLogAssignmentOption: (t, e) => n.get(`/users-log/${t}/assignment/option`, { params: e }),
|
|
209
|
+
getUserDetailTransactionAdminLogList: (t, e) => n.get(`/users-log/${t}/transaction-log`, { params: e }),
|
|
210
|
+
getUserDetailTransactionAdminLogOption: (t, e) => n.get(`/users-log/${t}/transaction-log/option`, { params: e })
|
|
211
|
+
}, v = s({
|
|
212
|
+
env: "APP_ADMIN_API",
|
|
213
|
+
prefix: "/settings-attribute/languages"
|
|
214
|
+
}), H = {
|
|
215
|
+
/**
|
|
216
|
+
* Fetch all translation messages for a specific locale.
|
|
217
|
+
* @param locale The locale code (e.g., 'en', 'id').
|
|
218
|
+
* @returns A promise resolving to a key-value record of messages.
|
|
219
|
+
*/
|
|
220
|
+
getMessages: (t) => v.get(`/${t}/translations`),
|
|
221
|
+
/**
|
|
222
|
+
* Fetch all available lang options for LanguageDropdown and LanguageSwitcher
|
|
223
|
+
*
|
|
224
|
+
* @returns Promise Array of options
|
|
225
|
+
*/
|
|
226
|
+
getLanguageOptions: async () => {
|
|
227
|
+
const { data: t } = await v.get(
|
|
228
|
+
"/dropdown"
|
|
229
|
+
);
|
|
230
|
+
return t.data;
|
|
231
|
+
},
|
|
232
|
+
/**
|
|
233
|
+
* Fetch single lang option meta data
|
|
234
|
+
*
|
|
235
|
+
* @param isoCode The locale code (e.g., 'en', 'id').
|
|
236
|
+
* @returns Promise LanguageMeta
|
|
237
|
+
*/
|
|
238
|
+
getLanguageOptionMeta: async (t) => {
|
|
239
|
+
const { data: e } = await v.get(
|
|
240
|
+
"/dropdown/" + t
|
|
241
|
+
);
|
|
242
|
+
return e.data;
|
|
243
|
+
},
|
|
244
|
+
/**
|
|
245
|
+
* Translate a specific text to the target locale.
|
|
246
|
+
*
|
|
247
|
+
* @param key Unique translation key.
|
|
248
|
+
* @param locale Target locale code.
|
|
249
|
+
*/
|
|
250
|
+
translateText: async (t, e) => {
|
|
251
|
+
const { data: r } = await v.post("/translate", {
|
|
252
|
+
q: t,
|
|
253
|
+
target: e
|
|
254
|
+
});
|
|
255
|
+
return r.data.translations[t];
|
|
256
|
+
}
|
|
257
|
+
}, L = s({
|
|
258
|
+
prefix: "/dashboard/v2/dashboard"
|
|
259
|
+
}), X = {
|
|
260
|
+
getLatestTask: (t) => L.get("/latest-task", { params: t }),
|
|
261
|
+
getSummary: (t) => L.get("/summary", { params: t })
|
|
262
|
+
}, S = s({
|
|
263
|
+
prefix: "/alias-code/api/alias-code"
|
|
264
|
+
}), tt = {
|
|
265
|
+
getAliasCode: () => S.get("/"),
|
|
266
|
+
postAliasCode: (t) => S.post("/", t),
|
|
267
|
+
getAliasCodeList: (t) => S.get(`/${t.object}/code-list`, { params: t })
|
|
268
|
+
}, O = s({
|
|
269
|
+
prefix: "/settings-attribute/v2/general-settings"
|
|
270
|
+
}), et = {
|
|
271
|
+
getGeneralSettings: () => O.get("/"),
|
|
272
|
+
putUpdateGeneralSettings: (t) => O.put("/", t)
|
|
273
|
+
}, p = s({
|
|
274
|
+
prefix: "/settings-attribute/v2/custom-field"
|
|
275
|
+
}), rt = {
|
|
276
|
+
getCustomField: async (t) => p.get("/", { params: t }),
|
|
277
|
+
getOptions: async (t) => p.get("/options", { params: t }),
|
|
278
|
+
postCreateCustomField: async (t, e) => p.post("/", e, { params: t }),
|
|
279
|
+
putEditCustomField: async (t, e, r) => p.put(`/${r}`, e, { params: t }),
|
|
280
|
+
putChangeStatus: async (t, e) => p.put("/bulk", e, { params: t }),
|
|
281
|
+
deleteCustomField: async (t) => p.delete("/bulk", { data: t })
|
|
282
|
+
}, f = ({ headers: t = {}, params: e = {} } = {}) => {
|
|
283
|
+
const r = y("APP_COUNTRY_STATE_API"), i = y("APP_COUNTRY_STATE_API_KEY");
|
|
284
|
+
return U.create({
|
|
285
|
+
baseURL: `${r}/v1`,
|
|
286
|
+
headers: {
|
|
287
|
+
"Content-type": "application/json",
|
|
288
|
+
"X-CSCAPI-KEY": i,
|
|
289
|
+
...t
|
|
290
|
+
},
|
|
291
|
+
params: e
|
|
292
|
+
});
|
|
293
|
+
}, st = {
|
|
294
|
+
getCountry: () => f().get("/countries"),
|
|
295
|
+
getState: (t) => f().get(`/countries/${t}/states`),
|
|
296
|
+
getCity: (t, e) => f().get(`/countries/${t}/states/${e}/cities`)
|
|
297
|
+
}, a = s({
|
|
298
|
+
prefix: "/routine/v2"
|
|
299
|
+
}), nt = {
|
|
300
|
+
getList: (t) => a.get("/service-center", { params: t }),
|
|
301
|
+
postList: (t) => a.post("/service-center", t),
|
|
302
|
+
putList: (t, e) => a.put(`/service-center/${t}`, e),
|
|
303
|
+
putActivate: (t) => a.put("/service-center/bulk", t),
|
|
304
|
+
getDetailList: (t) => a.get(`/service-center/${t}`),
|
|
305
|
+
getListOptions: (t) => a.get("/service-center/options", { params: t }),
|
|
306
|
+
deleteList: (t) => a.delete("/service-center", { params: t }),
|
|
307
|
+
// Activities
|
|
308
|
+
getActivities: (t) => a.get("/service-activities", { params: t }),
|
|
309
|
+
getActivityOptions: (t) => a.get("/service-activities/options", { params: t }),
|
|
310
|
+
getActivityDetail: (t) => a.get(`/service-activities/${t}`),
|
|
311
|
+
getActivityLog: (t) => a.get(`/service-activities/${t}/activity-log`)
|
|
312
|
+
}, x = s({
|
|
313
|
+
prefix: "/settings-attribute/v2/brands"
|
|
314
|
+
}), ot = {
|
|
315
|
+
getDropdown: (t) => x.get("/dropdown", { params: t })
|
|
316
|
+
}, d = s({
|
|
317
|
+
prefix: "/file-manager/v2"
|
|
318
|
+
}), it = {
|
|
319
|
+
/**
|
|
320
|
+
* Get storage information.
|
|
321
|
+
*
|
|
322
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
323
|
+
*/
|
|
324
|
+
getStorageInformation: () => d.get("/files/storage"),
|
|
325
|
+
/**
|
|
326
|
+
* Get file manager data.
|
|
327
|
+
*
|
|
328
|
+
* @param {FileType} type - The type of the file.
|
|
329
|
+
* @param {FileManagerFilterParams} [params] - The parameters for filtering.
|
|
330
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
331
|
+
*/
|
|
332
|
+
getFileManager: (t, e) => d.get(`/${t}`, { params: e }),
|
|
333
|
+
/**
|
|
334
|
+
* Get file manager options.
|
|
335
|
+
*
|
|
336
|
+
* @param {FileType} type - The type of the file.
|
|
337
|
+
* @param {FileManagerOptionBoolean} [params] - The parameters for options.
|
|
338
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
339
|
+
*/
|
|
340
|
+
getFileManagerOption: (t, e) => d.get(`/${t}/options`, { params: e }),
|
|
341
|
+
/**
|
|
342
|
+
* Recover files.
|
|
343
|
+
*
|
|
344
|
+
* @param {FileType} type - The type of the file.
|
|
345
|
+
* @param {object} body - The body of the request.
|
|
346
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
347
|
+
*/
|
|
348
|
+
recoverFiles: (t, e) => d.put(`/${t}/recover`, e),
|
|
349
|
+
/**
|
|
350
|
+
* Delete files.
|
|
351
|
+
*
|
|
352
|
+
* @param {FileType} type - The type of the file.
|
|
353
|
+
* @param {DeleteFileManagerDto} params - The params of the request.
|
|
354
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
355
|
+
*/
|
|
356
|
+
deleteFiles: (t, e) => d.delete(`/${t}`, { params: e }),
|
|
357
|
+
/**
|
|
358
|
+
* Delete files permanently.
|
|
359
|
+
*
|
|
360
|
+
* @param {FileType} type - The type of the file.
|
|
361
|
+
* @param {object} body - The body of the request.
|
|
362
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
363
|
+
*/
|
|
364
|
+
deletePermanently: (t, e) => d.delete(`/${t}/delete-permanent`, { params: e })
|
|
365
|
+
}, A = s({
|
|
366
|
+
prefix: "/utility/v2"
|
|
367
|
+
}), at = {
|
|
368
|
+
/**
|
|
369
|
+
* Get storage information.
|
|
370
|
+
*
|
|
371
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
372
|
+
*/
|
|
373
|
+
getStorageInformation: () => A.get("/files/storage"),
|
|
374
|
+
/**
|
|
375
|
+
* Get file manager data.
|
|
376
|
+
*
|
|
377
|
+
* @param {FileType} type - The type of the file.
|
|
378
|
+
* @param {FileManagerFilterParams} [params] - The parameters for filtering.
|
|
379
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
380
|
+
*/
|
|
381
|
+
getFileManager: (t, e) => A.get(`/${t}`, { params: e }),
|
|
382
|
+
/**
|
|
383
|
+
* Get file manager options.
|
|
384
|
+
*
|
|
385
|
+
* @param {FileType} type - The type of the file.
|
|
386
|
+
* @param {FileManagerOptionBoolean} [params] - The parameters for options.
|
|
387
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
388
|
+
*/
|
|
389
|
+
getFileManagerOption: (t, e) => A.get(`/${t}/options`, { params: e }),
|
|
390
|
+
/**
|
|
391
|
+
* Recover files.
|
|
392
|
+
*
|
|
393
|
+
* @param {FileType} type - The type of the file.
|
|
394
|
+
* @param {object} body - The body of the request.
|
|
395
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
396
|
+
*/
|
|
397
|
+
recoverFiles: (t, e) => A.put(`/${t}/recover`, e),
|
|
398
|
+
/**
|
|
399
|
+
* Delete files.
|
|
400
|
+
*
|
|
401
|
+
* @param {FileType} type - The type of the file.
|
|
402
|
+
* @param {DeleteFileManagerDto} params - The params of the request.
|
|
403
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
404
|
+
*/
|
|
405
|
+
deleteFiles: (t, e) => A.delete(`/${t}`, { params: e }),
|
|
406
|
+
/**
|
|
407
|
+
* Delete files permanently.
|
|
408
|
+
*
|
|
409
|
+
* @param {FileType} type - The type of the file.
|
|
410
|
+
* @param {object} body - The body of the request.
|
|
411
|
+
* @returns {Promise<AxiosResponse>} The Axios Response.
|
|
412
|
+
*/
|
|
413
|
+
deletePermanently: (t, e) => A.delete(`/${t}/delete-permanent`, { params: e })
|
|
414
|
+
}, c = s({
|
|
415
|
+
prefix: "/iot/v2/reader"
|
|
416
|
+
}), gt = {
|
|
417
|
+
getData: (t) => c.get("/", { params: t }),
|
|
418
|
+
getDataOptions: (t) => c.get("/options", { params: t }),
|
|
419
|
+
getActivityLogData: (t) => c.get("/activity-log", { params: t }),
|
|
420
|
+
getActivityLogOptions: (t) => c.get("/activity-log/options", { params: t }),
|
|
421
|
+
getDataById: (t) => c.get(`/${t}`),
|
|
422
|
+
getChangeLog: (t) => c.get(`/${t.id}/change-log`, { params: t }),
|
|
423
|
+
getChangeLogOptions: (t) => c.get(`/${t.id}/change-log/options`, { params: t }),
|
|
424
|
+
putData: (t, e) => c.put(`/${t}`, e)
|
|
425
|
+
}, o = s({
|
|
426
|
+
prefix: "/settings-user-role/v2"
|
|
427
|
+
}), ut = {
|
|
428
|
+
/**
|
|
429
|
+
* Retrieves the transaction role for the given group and transaction name.
|
|
430
|
+
* @param {string} groupId - The ID of the group to retrieve the transaction role for.
|
|
431
|
+
* @param {string} transactionName - The name of the transaction to retrieve the role for.
|
|
432
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
433
|
+
*/
|
|
434
|
+
getTransactionRole: (t, e) => o.get(`/transaction-roles/${t}/${e}`),
|
|
435
|
+
/**
|
|
436
|
+
* Updates the users assigned to the given transaction role.
|
|
437
|
+
* @param {string} groupId - The ID of the group the transaction role belongs to.
|
|
438
|
+
* @param {string} transactionName - The name of the transaction to update.
|
|
439
|
+
* @param {UpdateUser} body - The request body containing the updated user information.
|
|
440
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
441
|
+
*/
|
|
442
|
+
putUpdateUsers: (t, e, r) => o.put(
|
|
443
|
+
`/transaction-roles/${t}/${e}/update-user`,
|
|
444
|
+
r
|
|
445
|
+
),
|
|
446
|
+
/**
|
|
447
|
+
* Updates the approval level 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 {UserApprovalLevel} body - The request body containing the updated approval level.
|
|
451
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
452
|
+
*/
|
|
453
|
+
putUpdateLevel: (t, e, r) => o.put(
|
|
454
|
+
`/transaction-roles/${t}/${e}/update-approval-level`,
|
|
455
|
+
r
|
|
456
|
+
),
|
|
457
|
+
/**
|
|
458
|
+
* Updates the group management settings for the given transaction role.
|
|
459
|
+
* @param {string} groupId - The ID of the group the transaction role belongs to.
|
|
460
|
+
* @param {string} transactionName - The name of the transaction to update.
|
|
461
|
+
* @param {GroupManageByParent} body - The request body containing the updated management settings.
|
|
462
|
+
* @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
|
|
463
|
+
*/
|
|
464
|
+
putUpdateGroupManage: (t, e, r) => o.put(
|
|
465
|
+
`/transaction-roles/${t}/${e}/update-manage-by-parent`,
|
|
466
|
+
r
|
|
467
|
+
),
|
|
468
|
+
getAssignedUserAmounts: () => o.get("/system-roles/amounts"),
|
|
469
|
+
getPermissionUser: (t, e) => {
|
|
470
|
+
if (["totalControl", "readOnly"].includes(t ?? "")) {
|
|
471
|
+
const r = t === "totalControl" ? "total-control" : "read-only";
|
|
472
|
+
return o.get(`/system-roles/total-control-read-only/${r}`, {
|
|
473
|
+
params: e
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
return o.get(`/system-roles/permission/${t}`, { params: e });
|
|
477
|
+
},
|
|
478
|
+
getPermissionUserOptions: (t, e) => {
|
|
479
|
+
if (["totalControl", "readOnly"].includes(t ?? "")) {
|
|
480
|
+
const r = t === "totalControl" ? "total-control" : "read-only";
|
|
481
|
+
return o.get(`/system-roles/total-control-read-only/${r}/options`, {
|
|
482
|
+
params: e
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
return o.get(`/system-roles/permission/${t}/options`, {
|
|
486
|
+
params: e
|
|
487
|
+
});
|
|
488
|
+
},
|
|
489
|
+
getUserGroups: (t, e) => o.get(`/system-roles/permission/${e}/groups`, {
|
|
490
|
+
params: t
|
|
491
|
+
}),
|
|
492
|
+
postAssignUser: (t, e) => {
|
|
493
|
+
if (["totalControl", "readOnly"].includes(e ?? "")) {
|
|
494
|
+
const r = e === "totalControl" ? "total-control" : "read-only";
|
|
495
|
+
return o.post(`/system-roles/total-control-read-only/${r}`, t);
|
|
496
|
+
}
|
|
497
|
+
return o.post(`/system-roles/permission/${e}`, t);
|
|
498
|
+
},
|
|
499
|
+
putEditUser: (t, e) => o.put(`/system-roles/${e}`, t),
|
|
500
|
+
putSetActive: (t, e) => {
|
|
501
|
+
if (["totalControl", "readOnly"].includes(e ?? "")) {
|
|
502
|
+
const r = e === "totalControl" ? "total-control" : "read-only";
|
|
503
|
+
return o.put(`/system-roles/total-control-read-only/${r}`, t);
|
|
504
|
+
}
|
|
505
|
+
return o.put("/system-roles/set-active", t);
|
|
506
|
+
},
|
|
507
|
+
deleteRemoveUser: (t, e) => {
|
|
508
|
+
if (["totalControl", "readOnly"].includes(e ?? "")) {
|
|
509
|
+
const r = e === "totalControl" ? "total-control" : "read-only";
|
|
510
|
+
return o.delete(`/system-roles/total-control-read-only/${r}`, {
|
|
511
|
+
data: t
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
return o.delete("/system-roles", { data: t });
|
|
515
|
+
}
|
|
104
516
|
};
|
|
105
517
|
export {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
518
|
+
tt as AliasCodeServices,
|
|
519
|
+
Y as AssetServices,
|
|
520
|
+
ot as BrandServices,
|
|
521
|
+
j as ChangelogServices,
|
|
522
|
+
st as CountryStateServices,
|
|
523
|
+
rt as CustomFieldServices,
|
|
524
|
+
X as DashboardServices,
|
|
525
|
+
it as FileManagerServices,
|
|
526
|
+
at as FileManagerServicesGo,
|
|
527
|
+
et as GeneralSettingsServices,
|
|
528
|
+
k as GroupCategoryServices,
|
|
529
|
+
B as GroupCategoryServicesGo,
|
|
530
|
+
H as I18nService,
|
|
531
|
+
J as MissingServices,
|
|
532
|
+
V as NotificationApprovalServices,
|
|
533
|
+
q as NotificationServices,
|
|
534
|
+
K as NotificationServicesGo,
|
|
535
|
+
gt as ReaderServices,
|
|
536
|
+
ut as RoleServices,
|
|
537
|
+
nt as ServiceCenterServices,
|
|
538
|
+
W as SessionLogServices,
|
|
539
|
+
z as TAGServices,
|
|
540
|
+
Q as TrackingServices,
|
|
541
|
+
Z as UserServices,
|
|
542
|
+
y as getBaseURL,
|
|
543
|
+
w as getImageURL,
|
|
544
|
+
M as queryParamsStringfy
|
|
114
545
|
};
|
package/api-services.system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["axios"],function(n,S){"use strict";var A;return{setters:[u=>{A=u.default}],execute:function(){const u={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,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"},p=n("getBaseURL",(t="APP_API")=>u["VITE_"+t]),c=(t={},e=!1)=>{const{env:r="APP_API",prefix:o="",headers:g={},...i}=t,l=`${p(r)}${o}`,_=JSON.parse(localStorage.getItem("user")??"{}"),f=_.jwt??_.token??"";return A.create({...i,baseURL:l,headers:e?g:{"Content-Type":"application/json",Authorization:`Bearer ${f}`,...g}})},$=n("queryParamsStringfy",t=>{if(!t||typeof t=="string")return;const e={};return Object.keys(t).forEach(r=>{Array.isArray(t[r])?t[r].length>0&&Object.assign(e,{[r]:JSON.stringify(t[r])}):t[r]!==void 0&&Object.assign(e,{[r]:t[r]})}),e}),v=n("getImageURL",(t,e,r)=>{if(!t)return;const o=p("APP_API"),g=t.startsWith("http")?t:`${o}/utility/v2/files/${t.replace(/^\/+/,"")}`;if(e||r){const i=new URLSearchParams;return e&&(i.set("width",e.toString()),i.set("height",r?r==null?void 0:r.toString():e.toString())),`${g}?${i.toString()}`}return g}),y=n("oldGetImageURL",t=>{if(!t)return;const e=p("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),a=c({prefix:"/settings-attribute/v2"}),T=n("GroupCategoryServices",{getGroupCategory:t=>{const e=t==="category"?t:"groups";return a.get(`/${e}/tree`)},getGroupCategoryList:(t,e)=>{const r=t==="category"?t:"groups";return a.get(`/${r}/${e}`)},getNames:t=>{const e=t==="category"?t:"groups";return a.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return a.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return a.put(`/${o}/${r}`,e)},deleteGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return a.delete(`/${o}/${r}`,{data:e})}}),s=c({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),C=n("OldGroupCategoryServices",{getGroupCategory:t=>{const e=t==="category"?t:"groups";return s.get(`/${e}/tree`)},getGroupCategoryList:(t,e)=>{const r=t==="category"?t:"groups";return s.get(`/${r}/${e}`)},getNames:t=>{const e=t==="category"?t:"groups";return s.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return s.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return s.put(`/${o}/${r}`,e)},putMoveGroup:(t,e)=>s.put(`/groups/${e}/move-group`,t),putEditBulkGroups:async t=>s.put("/bulk",t),deleteGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return s.delete(`/${o}/${r}`,{data:e})}}),I=c({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),d=n("NotificationApprovalServices",{getTotalApprovals:()=>I.get("/approval/count")}),P=c({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),G=n("ChangelogServices",{getActionLog:t=>P.get("/change-log",{params:t}),getActionLogOption:t=>P.get("/change-log/options",{params:t})})}}});
|
|
1
|
+
System.register(["axios"],function(s,w){"use strict";var P;return{setters:[I=>{P=I.default}],execute:function(){const I={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"},S=s("getBaseURL",(t="APP_API")=>I["VITE_"+t]),n=(t={},e=!1)=>{const{env:r="APP_API",prefix:a="",headers:_={},...E}=t,b=`${S(r)}${a}`,h=JSON.parse(localStorage.getItem("user")??"{}"),M=h.jwt??h.token??"";return P.create({...E,baseURL:b,headers:e?_:{"Content-Type":"application/json",Authorization:`Bearer ${M}`,..._}})},k=s("queryParamsStringfy",t=>{if(!t||typeof t=="string")return;const e={};return Object.keys(t).forEach(r=>{Array.isArray(t[r])?t[r].length>0&&Object.assign(e,{[r]:JSON.stringify(t[r])}):t[r]!==void 0&&Object.assign(e,{[r]:t[r]})}),e}),B=s("getImageURL",t=>{if(!t)return;const e=S("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),c=n({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),V=s("GroupCategoryServices",{getGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return c.get(`/${r}/tree`,{params:e})},getGroupCategoryList:(t,e,r)=>{const a=t==="category"?t:"groups";return c.get(`/${a}/${e}`,{params:r})},getNames:t=>{const e=t==="category"?t:"groups";return c.get(`/${e}/names`)},getCodes:t=>{const e=t==="category"?t:"groups";return c.get(`/${e}/codes`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return c.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const a=t==="category"?t:"groups";return c.put(`/${a}/${r}`,e)},putMoveGroup:(t,e)=>c.put(`/groups/${e}/move-group`,t),putEditBulkGroups:async t=>c.put("/groups/bulk",t),deleteGroupCategory:(t,e,r)=>{const a=t==="category"?t:"groups";return c.delete(`/${a}/${r}`,{data:e})}}),p=n({prefix:"/settings-attribute-go/v2"}),j=s("GroupCategoryServicesGo",{getGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return p.get(`/${r}/tree`,{params:e})},getGroupCategoryList:(t,e)=>{const r=t==="category"?t:"groups";return p.get(`/${r}/${e}`)},getNames:t=>{const e=t==="category"?t:"groups";return p.get(`/${e}/names`)},getCodes:t=>{const e=t==="category"?t:"groups";return p.get(`/${e}/codes`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return p.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const a=t==="category"?t:"groups";return p.put(`/${a}/${r}`,e)},deleteGroupCategory:(t,e,r)=>{const a=t==="category"?t:"groups";return p.delete(`/${a}/${r}`,{data:e})}}),G=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),Y=s("NotificationApprovalServices",{getTotalApprovals:()=>G.get("/approval/count")}),$=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),q=s("ChangelogServices",{getActionLog:t=>$.get("/change-log",{params:t}),getActionLogOption:t=>$.get("/change-log/options",{params:t}),getSessionLogList:t=>$.get("/session-log",{params:t}),getUserDetailSystemLogList:t=>$.get("/change-log",{params:t}),getUserDetailSystemLogOption:t=>$.get("/change-log/options",{params:t})}),u=n({prefix:"/assets/v2/assets"}),J=s("AssetServices",{getScanTag:t=>u.get("/scan",{params:{tag:t}}),getAllAssets:t=>u.get("/",{params:t}),getAvailableAssets:t=>u.get("/available",{params:t}),scanAsset:t=>u.get("",{params:{tag:t}}),getAssetsById:(t,e)=>u.get("/by-id",{params:{_id:t,...e}}),getOptions:(t,e)=>u.get(t?`/${t}/options`:"/options",{params:e}),getUnlinkedAssets:t=>u.get("/unlinked",{params:t}),getAssetDetail:(t,e)=>u.get(`/${t}`,{params:e}),getLinkedAssetFamily:t=>u.get("/family",{params:{id:t}}),matchAssetWithTag:(t,e)=>{const r={_id:JSON.stringify([t]),tag:e};return u.get("/by-id",{params:r})}}),D=n({prefix:"/tracking/v2/missing"}),K=s("MissingServices",{putFoundAsset:(t,e)=>{const r={ids:[t],serialNumber:e};return D.put("/found",r)}}),L=n({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),x=s("NotificationServices",{getNotifications:t=>L.get("/",{params:t}),readNotification:t=>L.put(`/${t}`)}),U=n({prefix:"/utility/v2/notification"}),W=s("NotificationServicesGo",{getNotifications:t=>U.get("/",{params:t}),readNotification:t=>U.put(`/${t}`)}),R=n({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),z=s("SessionLogServices",{postLogout:()=>R.post("/logout")}),f=n({prefix:"/tag/v2"}),Q=s("TAGServices",{getScanQR:t=>f.get("/qr",{params:{tag:t}}),getScanRFID:t=>f.get("/rfid",{params:{tag:t}}),getRFIDQRTAG:t=>f.get("/rfid-qr/scan",{params:t})}),N=n({prefix:"/tracking/v2/tracking"}),Z=s("TrackingServices",{putFoundAsset:(t,e,r)=>{const a={tag:t,group:e,serialNumber:r,type:"Global"};return N.put("/found",{params:a})}}),o=n({prefix:"/settings-user-role/v2"}),H=s("UserServices",{reLogin:t=>o.post("/auth/login",t),changePassword:t=>o.put("/users/change-password",t),getUserDropdown:t=>o.get("/users/dropdown",{params:t}),getUserOptions:t=>o.get("/users/options",{params:t}),getUserList:t=>o.get("/users",{params:t}),getUserDetail:t=>o.get(`/users/${t}`),putEditUser:(t,e)=>{const r={"Content-Type":"multipart/form-data"};return o.put(`/users/${t}`,e,{headers:r})},putDeleteProfilePicture:t=>o.put(`/users/${t}/delete-profile-picture`),putCancelEmailChange:(t,e)=>o.put("/auth/confirm-email-change/cancel",{user:t,companyCode:e}),getUserDetailSystemRoles:(t,e,r)=>o.get(`/user-detail/${t}/system-roles`,{params:{...r,type:e}}),getUserDetailSystemRoleList:(t,e)=>o.get(`/user-detail/${t}/system-role-list`,{params:e}),getUserDetailSystemRoleOptions:(t,e)=>o.get(`/user-detail/${t}/system-role/option`,{params:e}),getUserDetailTransactionRoleList:(t,e)=>o.get(`/user-detail/${t}/transaction-role-list`,{params:e}),getUserDetailUserLogBorrowingList:(t,e)=>o.get(`/users-log/${t}/borrowing`,{params:e}),getUserDetailUserLogAssignmentList:(t,e)=>o.get(`/users-log/${t}/assignment`,{params:e}),getUserDetailUserLogBorrowingOption:(t,e)=>o.get(`/users-log/${t}/borrowing/option`,{params:e}),getUserDetailUserLogAssignmentOption:(t,e)=>o.get(`/users-log/${t}/assignment/option`,{params:e}),getUserDetailTransactionAdminLogList:(t,e)=>o.get(`/users-log/${t}/transaction-log`,{params:e}),getUserDetailTransactionAdminLogOption:(t,e)=>o.get(`/users-log/${t}/transaction-log/option`,{params:e})}),y=n({env:"APP_ADMIN_API",prefix:"/settings-attribute/languages"}),X=s("I18nService",{getMessages:t=>y.get(`/${t}/translations`),getLanguageOptions:async()=>{const{data:t}=await y.get("/dropdown");return t.data},getLanguageOptionMeta:async t=>{const{data:e}=await y.get("/dropdown/"+t);return e.data},translateText:async(t,e)=>{const{data:r}=await y.post("/translate",{q:t,target:e});return r.data.translations[t]}}),O=n({prefix:"/dashboard/v2/dashboard"}),tt=s("DashboardServices",{getLatestTask:t=>O.get("/latest-task",{params:t}),getSummary:t=>O.get("/summary",{params:t})}),m=n({prefix:"/alias-code/api/alias-code"}),et=s("AliasCodeServices",{getAliasCode:()=>m.get("/"),postAliasCode:t=>m.post("/",t),getAliasCodeList:t=>m.get(`/${t.object}/code-list`,{params:t})}),T=n({prefix:"/settings-attribute/v2/general-settings"}),rt=s("GeneralSettingsServices",{getGeneralSettings:()=>T.get("/"),putUpdateGeneralSettings:t=>T.put("/",t)}),d=n({prefix:"/settings-attribute/v2/custom-field"}),st=s("CustomFieldServices",{getCustomField:async t=>d.get("/",{params:t}),getOptions:async t=>d.get("/options",{params:t}),postCreateCustomField:async(t,e)=>d.post("/",e,{params:t}),putEditCustomField:async(t,e,r)=>d.put(`/${r}`,e,{params:t}),putChangeStatus:async(t,e)=>d.put("/bulk",e,{params:t}),deleteCustomField:async t=>d.delete("/bulk",{data:t})}),C=({headers:t={},params:e={}}={})=>{const r=S("APP_COUNTRY_STATE_API"),a=S("APP_COUNTRY_STATE_API_KEY");return P.create({baseURL:`${r}/v1`,headers:{"Content-type":"application/json","X-CSCAPI-KEY":a,...t},params:e})},nt=s("CountryStateServices",{getCountry:()=>C().get("/countries"),getState:t=>C().get(`/countries/${t}/states`),getCity:(t,e)=>C().get(`/countries/${t}/states/${e}/cities`)}),g=n({prefix:"/routine/v2"}),ot=s("ServiceCenterServices",{getList:t=>g.get("/service-center",{params:t}),postList:t=>g.post("/service-center",t),putList:(t,e)=>g.put(`/service-center/${t}`,e),putActivate:t=>g.put("/service-center/bulk",t),getDetailList:t=>g.get(`/service-center/${t}`),getListOptions:t=>g.get("/service-center/options",{params:t}),deleteList:t=>g.delete("/service-center",{params:t}),getActivities:t=>g.get("/service-activities",{params:t}),getActivityOptions:t=>g.get("/service-activities/options",{params:t}),getActivityDetail:t=>g.get(`/service-activities/${t}`),getActivityLog:t=>g.get(`/service-activities/${t}/activity-log`)}),F=n({prefix:"/settings-attribute/v2/brands"}),it=s("BrandServices",{getDropdown:t=>F.get("/dropdown",{params:t})}),v=n({prefix:"/file-manager/v2"}),at=s("FileManagerServices",{getStorageInformation:()=>v.get("/files/storage"),getFileManager:(t,e)=>v.get(`/${t}`,{params:e}),getFileManagerOption:(t,e)=>v.get(`/${t}/options`,{params:e}),recoverFiles:(t,e)=>v.put(`/${t}/recover`,e),deleteFiles:(t,e)=>v.delete(`/${t}`,{params:e}),deletePermanently:(t,e)=>v.delete(`/${t}/delete-permanent`,{params:e})}),A=n({prefix:"/utility/v2"}),gt=s("FileManagerServicesGo",{getStorageInformation:()=>A.get("/files/storage"),getFileManager:(t,e)=>A.get(`/${t}`,{params:e}),getFileManagerOption:(t,e)=>A.get(`/${t}/options`,{params:e}),recoverFiles:(t,e)=>A.put(`/${t}/recover`,e),deleteFiles:(t,e)=>A.delete(`/${t}`,{params:e}),deletePermanently:(t,e)=>A.delete(`/${t}/delete-permanent`,{params:e})}),l=n({prefix:"/iot/v2/reader"}),ut=s("ReaderServices",{getData:t=>l.get("/",{params:t}),getDataOptions:t=>l.get("/options",{params:t}),getActivityLogData:t=>l.get("/activity-log",{params:t}),getActivityLogOptions:t=>l.get("/activity-log/options",{params:t}),getDataById:t=>l.get(`/${t}`),getChangeLog:t=>l.get(`/${t.id}/change-log`,{params:t}),getChangeLogOptions:t=>l.get(`/${t.id}/change-log/options`,{params:t}),putData:(t,e)=>l.put(`/${t}`,e)}),i=n({prefix:"/settings-user-role/v2"}),ct=s("RoleServices",{getTransactionRole:(t,e)=>i.get(`/transaction-roles/${t}/${e}`),putUpdateUsers:(t,e,r)=>i.put(`/transaction-roles/${t}/${e}/update-user`,r),putUpdateLevel:(t,e,r)=>i.put(`/transaction-roles/${t}/${e}/update-approval-level`,r),putUpdateGroupManage:(t,e,r)=>i.put(`/transaction-roles/${t}/${e}/update-manage-by-parent`,r),getAssignedUserAmounts:()=>i.get("/system-roles/amounts"),getPermissionUser:(t,e)=>{if(["totalControl","readOnly"].includes(t??"")){const r=t==="totalControl"?"total-control":"read-only";return i.get(`/system-roles/total-control-read-only/${r}`,{params:e})}return i.get(`/system-roles/permission/${t}`,{params:e})},getPermissionUserOptions:(t,e)=>{if(["totalControl","readOnly"].includes(t??"")){const r=t==="totalControl"?"total-control":"read-only";return i.get(`/system-roles/total-control-read-only/${r}/options`,{params:e})}return i.get(`/system-roles/permission/${t}/options`,{params:e})},getUserGroups:(t,e)=>i.get(`/system-roles/permission/${e}/groups`,{params:t}),postAssignUser:(t,e)=>{if(["totalControl","readOnly"].includes(e??"")){const r=e==="totalControl"?"total-control":"read-only";return i.post(`/system-roles/total-control-read-only/${r}`,t)}return i.post(`/system-roles/permission/${e}`,t)},putEditUser:(t,e)=>i.put(`/system-roles/${e}`,t),putSetActive:(t,e)=>{if(["totalControl","readOnly"].includes(e??"")){const r=e==="totalControl"?"total-control":"read-only";return i.put(`/system-roles/total-control-read-only/${r}`,t)}return i.put("/system-roles/set-active",t)},deleteRemoveUser:(t,e)=>{if(["totalControl","readOnly"].includes(e??"")){const r=e==="totalControl"?"total-control":"read-only";return i.delete(`/system-roles/total-control-read-only/${r}`,{data:t})}return i.delete("/system-roles",{data:t})}})}}});
|