@tagsamurai/gsts-api-services 2.0.1-alpha.10 → 2.0.1-alpha.12

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.
@@ -1,67 +1,67 @@
1
1
  import E from "axios";
2
- const D = { 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") => D["VITE_" + t], a = (t = {}, e = !1) => {
2
+ const D = { 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" }, O = (t = "APP_TAGSAMURAI_API") => D["VITE_" + t], u = (t = {}, e = !1) => {
3
3
  const {
4
4
  env: r = "APP_GLOBAL_SETTINGS_API",
5
- prefix: n = "",
5
+ prefix: o = "",
6
6
  headers: i = {},
7
- ...c
8
- } = t, O = "".concat(I(r)).concat(n), h = E.create({
9
- ...c,
10
- baseURL: O,
7
+ ...l
8
+ } = t, I = "".concat(O(r)).concat(o), A = E.create({
9
+ ...l,
10
+ baseURL: I,
11
11
  headers: e ? i : {
12
12
  "Content-Type": "application/json",
13
13
  ...i
14
14
  }
15
15
  });
16
- return h.interceptors.request.use((m) => {
17
- var b, $, T;
18
- const P = JSON.parse((b = localStorage.getItem("user")) != null ? b : "{}"), w = (T = ($ = P.jwt) != null ? $ : P.token) != null ? T : "";
16
+ return A.interceptors.request.use((m) => {
17
+ var P, y, S;
18
+ const b = JSON.parse((P = localStorage.getItem("user")) != null ? P : "{}"), w = (S = (y = b.jwt) != null ? y : b.token) != null ? S : "";
19
19
  return m.headers.Authorization = "Bearer ".concat(w), m;
20
- }), h;
21
- }, p = a({
20
+ }), A;
21
+ }, c = u({
22
22
  prefix: "/v1/global-settings/auth"
23
- }), U = (t) => {
24
- var e, r, n, i;
25
- return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((i = (n = t.response) == null ? void 0 : n.data) == null ? void 0 : i.message) === "jwt malformed" ? (window.onblur = null, window.onfocus = null, window.sessionExpired = !0, window.dispatchEvent(new CustomEvent("user:expired"))) : Promise.reject(t);
23
+ }), L = (t) => {
24
+ var e, r, o, i;
25
+ return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((i = (o = t.response) == null ? void 0 : o.data) == null ? void 0 : i.message) === "jwt malformed" ? (window.onblur = null, window.onfocus = null, window.sessionExpired = !0, window.dispatchEvent(new CustomEvent("user:expired"))) : Promise.reject(t);
26
26
  }, j = {
27
27
  login: (t) => {
28
28
  const e = { ...t, isMobile: !1 };
29
- return p.post("/login", e);
29
+ return c.post("/login", e);
30
30
  },
31
- reLogin: (t) => (p.interceptors.response.use((e) => e, U), p.post("/login", t)),
31
+ reLogin: (t) => (c.interceptors.response.use((e) => e, L), c.post("/login", t)),
32
32
  requestOTP: (t) => {
33
33
  const e = { email: t };
34
- return p.post("/request-otp", e);
34
+ return c.post("/request-otp", e);
35
35
  },
36
36
  requestResetPassLink: (t) => {
37
37
  const e = { email: t };
38
- return p.post("/request-reset-link", e);
38
+ return c.post("/request-reset-link", e);
39
39
  },
40
- setPassword: (t) => p.post("/set-password", t),
41
- verifyToken: (t) => p.get("/verify-token/".concat(t)),
40
+ setPassword: (t) => c.post("/set-password", t),
41
+ verifyToken: (t) => c.get("/verify-token/".concat(t)),
42
42
  confirmEmailChange: (t) => {
43
43
  const e = { token: t };
44
- return p.put("/confirm-email-change/confirm", e);
44
+ return c.put("/confirm-email-change/confirm", e);
45
45
  },
46
- postLogout: () => p.post("/logout"),
46
+ postLogout: () => c.post("/logout"),
47
47
  /**
48
48
  *
49
49
  * @deprecated use postLogout instead
50
50
  */
51
- logout: () => p.post("/logout")
52
- }, _ = (t, e, r) => {
53
- const n = new URL(I("APP_TAGSAMURAI_API") || "").origin;
54
- let i = t.startsWith("http") ? t : "".concat(n, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
51
+ logout: () => c.post("/logout")
52
+ }, U = (t, e, r) => {
53
+ const o = new URL(O("APP_TAGSAMURAI_API") || "").origin;
54
+ let i = t.startsWith("http") ? t : "".concat(o, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
55
55
  if (e || r) {
56
- const c = new URLSearchParams();
57
- e && (c.set("width", e.toString()), c.set("height", (r == null ? void 0 : r.toString()) || e.toString())), i += "?".concat(c.toString());
56
+ const l = new URLSearchParams();
57
+ e && (l.set("width", e.toString()), l.set("height", (r == null ? void 0 : r.toString()) || e.toString())), i += "?".concat(l.toString());
58
58
  }
59
59
  return i;
60
- }, L = () => {
61
- var e, r, n;
60
+ }, _ = () => {
61
+ var e, r, o;
62
62
  const t = JSON.parse((e = localStorage.getItem("user")) != null ? e : "{}");
63
- return (n = (r = t.jwt) != null ? r : t.token) != null ? n : "";
64
- }, G = async (t, e) => {
63
+ return (o = (r = t.jwt) != null ? r : t.token) != null ? o : "";
64
+ }, R = async (t, e) => {
65
65
  const r = await fetch(t, {
66
66
  headers: {
67
67
  Authorization: "Bearer ".concat(e)
@@ -69,21 +69,21 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
69
69
  });
70
70
  if (!r.ok)
71
71
  throw new Error("Image fetch failed: ".concat(r.status, " ").concat(r.statusText));
72
- const n = await r.arrayBuffer();
73
- return new Blob([n], {
72
+ const o = await r.arrayBuffer();
73
+ return new Blob([o], {
74
74
  type: r.headers.get("Content-Type") || "image/webp"
75
75
  });
76
- }, R = async (t) => {
76
+ }, G = async (t) => {
77
77
  try {
78
- const e = L(), r = await G(t, e);
78
+ const e = _(), r = await R(t, e);
79
79
  return URL.createObjectURL(r);
80
80
  } catch (e) {
81
81
  return;
82
82
  }
83
- }, B = async (t, e, r, n) => {
83
+ }, B = async (t, e, r, o) => {
84
84
  if (!t) return;
85
- const i = _(t, e, r);
86
- return n ? i : R(i);
85
+ const i = U(t, e, r);
86
+ return o ? i : G(i);
87
87
  }, J = (t) => {
88
88
  if (!t || typeof t == "string")
89
89
  return;
@@ -104,20 +104,20 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
104
104
  } catch (r) {
105
105
  return !1;
106
106
  }
107
- }, l = (t) => {
107
+ }, a = (t) => {
108
108
  if (!t)
109
109
  return {};
110
110
  const e = {};
111
111
  return Object.keys(t).forEach((r) => {
112
- const n = t[r];
113
- e[r] = x(n) ? JSON.parse(n.trim()) : n;
112
+ const o = t[r];
113
+ e[r] = x(o) ? JSON.parse(o.trim()) : o;
114
114
  }), e;
115
- }, S = a({
115
+ }, T = u({
116
116
  prefix: "/v1/global-settings/change-log"
117
117
  }), M = {
118
- getChangelogs: (t) => S.get("", { params: t }),
119
- getChangelogOptions: (t) => S.get("/options", { params: t })
120
- }, d = a({
118
+ getChangelogs: (t) => T.get("", { params: t }),
119
+ getChangelogOptions: (t) => T.get("/options", { params: t })
120
+ }, d = u({
121
121
  prefix: "/v1/global-settings/division"
122
122
  }), q = {
123
123
  getDivisions: (t) => d.get("", { params: t }),
@@ -128,73 +128,93 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
128
128
  const e = { id: JSON.stringify(t) };
129
129
  return d.delete("", { params: e });
130
130
  }
131
- }, g = a({
132
- prefix: "/v1/global-settings"
131
+ }, g = u({
132
+ prefix: "/v2/hardware-tagging"
133
133
  }), F = {
134
- getTAGAllPaired: (t, e) => g.get("/".concat(t), { params: e }),
135
- getTAGAllPairedOptions: (t, e) => g.get("/".concat(t, "/options"), { params: e }),
136
- getTAGNotPaired: (t, e) => g.get("/".concat(t, "/not-paired"), { params: e }),
137
- getTAGNotPairedOptions: (t, e) => g.get("/".concat(t, "/not-paired/options"), { params: e }),
138
- getScanTAG: (t, e) => g.get("/".concat(t, "/scan"), { params: e }),
139
- putDetailAuditTAG: (t, e) => g.put("/".concat(t, "/audit-detail"), e),
140
- putAuditTAG: (t, e) => g.put("/".concat(t, "/audit"), e),
141
- putAllocateTAG: (t, e) => g.put("/".concat(t, "/allocate"), e),
142
- putCombineTAG: (t) => g.put("/combine", t)
143
- }, o = a({
134
+ getAllTAG: (t, e) => {
135
+ const r = a(e);
136
+ return g.post("/".concat(t), r);
137
+ },
138
+ getAllTAGOptions: (t, e) => {
139
+ const r = a(e);
140
+ return g.post("/".concat(t, "/options"), r);
141
+ },
142
+ getNotPairedYetCounts: () => g.get("/not-paired-yet/tag-count"),
143
+ getNotPairedYetList: (t) => {
144
+ const e = a(t);
145
+ return g.post("/not-paired-yet/list", e);
146
+ },
147
+ getNotPairedYetOptions: (t) => {
148
+ const e = a(t);
149
+ return g.post("/not-paired-yet/options", e);
150
+ },
151
+ getAuditTAGDetail: (t) => g.post("/audit/detail", t),
152
+ submitAuditTAG: (t) => g.post("/audit/submit", t),
153
+ submitCombineTAG: (t) => g.post("/combine-tag/combine", t),
154
+ submitSeparateTAG: (t) => g.post("/combine-tag/separate", t),
155
+ getPairedList: (t) => {
156
+ const e = a(t);
157
+ return g.post("/paired/list", e);
158
+ },
159
+ getPairedOptions: (t) => {
160
+ const e = a(t);
161
+ return g.post("/paired/options", e);
162
+ }
163
+ }, n = u({
144
164
  prefix: "/v2/hardware-tagging"
145
165
  }), H = {
146
166
  getHandheldReader: (t) => {
147
- const e = l(t);
148
- return o.post("/handheld-reader/list", e);
167
+ const e = a(t);
168
+ return n.post("/handheld-reader/list", e);
149
169
  },
150
- getHandheldReaderDetail: (t) => o.get("/handheld-reader/".concat(t)),
170
+ getHandheldReaderDetail: (t) => n.get("/handheld-reader/".concat(t)),
151
171
  getHandheldReaderOptions: (t) => {
152
- const e = l(t);
153
- return o.post("/handheld-reader/options", e);
172
+ const e = a(t);
173
+ return n.post("/handheld-reader/options", e);
154
174
  },
155
- putMarkHandheldStatus: (t) => o.patch("/handheld-reader/status", t),
156
- putPingReaders: (t) => o.put("/iot-reader/ping", t),
157
- putMarkIOTStatus: (t, e) => o.put("/".concat(e, "/mark-status"), t),
158
- putEditReaderGroup: (t, e, r) => o.patch(
175
+ putMarkHandheldStatus: (t) => n.patch("/handheld-reader/status", t),
176
+ putPingReaders: (t) => n.put("/iot-reader/ping", t),
177
+ putMarkIOTStatus: (t, e) => n.put("/".concat(e, "/mark-status"), t),
178
+ putEditReaderGroup: (t, e, r) => n.patch(
159
179
  "/".concat(t === "iot" ? "iot-" : "handheld-", "reader/").concat(r, "/group"),
160
180
  e
161
181
  ),
162
- putEditAntennaGroup: (t, e) => o.put("/iot-reader/".concat(e, "/set-port-group"), t),
163
- putEditPortStatus: (t, e) => o.put("/iot-reader/".concat(e, "/set-port-status"), t),
164
- putEditAliasName: (t, e, r) => o.patch(
182
+ putEditAntennaGroup: (t, e) => n.put("/iot-reader/".concat(e, "/set-port-group"), t),
183
+ putEditPortStatus: (t, e) => n.put("/iot-reader/".concat(e, "/set-port-status"), t),
184
+ putEditAliasName: (t, e, r) => n.patch(
165
185
  "/".concat(t === "iot" ? "iot-" : "handheld-", "reader/").concat(r, "/alias-name"),
166
186
  e
167
187
  ),
168
- postActivateHardware: (t, e) => o.post(
188
+ postActivateHardware: (t, e) => n.post(
169
189
  "/".concat(t === "iot" ? "iot-" : "handheld-", "reader/activate"),
170
190
  e
171
191
  ),
172
- deleteHardware: (t, e) => o.delete("/".concat(t === "iot" ? "iot-" : "handheld-", "-reader"), {
192
+ deleteHardware: (t, e) => n.delete("/".concat(t === "iot" ? "iot-" : "handheld-", "-reader"), {
173
193
  params: e
174
194
  }),
175
- putAntennaPower: (t, e) => o.put("/iot-reader/".concat(e, "/set-antenna-power"), t),
176
- getIOTReaderOrAntenna: (t, e) => o.get("/".concat(t), { params: e }),
177
- getIOTReaderDetail: (t) => o.get("/iot-reader/".concat(t)),
178
- getIOTReaderOrAntennaOptions: (t, e) => o.get("/".concat(t, "/options"), { params: e }),
179
- getActivityLog: (t) => o.get("/activity-log", { params: t }),
180
- getActivityLogOptions: (t) => o.get("/activity-log/options", { params: t }),
181
- getDetailActivityLog: (t) => o.get("/activity-log", { params: t }),
182
- getDetailActivityLogOptions: (t) => o.get("/activity-log/options", { params: t }),
183
- getExistingAliasNames: () => o.get("/reader/alias-names"),
184
- getIotReaderPort: (t, e) => o.get("/iot-reader/".concat(t, "/ports"), { params: e })
185
- }, C = a({
195
+ putAntennaPower: (t, e) => n.put("/iot-reader/".concat(e, "/set-antenna-power"), t),
196
+ getIOTReaderOrAntenna: (t, e) => n.get("/".concat(t), { params: e }),
197
+ getIOTReaderDetail: (t) => n.get("/iot-reader/".concat(t)),
198
+ getIOTReaderOrAntennaOptions: (t, e) => n.get("/".concat(t, "/options"), { params: e }),
199
+ getActivityLog: (t) => n.get("/activity-log", { params: t }),
200
+ getActivityLogOptions: (t) => n.get("/activity-log/options", { params: t }),
201
+ getDetailActivityLog: (t) => n.get("/activity-log", { params: t }),
202
+ getDetailActivityLogOptions: (t) => n.get("/activity-log/options", { params: t }),
203
+ getExistingAliasNames: () => n.get("/reader/alias-names"),
204
+ getIotReaderPort: (t, e) => n.get("/iot-reader/".concat(t, "/ports"), { params: e })
205
+ }, C = u({
186
206
  env: "APP_LOGS_NOTIFICATION_API",
187
207
  prefix: "/v2"
188
208
  }), V = {
189
209
  getSessionLogList: (t) => C.get("/session-log", { params: t })
190
- }, y = a({
210
+ }, $ = u({
191
211
  prefix: "/v1/global-settings/option"
192
- }), z = {
193
- getPositions: () => y.get("/position"),
194
- getDivisions: () => y.get("/division")
195
- }, v = a({
212
+ }), Y = {
213
+ getPositions: () => $.get("/position"),
214
+ getDivisions: () => $.get("/division")
215
+ }, v = u({
196
216
  prefix: "/v1/global-settings/position"
197
- }), X = {
217
+ }), z = {
198
218
  getPositions: (t) => v.get("", { params: t }),
199
219
  getPositionDetail: (t) => v.get("/".concat(t)),
200
220
  postCreatePosition: (t) => v.post("/", t),
@@ -203,56 +223,62 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
203
223
  const e = { id: JSON.stringify(t) };
204
224
  return v.delete("", { params: e });
205
225
  }
206
- }, N = a({
226
+ }, N = u({
207
227
  env: "APP_TAGSAMURAI_API",
208
228
  prefix: "/tag/v2"
209
- }), W = {
229
+ }), X = {
210
230
  getTagInfo: (t) => N.get("/rfid-qr/scan", { params: t })
211
- }, f = a({
212
- prefix: "/v1/global-settings/change-log"
213
- }), K = {
214
- getTAGEventlog: (t) => f.get("/tag-event-log", { params: t }),
215
- getTAGEventlogOptions: (t) => f.get("/tag-event-log/options", { params: t }),
231
+ }, f = u({
232
+ prefix: "/v2/hardware-tagging"
233
+ }), W = {
234
+ getTAGEventlog: (t) => {
235
+ const e = a(t);
236
+ return f.post("/tag-event-log/list", e);
237
+ },
238
+ getTAGEventlogOptions: (t) => {
239
+ const e = a(t);
240
+ return f.post("/tag-event-log/options", e);
241
+ },
216
242
  getDetailTAGEventlog: (t) => f.get("/tag-event-log/".concat(t))
217
- }, u = a({
243
+ }, p = u({
218
244
  prefix: "/v1/global-settings/user"
219
- }), Q = {
220
- getUsers: (t) => u.get("", { params: t }),
221
- getUserDetail: (t) => u.get("/".concat(t)),
222
- getUserSystemLogs: (t, e) => u.get("/".concat(t, "/system-logs"), { params: e }),
245
+ }), K = {
246
+ getUsers: (t) => p.get("", { params: t }),
247
+ getUserDetail: (t) => p.get("/".concat(t)),
248
+ getUserSystemLogs: (t, e) => p.get("/".concat(t, "/system-logs"), { params: e }),
223
249
  getUserSystemLogOptions: (t, e) => {
224
250
  const r = {};
225
- return r[e] = !0, u.get("/".concat(t, "/system-logs/options"), { params: r });
251
+ return r[e] = !0, p.get("/".concat(t, "/system-logs/options"), { params: r });
226
252
  },
227
253
  postCreateUser: (t) => {
228
254
  const e = { "Content-Type": "multipart/form-data" };
229
- return u.post("", t, { headers: e });
255
+ return p.post("", t, { headers: e });
230
256
  },
231
257
  putEditUser: (t, e) => {
232
258
  const r = { "Content-Type": "multipart/form-data" };
233
- return u.put("/".concat(t), e, { headers: r });
259
+ return p.put("/".concat(t), e, { headers: r });
234
260
  },
235
261
  deleteUsers: (t) => {
236
262
  const e = { id: JSON.stringify(t) };
237
- return u.delete("", { params: e });
263
+ return p.delete("", { params: e });
238
264
  },
239
- putToggleStatusUsers: (t) => u.put("/active-status", t),
265
+ putToggleStatusUsers: (t) => p.put("/active-status", t),
240
266
  getUserOptions: (t) => {
241
267
  const e = {};
242
- return e[t] = !0, u.get("/options", { params: e });
268
+ return e[t] = !0, p.get("/options", { params: e });
243
269
  },
244
- deleteCancelEmailChange: (t) => u.delete("/cancel-email-change/".concat(t)),
245
- postResendEmail: (t) => u.post("/resend-email", t),
246
- putChangePassword: (t, e) => u.put("/change-password/".concat(t), e)
247
- }, A = a({
270
+ deleteCancelEmailChange: (t) => p.delete("/cancel-email-change/".concat(t)),
271
+ postResendEmail: (t) => p.post("/resend-email", t),
272
+ putChangePassword: (t, e) => p.put("/change-password/".concat(t), e)
273
+ }, h = u({
248
274
  prefix: "/v2/hardware-tagging"
249
- }), Y = {
250
- getTabletList: (t) => A.post("/tablet/list", t),
251
- getTabletOption: (t) => A.post("/tablet/options", t),
252
- updateTabletStatus: (t, e) => A.patch("/tablet/status", e, { params: { ids: t } }),
253
- disconnectTablet: (t) => A.patch("/tablet/disconnect-reader", { params: { ids: t } }),
254
- deleteTablet: (t) => A.delete("/tablet", { params: { ids: t } })
255
- }, s = a({
275
+ }), Q = {
276
+ getTabletList: (t) => h.post("/tablet/list", t),
277
+ getTabletOption: (t) => h.post("/tablet/options", t),
278
+ updateTabletStatus: (t, e) => h.patch("/tablet/status", e, { params: { ids: t } }),
279
+ disconnectTablet: (t) => h.patch("/tablet/disconnect-reader", { params: { ids: t } }),
280
+ deleteTablet: (t) => h.delete("/tablet", { params: { ids: t } })
281
+ }, s = u({
256
282
  prefix: "/v2/iam"
257
283
  }), Z = {
258
284
  login: (t) => s.post("/auth/login", t),
@@ -264,7 +290,7 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
264
290
  confirmEmailChange: (t) => s.post("/auth/confirm-email-change", { token: t }),
265
291
  cancelEmailChange: (t) => s.delete("/auth/cancel-email-change/".concat(t)),
266
292
  getPositionList: (t) => {
267
- const e = l(t);
293
+ const e = a(t);
268
294
  return s.post("/position/list", e);
269
295
  },
270
296
  getPositionDetail: (t) => s.get("/position/".concat(t)),
@@ -275,7 +301,7 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
275
301
  return s.delete("/position", { params: e });
276
302
  },
277
303
  getDivisionList: (t) => {
278
- const e = l(t);
304
+ const e = a(t);
279
305
  return s.post("/division/list", e);
280
306
  },
281
307
  getDivisionDetail: (t) => s.get("/division/".concat(t)),
@@ -287,18 +313,18 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
287
313
  },
288
314
  createUsers: (t) => {
289
315
  const e = new FormData();
290
- return Object.entries(t).forEach(([r, n]) => {
291
- n != null && e.append(r, n);
316
+ return Object.entries(t).forEach(([r, o]) => {
317
+ o != null && e.append(r, o);
292
318
  }), s.post("/users", e, {
293
319
  headers: { "Content-Type": "multipart/form-data" }
294
320
  });
295
321
  },
296
322
  getGlobalUserList: (t) => {
297
- const e = l(t);
323
+ const e = a(t);
298
324
  return s.post("/users/list", e);
299
325
  },
300
326
  getGlobalUserOptions: (t) => {
301
- const e = l(t);
327
+ const e = a(t);
302
328
  return s.post("/users/options", e);
303
329
  },
304
330
  getGlobalUserDetail: (t) => s.get("/users/".concat(t)),
@@ -308,8 +334,8 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
308
334
  },
309
335
  editUsers: (t, e) => {
310
336
  const r = new FormData();
311
- return Object.entries(e).forEach(([n, i]) => {
312
- i != null && r.append(n, i);
337
+ return Object.entries(e).forEach(([o, i]) => {
338
+ i != null && r.append(o, i);
313
339
  }), s.patch("/users/".concat(t), r, {
314
340
  headers: { "Content-Type": "multipart/form-data" }
315
341
  });
@@ -345,13 +371,13 @@ export {
345
371
  H as HardwareServices,
346
372
  Z as IamServices,
347
373
  V as LogServices,
348
- z as OptionServices,
349
- X as PositionServices,
350
- Y as TabletServices,
351
- K as TagEventlogServices,
352
- W as TagServices,
353
- Q as UserServices,
354
- I as getBaseURL,
374
+ Y as OptionServices,
375
+ z as PositionServices,
376
+ Q as TabletServices,
377
+ W as TagEventlogServices,
378
+ X as TagServices,
379
+ K as UserServices,
380
+ O as getBaseURL,
355
381
  B as getImageURL,
356
382
  J as queryParamsStringfy
357
383
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/gsts-api-services",
3
- "version": "2.0.1-alpha.10",
3
+ "version": "2.0.1-alpha.12",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Global Settings Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -1,5 +1,6 @@
1
1
  import { AntennaPortDetail, HardwareDataType, HardwareDetailDataType } from '../types/hardware.type';
2
2
  import { MultiSelectOption } from '../types/options.type';
3
+ type TAG = 'RFID' | 'NFC';
3
4
  export interface HardwareFetchResponse<T = HardwareDataType> {
4
5
  message: string;
5
6
  status: number;
@@ -105,3 +106,55 @@ export interface PutHardwareStatusBody {
105
106
  ids?: string[];
106
107
  }
107
108
  export type HardwareFormType = PutEditAliasName | PutEditAntennaGroup | PutEditAntennaPower | PutHardwareStatusBody | PutEditReaderGroup;
109
+ export type GetAllTAGParams = {
110
+ page?: number;
111
+ limit?: number;
112
+ search?: string;
113
+ sortBy?: string;
114
+ sortOrder?: number;
115
+ column?: string[];
116
+ tagType?: string[];
117
+ rfidSku?: string[];
118
+ nfcSku?: string[];
119
+ type?: string[];
120
+ status?: string[];
121
+ lastScanned?: string[];
122
+ };
123
+ export type GetAllTAGOptionsQuery = {
124
+ tagTypeOptions?: boolean;
125
+ rfidSkuOptions?: boolean;
126
+ nfcSkuOptions?: boolean;
127
+ typeOptions?: boolean;
128
+ statusOptions?: boolean;
129
+ lastScannedOptions?: boolean;
130
+ };
131
+ export type GetNotPairedYetListParams = GetAllTAGParams & {
132
+ tag?: TAG;
133
+ };
134
+ export type GetNotPairedYetOptions = {
135
+ tag?: TAG;
136
+ tagTypeOptions?: boolean;
137
+ rfidSkuOptions?: boolean;
138
+ nfcSkuOptions?: boolean;
139
+ typeOptions?: boolean;
140
+ statusOptions?: boolean;
141
+ lastScannedOptions?: boolean;
142
+ };
143
+ type TAGIds = {
144
+ data: [
145
+ {
146
+ rfidId: string;
147
+ nfcId: string;
148
+ qrId: string;
149
+ }
150
+ ];
151
+ };
152
+ export type GetAuditTAGDetailParams = TAGIds;
153
+ export type SubmitAuditTAGBody = TAGIds & {
154
+ markNotFoundAsDamagedMissing: boolean;
155
+ };
156
+ export type SubmitCombineTAGBody = TAGIds & {
157
+ tagType: 'RFID & QR';
158
+ };
159
+ export type SubmitSeparateTAGBody = TAGIds;
160
+ export {};
@@ -1,11 +1,18 @@
1
1
  import { FetchListResponse, FetchOptionResponse } from '../types/fetchResponse.type';
2
2
  import { MultiSelectOption } from '../types/options.type';
3
- import { ApplicationModule, TAGType } from '../types/tag.type';
4
- import { TAGDetailCount, TAGEventlogData } from '../types/tagEventlog.type';
3
+ import { TAGEventlogData } from '../types/tagEventlog.type';
5
4
  export interface TAGEventlogFilterQuery {
6
- status?: string[];
7
- modifiedBy?: number[];
8
- type?: TAGType;
5
+ page?: number;
6
+ limit?: number;
7
+ search?: string;
8
+ sortBy?: string;
9
+ sortOrder?: number;
10
+ column?: string[];
11
+ type?: string;
12
+ createdAt?: string[];
13
+ action?: string[];
14
+ module?: string[];
15
+ modifiedBy?: string[];
9
16
  }
10
17
  export type TAGEventlogFetchResponse = FetchListResponse<TAGEventlogData>;
11
18
  export type TAGEventlogFetchOptionResponse = FetchOptionResponse<{
@@ -15,8 +22,33 @@ export type TAGEventlogDetailResponse = {
15
22
  status: number;
16
23
  message: string;
17
24
  data: {
18
- type: 'Audit' | 'Allocation';
19
- module?: ApplicationModule;
20
- detail: TAGDetailCount[];
25
+ auditDate: string;
26
+ found: {
27
+ total: number;
28
+ qr: number;
29
+ rfid: number;
30
+ nfc: number;
31
+ rfidNfc: number;
32
+ rfidQr: number;
33
+ nfcQr: number;
34
+ rfidNfcQr: number;
35
+ };
36
+ notFound: {
37
+ total: number;
38
+ qr: number;
39
+ rfid: number;
40
+ nfc: number;
41
+ rfidNfc: number;
42
+ rfidQr: number;
43
+ nfcQr: number;
44
+ rfidNfcQr: number;
45
+ };
46
+ markNotFoundAsDamagedMissing: boolean;
21
47
  };
22
48
  };
49
+ export type GetTAGEventLogOptionsBody = {
50
+ type: 'Audit TAG' | 'Combine & Separate TAG';
51
+ modifiedByOptions: boolean;
52
+ actionOptions: boolean;
53
+ moduleOptions: boolean;
54
+ };
@@ -1,26 +1,26 @@
1
1
  import { AxiosResponse } from 'axios';
2
- import { BooleanOptions } from '../dto/dataTable.dto';
3
- import { HardwareFilterQuery } from '../dto/hardware.dto';
4
- import { PUTAllocateTAGBody, PUTAuditTAGBody, PUTCombineTAGBody, TAGDetailAuditResponse, TAGFetchOptionResponse, TAGFetchResponse } from '../dto/tag.dto';
5
- import { FetchResponse } from '../types/fetchResponse.type';
2
+ import { GetAllTAGOptionsQuery, GetAllTAGParams, GetAuditTAGDetailParams, GetNotPairedYetListParams, GetNotPairedYetOptions, SubmitAuditTAGBody, SubmitCombineTAGBody, SubmitSeparateTAGBody } from '../dto/hardware.dto';
3
+ import { TAGFetchOptionResponse } from '../dto/tag.dto';
4
+ import { FetchDetailResponse } from '../types/fetchResponse.type';
6
5
  import { TAGType } from '../types/tag.type';
6
+ import { AuditTAGDetailResponse, NotPairedYetCounts, TAGResponseType } from '../types/hardware.type';
7
7
  declare const GlobalTagServices: {
8
- getTAGAllPaired: (tagType: TAGType, params?: HardwareFilterQuery) => Promise<AxiosResponse<TAGFetchResponse>>;
9
- getTAGAllPairedOptions: (tagType: TAGType, params?: BooleanOptions) => Promise<AxiosResponse<{
8
+ getAllTAG: (tagType: TAGType, params?: GetAllTAGParams) => Promise<AxiosResponse<FetchDetailResponse<TAGResponseType>>>;
9
+ getAllTAGOptions: (tagType: TAGType, params?: GetAllTAGOptionsQuery) => Promise<AxiosResponse<{
10
10
  data: TAGFetchOptionResponse;
11
11
  }>>;
12
- getTAGNotPaired: (tagType: TAGType, params?: HardwareFilterQuery) => Promise<AxiosResponse<TAGFetchResponse>>;
13
- getTAGNotPairedOptions: (tagType: TAGType, params?: BooleanOptions) => Promise<AxiosResponse<{
12
+ getNotPairedYetCounts: () => Promise<AxiosResponse<NotPairedYetCounts>>;
13
+ getNotPairedYetList: (params?: GetNotPairedYetListParams) => Promise<AxiosResponse<FetchDetailResponse<TAGResponseType>>>;
14
+ getNotPairedYetOptions: (params?: GetNotPairedYetOptions) => Promise<AxiosResponse<{
15
+ data: TAGFetchOptionResponse;
16
+ }>>;
17
+ getAuditTAGDetail: (params?: GetAuditTAGDetailParams) => Promise<AxiosResponse<AuditTAGDetailResponse>>;
18
+ submitAuditTAG: (body: SubmitAuditTAGBody) => Promise<AxiosResponse>;
19
+ submitCombineTAG: (body: SubmitCombineTAGBody) => Promise<AxiosResponse>;
20
+ submitSeparateTAG: (body: SubmitSeparateTAGBody) => Promise<AxiosResponse>;
21
+ getPairedList: (params?: GetAllTAGParams) => Promise<AxiosResponse<FetchDetailResponse<TAGResponseType>>>;
22
+ getPairedOptions: (params?: GetAllTAGParams) => Promise<AxiosResponse<{
14
23
  data: TAGFetchOptionResponse;
15
24
  }>>;
16
- getScanTAG: (tagType: TAGType, params?: {
17
- tag: string;
18
- }) => Promise<AxiosResponse>;
19
- putDetailAuditTAG: (tagType: TAGType, body: {
20
- ids: string[];
21
- }) => Promise<AxiosResponse<TAGDetailAuditResponse>>;
22
- putAuditTAG: (tagType: TAGType, body: PUTAuditTAGBody) => Promise<AxiosResponse<FetchResponse>>;
23
- putAllocateTAG: (tagType: TAGType, body: PUTAllocateTAGBody) => Promise<AxiosResponse<FetchResponse>>;
24
- putCombineTAG: (body: PUTCombineTAGBody) => Promise<AxiosResponse<FetchResponse>>;
25
25
  };
26
26
  export default GlobalTagServices;
@@ -1,9 +1,8 @@
1
1
  import { AxiosResponse } from 'axios';
2
- import { BooleanOptions } from '../dto/dataTable.dto';
3
- import { TAGEventlogDetailResponse, TAGEventlogFetchOptionResponse, TAGEventlogFetchResponse, TAGEventlogFilterQuery } from '../dto/tagEventlog.dto';
2
+ import { GetTAGEventLogOptionsBody, TAGEventlogDetailResponse, TAGEventlogFetchOptionResponse, TAGEventlogFetchResponse, TAGEventlogFilterQuery } from '../dto/tagEventlog.dto';
4
3
  declare const TagEventlogServices: {
5
4
  getTAGEventlog: (params?: TAGEventlogFilterQuery) => Promise<AxiosResponse<TAGEventlogFetchResponse>>;
6
- getTAGEventlogOptions: (params?: BooleanOptions) => Promise<AxiosResponse<TAGEventlogFetchOptionResponse>>;
5
+ getTAGEventlogOptions: (params?: GetTAGEventLogOptionsBody) => Promise<AxiosResponse<TAGEventlogFetchOptionResponse>>;
7
6
  getDetailTAGEventlog: (eventlogId?: string) => Promise<AxiosResponse<TAGEventlogDetailResponse>>;
8
7
  };
9
8
  export default TagEventlogServices;
@@ -1,3 +1,4 @@
1
+ import { FetchResponse } from './fetchResponse.type';
1
2
  export type HardwareTabType = 'activity-log' | 'handheld-damaged-missing' | 'handheld' | 'iot-reader' | 'iot-antenna' | 'iot-damaged-missing-reader' | 'iot-damaged-missing-antenna';
2
3
  export type HardwareDetailTabType = 'All' | 'Tagging' | 'User' | 'Antenna' | 'Changelog';
3
4
  export type ModuleGroup = {
@@ -86,3 +87,50 @@ export interface HardwareDetailUserActivity {
86
87
  newValue?: string;
87
88
  modifiedBy?: string;
88
89
  }
90
+ export type TAGResponseType = {
91
+ _id: string;
92
+ rfidCode: string | null;
93
+ nfcCode: string | null;
94
+ qrCode: string | null;
95
+ tagType: string;
96
+ rfidSku: string | null;
97
+ nfcSku: string | null;
98
+ type: string;
99
+ status: string;
100
+ lastScanned: string;
101
+ };
102
+ export type NotPairedYetCounts = {
103
+ rfid: {
104
+ available: number;
105
+ damagedMissing: number;
106
+ };
107
+ nfc: {
108
+ available: number;
109
+ damagedMissing: number;
110
+ };
111
+ };
112
+ export type AuditTAGDetailResponse = FetchResponse & {
113
+ data: AuditTAGDetail;
114
+ };
115
+ export type AuditTAGDetail = {
116
+ found: {
117
+ total: number;
118
+ qr: number;
119
+ rfid: number;
120
+ nfc: number;
121
+ rfidNfc: number;
122
+ rfidQr: number;
123
+ nfcQr: number;
124
+ rfidNfcQr: number;
125
+ };
126
+ notFound: {
127
+ total: number;
128
+ qr: number;
129
+ rfid: number;
130
+ nfc: number;
131
+ rfidNfc: number;
132
+ rfidQr: number;
133
+ nfcQr: number;
134
+ rfidNfcQr: number;
135
+ };
136
+ };