@tagsamurai/gsts-api-services 2.0.1-alpha.19 → 2.0.1-alpha.21
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 +189 -140
- package/main.d.ts +1 -0
- package/package.json +1 -1
- package/src/dto/dataTable.dto.d.ts +3 -0
- package/src/dto/hardware.dto.d.ts +6 -8
- package/src/dto/import.dto.d.ts +17 -0
- package/src/services/globalTag.service.d.ts +2 -3
- package/src/services/import.service.d.ts +25 -0
- package/src/types/import.type.d.ts +28 -0
package/api-services.es.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import R from "axios";
|
|
2
|
+
const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_GLOBAL_SETTINGS_API: "https://dev-api.global-settings.tagsamurai.com", VITE_APP_IMAGE_BASE_URL: "https://dev-api.tagsamurai.com/fam/utility/v2/files", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, I = (t = "APP_TAGSAMURAI_API") => U["VITE_" + t], p = (t = {}, e = !1) => {
|
|
3
3
|
const {
|
|
4
4
|
env: r = "APP_GLOBAL_SETTINGS_API",
|
|
5
5
|
prefix: n = "",
|
|
6
|
-
headers:
|
|
7
|
-
...
|
|
8
|
-
} = t,
|
|
9
|
-
...
|
|
10
|
-
baseURL:
|
|
11
|
-
headers: e ?
|
|
6
|
+
headers: a = {},
|
|
7
|
+
...c
|
|
8
|
+
} = t, w = "".concat(I(r)).concat(n), A = R.create({
|
|
9
|
+
...c,
|
|
10
|
+
baseURL: w,
|
|
11
|
+
headers: e ? a : {
|
|
12
12
|
"Content-Type": "application/json",
|
|
13
|
-
...
|
|
13
|
+
...a
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
return
|
|
17
|
-
var
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
}),
|
|
21
|
-
},
|
|
16
|
+
return A.interceptors.request.use((h) => {
|
|
17
|
+
var S, y, $;
|
|
18
|
+
const P = JSON.parse((S = localStorage.getItem("user")) != null ? S : "{}"), O = ($ = (y = P.jwt) != null ? y : P.token) != null ? $ : "";
|
|
19
|
+
return h.headers.Authorization = "Bearer ".concat(O), h;
|
|
20
|
+
}), A;
|
|
21
|
+
}, l = p({
|
|
22
22
|
prefix: "/v1/global-settings/auth"
|
|
23
|
-
}),
|
|
24
|
-
var e, r, n,
|
|
25
|
-
return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((
|
|
26
|
-
},
|
|
23
|
+
}), E = (t) => {
|
|
24
|
+
var e, r, n, a;
|
|
25
|
+
return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((a = (n = t.response) == null ? void 0 : n.data) == null ? void 0 : a.message) === "jwt malformed" ? (window.onblur = null, window.onfocus = null, window.sessionExpired = !0, window.dispatchEvent(new CustomEvent("user:expired"))) : Promise.reject(t);
|
|
26
|
+
}, k = {
|
|
27
27
|
login: (t) => {
|
|
28
28
|
const e = { ...t, isMobile: !1 };
|
|
29
|
-
return
|
|
29
|
+
return l.post("/login", e);
|
|
30
30
|
},
|
|
31
|
-
reLogin: (t) => (
|
|
31
|
+
reLogin: (t) => (l.interceptors.response.use((e) => e, E), l.post("/login", t)),
|
|
32
32
|
requestOTP: (t) => {
|
|
33
33
|
const e = { email: t };
|
|
34
|
-
return
|
|
34
|
+
return l.post("/request-otp", e);
|
|
35
35
|
},
|
|
36
36
|
requestResetPassLink: (t) => {
|
|
37
37
|
const e = { email: t };
|
|
38
|
-
return
|
|
38
|
+
return l.post("/request-reset-link", e);
|
|
39
39
|
},
|
|
40
|
-
setPassword: (t) =>
|
|
41
|
-
verifyToken: (t) =>
|
|
40
|
+
setPassword: (t) => l.post("/set-password", t),
|
|
41
|
+
verifyToken: (t) => l.get("/verify-token/".concat(t)),
|
|
42
42
|
confirmEmailChange: (t) => {
|
|
43
43
|
const e = { token: t };
|
|
44
|
-
return
|
|
44
|
+
return l.put("/confirm-email-change/confirm", e);
|
|
45
45
|
},
|
|
46
|
-
postLogout: () =>
|
|
46
|
+
postLogout: () => l.post("/logout"),
|
|
47
47
|
/**
|
|
48
48
|
*
|
|
49
49
|
* @deprecated use postLogout instead
|
|
50
50
|
*/
|
|
51
|
-
logout: () =>
|
|
52
|
-
},
|
|
51
|
+
logout: () => l.post("/logout")
|
|
52
|
+
}, L = (t, e, r) => {
|
|
53
53
|
const n = new URL(I("APP_TAGSAMURAI_API") || "").origin;
|
|
54
|
-
let
|
|
54
|
+
let a = t.startsWith("http") ? t : "".concat(n, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
|
|
55
55
|
if (e || r) {
|
|
56
|
-
const
|
|
57
|
-
e && (
|
|
56
|
+
const c = new URLSearchParams();
|
|
57
|
+
e && (c.set("width", e.toString()), c.set("height", (r == null ? void 0 : r.toString()) || e.toString())), a += "?".concat(c.toString());
|
|
58
58
|
}
|
|
59
|
-
return
|
|
59
|
+
return a;
|
|
60
60
|
}, _ = () => {
|
|
61
61
|
var e, r, n;
|
|
62
62
|
const t = JSON.parse((e = localStorage.getItem("user")) != null ? e : "{}");
|
|
63
63
|
return (n = (r = t.jwt) != null ? r : t.token) != null ? n : "";
|
|
64
|
-
},
|
|
64
|
+
}, x = async (t, e) => {
|
|
65
65
|
const r = await fetch(t, {
|
|
66
66
|
headers: {
|
|
67
67
|
Authorization: "Bearer ".concat(e)
|
|
@@ -73,17 +73,17 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
73
73
|
return new Blob([n], {
|
|
74
74
|
type: r.headers.get("Content-Type") || "image/webp"
|
|
75
75
|
});
|
|
76
|
-
},
|
|
76
|
+
}, C = async (t) => {
|
|
77
77
|
try {
|
|
78
|
-
const e = _(), r = await
|
|
78
|
+
const e = _(), r = await x(t, e);
|
|
79
79
|
return URL.createObjectURL(r);
|
|
80
80
|
} catch (e) {
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, H = async (t, e, r, n) => {
|
|
84
84
|
if (!t) return;
|
|
85
|
-
const
|
|
86
|
-
return n ?
|
|
85
|
+
const a = L(t, e, r);
|
|
86
|
+
return n ? a : C(a);
|
|
87
87
|
}, J = (t) => {
|
|
88
88
|
if (!t || typeof t == "string")
|
|
89
89
|
return;
|
|
@@ -95,7 +95,7 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
95
95
|
[r]: t[r]
|
|
96
96
|
});
|
|
97
97
|
}), e;
|
|
98
|
-
},
|
|
98
|
+
}, G = (t) => {
|
|
99
99
|
if (typeof t != "string") return !1;
|
|
100
100
|
const e = t.trim();
|
|
101
101
|
if (!e) return !1;
|
|
@@ -104,67 +104,67 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
104
104
|
} catch (r) {
|
|
105
105
|
return !1;
|
|
106
106
|
}
|
|
107
|
-
},
|
|
107
|
+
}, u = (t) => {
|
|
108
108
|
if (!t)
|
|
109
109
|
return {};
|
|
110
110
|
const e = {};
|
|
111
111
|
return Object.keys(t).forEach((r) => {
|
|
112
112
|
const n = t[r];
|
|
113
|
-
e[r] =
|
|
113
|
+
e[r] = G(n) ? JSON.parse(n.trim()) : n;
|
|
114
114
|
}), e;
|
|
115
|
-
},
|
|
115
|
+
}, D = p({
|
|
116
116
|
prefix: "/v1/global-settings/change-log"
|
|
117
|
-
}),
|
|
118
|
-
getChangelogs: (t) =>
|
|
119
|
-
getChangelogOptions: (t) =>
|
|
120
|
-
},
|
|
117
|
+
}), j = {
|
|
118
|
+
getChangelogs: (t) => D.get("", { params: t }),
|
|
119
|
+
getChangelogOptions: (t) => D.get("/options", { params: t })
|
|
120
|
+
}, m = p({
|
|
121
121
|
prefix: "/v1/global-settings/division"
|
|
122
|
-
}),
|
|
123
|
-
getDivisions: (t) =>
|
|
124
|
-
getDivisionDetail: (t) =>
|
|
125
|
-
postCreateDivision: (t) =>
|
|
126
|
-
putEditDivision: (t, e) =>
|
|
122
|
+
}), B = {
|
|
123
|
+
getDivisions: (t) => m.get("", { params: t }),
|
|
124
|
+
getDivisionDetail: (t) => m.get("/".concat(t)),
|
|
125
|
+
postCreateDivision: (t) => m.post("/", t),
|
|
126
|
+
putEditDivision: (t, e) => m.put("/".concat(t), e),
|
|
127
127
|
deleteDivisions: (t) => {
|
|
128
128
|
const e = { id: JSON.stringify(t) };
|
|
129
|
-
return
|
|
129
|
+
return m.delete("", { params: e });
|
|
130
130
|
}
|
|
131
|
-
},
|
|
131
|
+
}, d = p({
|
|
132
132
|
prefix: "/v2/hardware-tagging"
|
|
133
|
-
}),
|
|
134
|
-
getAllTAG: (t
|
|
135
|
-
const
|
|
136
|
-
return
|
|
133
|
+
}), q = {
|
|
134
|
+
getAllTAG: (t) => {
|
|
135
|
+
const e = u(t);
|
|
136
|
+
return d.post("/all-tag/list", e);
|
|
137
137
|
},
|
|
138
|
-
getAllTAGOptions: (t
|
|
139
|
-
const
|
|
140
|
-
return
|
|
138
|
+
getAllTAGOptions: (t) => {
|
|
139
|
+
const e = u(t);
|
|
140
|
+
return d.post("all-tag/options", e);
|
|
141
141
|
},
|
|
142
|
-
getNotPairedYetCounts: () =>
|
|
142
|
+
getNotPairedYetCounts: () => d.get("/not-paired-yet/tag-count"),
|
|
143
143
|
getNotPairedYetList: (t) => {
|
|
144
|
-
const e =
|
|
145
|
-
return
|
|
144
|
+
const e = u(t);
|
|
145
|
+
return d.post("/not-paired-yet/list", e);
|
|
146
146
|
},
|
|
147
147
|
getNotPairedYetOptions: (t) => {
|
|
148
|
-
const e =
|
|
149
|
-
return
|
|
148
|
+
const e = u(t);
|
|
149
|
+
return d.post("/not-paired-yet/options", e);
|
|
150
150
|
},
|
|
151
|
-
getAuditTAGDetail: (t) =>
|
|
152
|
-
submitAuditTAG: (t) =>
|
|
153
|
-
submitCombineTAG: (t) =>
|
|
154
|
-
submitSeparateTAG: (t) =>
|
|
151
|
+
getAuditTAGDetail: (t) => d.post("/audit/detail", t),
|
|
152
|
+
submitAuditTAG: (t) => d.post("/audit/submit", t),
|
|
153
|
+
submitCombineTAG: (t) => d.post("/combine-tag/combine", t),
|
|
154
|
+
submitSeparateTAG: (t) => d.post("/combine-tag/separate", t),
|
|
155
155
|
getPairedList: (t) => {
|
|
156
|
-
const e =
|
|
157
|
-
return
|
|
156
|
+
const e = u(t);
|
|
157
|
+
return d.post("/paired/list", e);
|
|
158
158
|
},
|
|
159
159
|
getPairedOptions: (t) => {
|
|
160
|
-
const e =
|
|
161
|
-
return
|
|
160
|
+
const e = u(t);
|
|
161
|
+
return d.post("/paired/options", e);
|
|
162
162
|
}
|
|
163
|
-
}, o =
|
|
163
|
+
}, o = p({
|
|
164
164
|
prefix: "/v2/hardware-tagging"
|
|
165
|
-
}),
|
|
165
|
+
}), V = {
|
|
166
166
|
getHandheldReader: (t) => {
|
|
167
|
-
const e =
|
|
167
|
+
const e = u(t);
|
|
168
168
|
return o.post("/handheld-reader/list", e);
|
|
169
169
|
},
|
|
170
170
|
getHandheldReaderDetail: (t) => o.get("/handheld-reader/".concat(t)),
|
|
@@ -182,7 +182,7 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
182
182
|
}),
|
|
183
183
|
putAntennaPower: (t, e) => o.put("/iot-reader/".concat(e, "/set-antenna-power"), t),
|
|
184
184
|
getIotReader: (t) => {
|
|
185
|
-
const e =
|
|
185
|
+
const e = u({ ...t });
|
|
186
186
|
return o.post("/iot-reader", e);
|
|
187
187
|
},
|
|
188
188
|
getIotReaderDetail: (t) => o.get("/iot-reader/".concat(t)),
|
|
@@ -200,85 +200,85 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
200
200
|
getDetailActivityLog: (t) => o.get("/activity-log", { params: t }),
|
|
201
201
|
getDetailActivityLogOptions: (t) => o.get("/activity-log/options", { params: t }),
|
|
202
202
|
getExistingAliasNames: () => o.get("/reader/alias-names")
|
|
203
|
-
},
|
|
203
|
+
}, N = p({
|
|
204
204
|
env: "APP_LOGS_NOTIFICATION_API",
|
|
205
205
|
prefix: "/v2"
|
|
206
|
-
}), V = {
|
|
207
|
-
getSessionLogList: (t) => C.get("/session-log", { params: t })
|
|
208
|
-
}, T = u({
|
|
209
|
-
prefix: "/v1/global-settings/option"
|
|
210
206
|
}), Y = {
|
|
207
|
+
getSessionLogList: (t) => N.get("/session-log", { params: t })
|
|
208
|
+
}, T = p({
|
|
209
|
+
prefix: "/v1/global-settings/option"
|
|
210
|
+
}), z = {
|
|
211
211
|
getPositions: () => T.get("/position"),
|
|
212
212
|
getDivisions: () => T.get("/division")
|
|
213
|
-
},
|
|
213
|
+
}, f = p({
|
|
214
214
|
prefix: "/v1/global-settings/position"
|
|
215
|
-
}),
|
|
216
|
-
getPositions: (t) =>
|
|
217
|
-
getPositionDetail: (t) =>
|
|
218
|
-
postCreatePosition: (t) =>
|
|
219
|
-
putEditPosition: (t, e) =>
|
|
215
|
+
}), X = {
|
|
216
|
+
getPositions: (t) => f.get("", { params: t }),
|
|
217
|
+
getPositionDetail: (t) => f.get("/".concat(t)),
|
|
218
|
+
postCreatePosition: (t) => f.post("/", t),
|
|
219
|
+
putEditPosition: (t, e) => f.put("/".concat(t), e),
|
|
220
220
|
deletePositions: (t) => {
|
|
221
221
|
const e = { id: JSON.stringify(t) };
|
|
222
|
-
return
|
|
222
|
+
return f.delete("", { params: e });
|
|
223
223
|
}
|
|
224
|
-
},
|
|
224
|
+
}, F = p({
|
|
225
225
|
env: "APP_TAGSAMURAI_API",
|
|
226
226
|
prefix: "/tag/v2"
|
|
227
|
-
}), X = {
|
|
228
|
-
getTagInfo: (t) => N.get("/rfid-qr/scan", { params: t })
|
|
229
|
-
}, b = u({
|
|
230
|
-
prefix: "/v2/hardware-tagging"
|
|
231
227
|
}), W = {
|
|
228
|
+
getTagInfo: (t) => F.get("/rfid-qr/scan", { params: t })
|
|
229
|
+
}, b = p({
|
|
230
|
+
prefix: "/v2/hardware-tagging"
|
|
231
|
+
}), K = {
|
|
232
232
|
getTAGEventlog: (t) => {
|
|
233
|
-
const e =
|
|
233
|
+
const e = u(t);
|
|
234
234
|
return b.post("/tag-event-log/list", e);
|
|
235
235
|
},
|
|
236
236
|
getTAGEventlogOptions: (t) => {
|
|
237
|
-
const e =
|
|
237
|
+
const e = u(t);
|
|
238
238
|
return b.post("/tag-event-log/options", e);
|
|
239
239
|
},
|
|
240
240
|
getDetailTAGEventlog: (t) => b.get("/tag-event-log/".concat(t))
|
|
241
|
-
},
|
|
241
|
+
}, g = p({
|
|
242
242
|
prefix: "/v1/global-settings/user"
|
|
243
|
-
}),
|
|
244
|
-
getUsers: (t) =>
|
|
245
|
-
getUserDetail: (t) =>
|
|
246
|
-
getUserSystemLogs: (t, e) =>
|
|
243
|
+
}), Q = {
|
|
244
|
+
getUsers: (t) => g.get("", { params: t }),
|
|
245
|
+
getUserDetail: (t) => g.get("/".concat(t)),
|
|
246
|
+
getUserSystemLogs: (t, e) => g.get("/".concat(t, "/system-logs"), { params: e }),
|
|
247
247
|
getUserSystemLogOptions: (t, e) => {
|
|
248
248
|
const r = {};
|
|
249
|
-
return r[e] = !0,
|
|
249
|
+
return r[e] = !0, g.get("/".concat(t, "/system-logs/options"), { params: r });
|
|
250
250
|
},
|
|
251
251
|
postCreateUser: (t) => {
|
|
252
252
|
const e = { "Content-Type": "multipart/form-data" };
|
|
253
|
-
return
|
|
253
|
+
return g.post("", t, { headers: e });
|
|
254
254
|
},
|
|
255
255
|
putEditUser: (t, e) => {
|
|
256
256
|
const r = { "Content-Type": "multipart/form-data" };
|
|
257
|
-
return
|
|
257
|
+
return g.put("/".concat(t), e, { headers: r });
|
|
258
258
|
},
|
|
259
259
|
deleteUsers: (t) => {
|
|
260
260
|
const e = { id: JSON.stringify(t) };
|
|
261
|
-
return
|
|
261
|
+
return g.delete("", { params: e });
|
|
262
262
|
},
|
|
263
|
-
putToggleStatusUsers: (t) =>
|
|
263
|
+
putToggleStatusUsers: (t) => g.put("/active-status", t),
|
|
264
264
|
getUserOptions: (t) => {
|
|
265
265
|
const e = {};
|
|
266
|
-
return e[t] = !0,
|
|
266
|
+
return e[t] = !0, g.get("/options", { params: e });
|
|
267
267
|
},
|
|
268
|
-
deleteCancelEmailChange: (t) =>
|
|
269
|
-
postResendEmail: (t) =>
|
|
270
|
-
putChangePassword: (t, e) =>
|
|
271
|
-
},
|
|
268
|
+
deleteCancelEmailChange: (t) => g.delete("/cancel-email-change/".concat(t)),
|
|
269
|
+
postResendEmail: (t) => g.post("/resend-email", t),
|
|
270
|
+
putChangePassword: (t, e) => g.put("/change-password/".concat(t), e)
|
|
271
|
+
}, v = p({
|
|
272
272
|
prefix: "/v2/hardware-tagging"
|
|
273
|
-
}), Q = {
|
|
274
|
-
getTabletList: (t) => f.post("/tablet/list", t),
|
|
275
|
-
getTabletOption: (t) => f.post("/tablet/options", t),
|
|
276
|
-
updateTabletStatus: (t, e) => f.patch("/tablet/status", e, { params: { ids: t } }),
|
|
277
|
-
disconnectTablet: (t) => f.patch("/tablet/disconnect-reader", { params: { ids: t } }),
|
|
278
|
-
deleteTablet: (t) => f.delete("/tablet", { params: { ids: t } })
|
|
279
|
-
}, s = u({
|
|
280
|
-
prefix: "/v2/iam"
|
|
281
273
|
}), Z = {
|
|
274
|
+
getTabletList: (t) => v.post("/tablet/list", t),
|
|
275
|
+
getTabletOption: (t) => v.post("/tablet/options", t),
|
|
276
|
+
updateTabletStatus: (t, e) => v.patch("/tablet/status", e, { params: { ids: t } }),
|
|
277
|
+
disconnectTablet: (t) => v.patch("/tablet/disconnect-reader", { params: { ids: t } }),
|
|
278
|
+
deleteTablet: (t) => v.delete("/tablet", { params: { ids: t } })
|
|
279
|
+
}, s = p({
|
|
280
|
+
prefix: "/v2/iam"
|
|
281
|
+
}), tt = {
|
|
282
282
|
login: (t) => s.post("/auth/login", t),
|
|
283
283
|
logout: () => s.post("/auth/logout"),
|
|
284
284
|
verifyToken: (t) => s.get("/auth/verify-token/".concat(t)),
|
|
@@ -288,7 +288,7 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
288
288
|
confirmEmailChange: (t) => s.post("/auth/confirm-email-change", { token: t }),
|
|
289
289
|
cancelEmailChange: (t) => s.delete("/auth/cancel-email-change/".concat(t)),
|
|
290
290
|
getPositionList: (t) => {
|
|
291
|
-
const e =
|
|
291
|
+
const e = u(t);
|
|
292
292
|
return s.post("/position/list", e);
|
|
293
293
|
},
|
|
294
294
|
getPositionDetail: (t) => s.get("/position/".concat(t)),
|
|
@@ -299,7 +299,7 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
299
299
|
return s.delete("/position", { params: e });
|
|
300
300
|
},
|
|
301
301
|
getDivisionList: (t) => {
|
|
302
|
-
const e =
|
|
302
|
+
const e = u(t);
|
|
303
303
|
return s.post("/division/list", e);
|
|
304
304
|
},
|
|
305
305
|
getDivisionDetail: (t) => s.get("/division/".concat(t)),
|
|
@@ -318,11 +318,11 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
318
318
|
});
|
|
319
319
|
},
|
|
320
320
|
getGlobalUserList: (t) => {
|
|
321
|
-
const e =
|
|
321
|
+
const e = u(t);
|
|
322
322
|
return s.post("/users/list", e);
|
|
323
323
|
},
|
|
324
324
|
getGlobalUserOptions: (t) => {
|
|
325
|
-
const e =
|
|
325
|
+
const e = u(t);
|
|
326
326
|
return s.post("/users/options", e);
|
|
327
327
|
},
|
|
328
328
|
getGlobalUserDetail: (t) => s.get("/users/".concat(t)),
|
|
@@ -332,8 +332,8 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
332
332
|
},
|
|
333
333
|
editUsers: (t, e) => {
|
|
334
334
|
const r = new FormData();
|
|
335
|
-
return Object.entries(e).forEach(([n,
|
|
336
|
-
|
|
335
|
+
return Object.entries(e).forEach(([n, a]) => {
|
|
336
|
+
a != null && r.append(n, a);
|
|
337
337
|
}), s.patch("/users/".concat(t), r, {
|
|
338
338
|
headers: { "Content-Type": "multipart/form-data" }
|
|
339
339
|
});
|
|
@@ -360,22 +360,71 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
360
360
|
exportPositionTable: () => s.post("/position/list/export", {}, { responseType: "blob" }),
|
|
361
361
|
exportDivisionTable: () => s.post("/division/list/export", {}, { responseType: "blob" }),
|
|
362
362
|
exportUserTable: () => s.post("/users/list/export", {}, { responseType: "blob" })
|
|
363
|
+
}, i = p({
|
|
364
|
+
prefix: "/v2/import"
|
|
365
|
+
}), et = {
|
|
366
|
+
// --- Division ---
|
|
367
|
+
submitDivisionFile: (t) => {
|
|
368
|
+
const e = new FormData();
|
|
369
|
+
return e.append("data", t.data), t.isFirstRowHeading !== void 0 && e.append("isFirstRowHeading", String(t.isFirstRowHeading)), t.columnMapping && e.append("columnMapping", t.columnMapping), i.post("/division/file", e, {
|
|
370
|
+
headers: { "Content-Type": "multipart/form-data" }
|
|
371
|
+
});
|
|
372
|
+
},
|
|
373
|
+
getDivisionList: (t) => i.post("/division/list", t),
|
|
374
|
+
editDivisionData: (t) => i.put("/division", t),
|
|
375
|
+
duplicateDivisionData: (t) => i.post("/division/".concat(t, "/duplicate")),
|
|
376
|
+
submitDivisionData: (t) => i.post("/division", t),
|
|
377
|
+
deleteDivisionData: (t) => {
|
|
378
|
+
const e = { ids: JSON.stringify(t.ids) };
|
|
379
|
+
return i.delete("/division", { params: e });
|
|
380
|
+
},
|
|
381
|
+
// --- Position ---
|
|
382
|
+
submitPositionFile: (t) => {
|
|
383
|
+
const e = new FormData();
|
|
384
|
+
return e.append("data", t.data), t.isFirstRowHeading !== void 0 && e.append("isFirstRowHeading", String(t.isFirstRowHeading)), t.columnMapping && e.append("columnMapping", t.columnMapping), i.post("/position/file", e, {
|
|
385
|
+
headers: { "Content-Type": "multipart/form-data" }
|
|
386
|
+
});
|
|
387
|
+
},
|
|
388
|
+
getPositionList: (t) => i.post("/position/list", t),
|
|
389
|
+
editPositionData: (t) => i.put("/position", t),
|
|
390
|
+
duplicatePositionData: (t) => i.post("/position/".concat(t, "/duplicate")),
|
|
391
|
+
submitPositionData: (t) => i.post("/position", t),
|
|
392
|
+
deletePositionData: (t) => {
|
|
393
|
+
const e = { ids: JSON.stringify(t.ids) };
|
|
394
|
+
return i.delete("/position", { params: e });
|
|
395
|
+
},
|
|
396
|
+
// --- User ---
|
|
397
|
+
submitUserFile: (t) => {
|
|
398
|
+
const e = new FormData();
|
|
399
|
+
return e.append("data", t.data), t.isFirstRowHeading !== void 0 && e.append("isFirstRowHeading", String(t.isFirstRowHeading)), t.columnMapping && e.append("columnMapping", t.columnMapping), i.post("/user/file", e, {
|
|
400
|
+
headers: { "Content-Type": "multipart/form-data" }
|
|
401
|
+
});
|
|
402
|
+
},
|
|
403
|
+
getUserList: (t) => i.post("/user/list", t),
|
|
404
|
+
editUserData: (t) => i.put("/user", t),
|
|
405
|
+
duplicateUserData: (t) => i.post("/user/".concat(t, "/duplicate")),
|
|
406
|
+
submitUserData: (t) => i.post("/user", t),
|
|
407
|
+
deleteUserData: (t) => {
|
|
408
|
+
const e = { ids: JSON.stringify(t.ids) };
|
|
409
|
+
return i.delete("/user", { params: e });
|
|
410
|
+
}
|
|
363
411
|
};
|
|
364
412
|
export {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
Y as
|
|
373
|
-
z as
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
413
|
+
k as AuthServices,
|
|
414
|
+
j as ChangelogServices,
|
|
415
|
+
B as DivisionServices,
|
|
416
|
+
q as GlobalTagServices,
|
|
417
|
+
V as HardwareServices,
|
|
418
|
+
tt as IamServices,
|
|
419
|
+
et as ImportServices,
|
|
420
|
+
Y as LogServices,
|
|
421
|
+
z as OptionServices,
|
|
422
|
+
X as PositionServices,
|
|
423
|
+
Z as TabletServices,
|
|
424
|
+
K as TagEventlogServices,
|
|
425
|
+
W as TagServices,
|
|
426
|
+
Q as UserServices,
|
|
378
427
|
I as getBaseURL,
|
|
379
|
-
|
|
428
|
+
H as getImageURL,
|
|
380
429
|
J as queryParamsStringfy
|
|
381
430
|
};
|
package/main.d.ts
CHANGED
|
@@ -11,4 +11,5 @@ export { default as TagEventlogServices } from './src/services/tagEventlog.servi
|
|
|
11
11
|
export { default as UserServices } from './src/services/user.service';
|
|
12
12
|
export { default as TabletServices } from './src/services/tablet.service';
|
|
13
13
|
export { default as IamServices } from './src/services/iam.service';
|
|
14
|
+
export { default as ImportServices } from './src/services/import.service';
|
|
14
15
|
export { getBaseURL, getImageURL, queryParamsStringfy } from './src/utils';
|
package/package.json
CHANGED
|
@@ -16,6 +16,9 @@ export type FilterOptions = {
|
|
|
16
16
|
activityOptions?: MultiSelectOption[];
|
|
17
17
|
pairedInOptions?: MultiSelectOption[];
|
|
18
18
|
availabilityOptions?: MultiSelectOption[];
|
|
19
|
+
tagTypeOptions?: MultiSelectOption[];
|
|
20
|
+
rfidSkuOptions?: MultiSelectOption[];
|
|
21
|
+
nfcSkuOptions?: MultiSelectOption[];
|
|
19
22
|
actionOptions?: MultiSelectOption[];
|
|
20
23
|
objectNameOptions?: MultiSelectOption[];
|
|
21
24
|
};
|
|
@@ -105,7 +105,7 @@ interface FixedAsset {
|
|
|
105
105
|
isRoleRestricted: boolean;
|
|
106
106
|
receivingGroups: string[];
|
|
107
107
|
}
|
|
108
|
-
interface SmartFixedReaderGroup {
|
|
108
|
+
export interface SmartFixedReaderGroup {
|
|
109
109
|
fixedAsset?: string;
|
|
110
110
|
supplyAsset?: string;
|
|
111
111
|
}
|
|
@@ -158,13 +158,11 @@ export type GetNotPairedYetOptions = {
|
|
|
158
158
|
lastScannedOptions?: boolean;
|
|
159
159
|
};
|
|
160
160
|
type TAGIds = {
|
|
161
|
-
data:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
];
|
|
161
|
+
data: {
|
|
162
|
+
rfidId: string;
|
|
163
|
+
nfcId: string;
|
|
164
|
+
qrId: string;
|
|
165
|
+
}[];
|
|
168
166
|
};
|
|
169
167
|
export type GetAuditTAGDetailParams = TAGIds;
|
|
170
168
|
export type SubmitAuditTAGBody = TAGIds & {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TableParams } from '../types/dataTable.type';
|
|
2
|
+
export interface SubmitFilePayload {
|
|
3
|
+
data: File;
|
|
4
|
+
isFirstRowHeading?: boolean;
|
|
5
|
+
columnMapping?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GetImportListParams extends TableParams {
|
|
8
|
+
}
|
|
9
|
+
export interface EditImportDataPayload<T> {
|
|
10
|
+
data: T[];
|
|
11
|
+
}
|
|
12
|
+
export interface SubmitImportDataPayload {
|
|
13
|
+
ids: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface DeleteImportDataPayload {
|
|
16
|
+
ids: string[];
|
|
17
|
+
}
|
|
@@ -2,11 +2,10 @@ import { AxiosResponse } from 'axios';
|
|
|
2
2
|
import { GetAllTAGOptionsQuery, GetAllTAGParams, GetAuditTAGDetailParams, GetNotPairedYetListParams, GetNotPairedYetOptions, SubmitAuditTAGBody, SubmitCombineTAGBody, SubmitSeparateTAGBody } from '../dto/hardware.dto';
|
|
3
3
|
import { TAGFetchOptionResponse } from '../dto/tag.dto';
|
|
4
4
|
import { FetchListResponse } from '../types/fetchResponse.type';
|
|
5
|
-
import { TAGType } from '../types/tag.type';
|
|
6
5
|
import { AuditTAGDetailResponse, NotPairedYetCountsResponse, TAGResponseType } from '../types/hardware.type';
|
|
7
6
|
declare const GlobalTagServices: {
|
|
8
|
-
getAllTAG: (
|
|
9
|
-
getAllTAGOptions: (
|
|
7
|
+
getAllTAG: (params?: GetAllTAGParams) => Promise<AxiosResponse<FetchListResponse<TAGResponseType>>>;
|
|
8
|
+
getAllTAGOptions: (params?: GetAllTAGOptionsQuery) => Promise<AxiosResponse<{
|
|
10
9
|
data: TAGFetchOptionResponse;
|
|
11
10
|
}>>;
|
|
12
11
|
getNotPairedYetCounts: () => Promise<AxiosResponse<NotPairedYetCountsResponse>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.type';
|
|
3
|
+
import { ImportFileResponse, ImportItem, ImportUserItem, ImportSubmitResponse, ImportDeleteResponse } from '../types/import.type';
|
|
4
|
+
import { SubmitFilePayload, GetImportListParams, EditImportDataPayload, SubmitImportDataPayload, DeleteImportDataPayload } from '../dto/import.dto';
|
|
5
|
+
declare const ImportServices: {
|
|
6
|
+
submitDivisionFile: (payload: SubmitFilePayload) => Promise<AxiosResponse<FetchDetailResponse<ImportFileResponse>>>;
|
|
7
|
+
getDivisionList: (params: GetImportListParams) => Promise<AxiosResponse<FetchListResponse<ImportItem>>>;
|
|
8
|
+
editDivisionData: (payload: EditImportDataPayload<ImportItem>) => Promise<AxiosResponse<FetchDetailResponse<ImportSubmitResponse>>>;
|
|
9
|
+
duplicateDivisionData: (id: string) => Promise<AxiosResponse<FetchDetailResponse<ImportItem>>>;
|
|
10
|
+
submitDivisionData: (payload: SubmitImportDataPayload) => Promise<AxiosResponse<FetchDetailResponse<ImportSubmitResponse>>>;
|
|
11
|
+
deleteDivisionData: (payload: DeleteImportDataPayload) => Promise<AxiosResponse<FetchDetailResponse<ImportDeleteResponse>>>;
|
|
12
|
+
submitPositionFile: (payload: SubmitFilePayload) => Promise<AxiosResponse<FetchDetailResponse<ImportFileResponse>>>;
|
|
13
|
+
getPositionList: (params: GetImportListParams) => Promise<AxiosResponse<FetchListResponse<ImportItem>>>;
|
|
14
|
+
editPositionData: (payload: EditImportDataPayload<ImportItem>) => Promise<AxiosResponse<FetchDetailResponse<ImportSubmitResponse>>>;
|
|
15
|
+
duplicatePositionData: (id: string) => Promise<AxiosResponse<FetchDetailResponse<ImportItem>>>;
|
|
16
|
+
submitPositionData: (payload: SubmitImportDataPayload) => Promise<AxiosResponse<FetchDetailResponse<ImportSubmitResponse>>>;
|
|
17
|
+
deletePositionData: (payload: DeleteImportDataPayload) => Promise<AxiosResponse<FetchDetailResponse<ImportDeleteResponse>>>;
|
|
18
|
+
submitUserFile: (payload: SubmitFilePayload) => Promise<AxiosResponse<FetchDetailResponse<ImportFileResponse>>>;
|
|
19
|
+
getUserList: (params: GetImportListParams) => Promise<AxiosResponse<FetchListResponse<ImportUserItem>>>;
|
|
20
|
+
editUserData: (payload: EditImportDataPayload<ImportUserItem>) => Promise<AxiosResponse<FetchDetailResponse<ImportSubmitResponse>>>;
|
|
21
|
+
duplicateUserData: (id: string) => Promise<AxiosResponse<FetchDetailResponse<ImportUserItem>>>;
|
|
22
|
+
submitUserData: (payload: SubmitImportDataPayload) => Promise<AxiosResponse<FetchDetailResponse<ImportSubmitResponse>>>;
|
|
23
|
+
deleteUserData: (payload: DeleteImportDataPayload) => Promise<AxiosResponse<FetchDetailResponse<ImportDeleteResponse>>>;
|
|
24
|
+
};
|
|
25
|
+
export default ImportServices;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface ImportItem {
|
|
2
|
+
_id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
index: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ImportUserItem {
|
|
7
|
+
_id: string;
|
|
8
|
+
firstName: string;
|
|
9
|
+
lastName: string;
|
|
10
|
+
position: string | null;
|
|
11
|
+
division: string;
|
|
12
|
+
employeeId: string | null;
|
|
13
|
+
access: string;
|
|
14
|
+
email: string;
|
|
15
|
+
expiryDate: string | null;
|
|
16
|
+
index: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ImportServicesResponse {
|
|
19
|
+
input: number;
|
|
20
|
+
success: number;
|
|
21
|
+
errors: string[];
|
|
22
|
+
}
|
|
23
|
+
export interface ImportFileResponse extends ImportServicesResponse {
|
|
24
|
+
}
|
|
25
|
+
export interface ImportSubmitResponse extends ImportServicesResponse {
|
|
26
|
+
}
|
|
27
|
+
export interface ImportDeleteResponse extends ImportServicesResponse {
|
|
28
|
+
}
|