@tagsamurai/gsts-api-services 2.0.1-alpha.1 → 2.0.1-alpha.11

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,66 +1,66 @@
1
- import _ from "axios";
2
- const E = { 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" }, T = (t = "APP_TAGSAMURAI_API") => E["VITE_" + t], a = (t = {}, e = !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) => {
3
3
  const {
4
4
  env: r = "APP_GLOBAL_SETTINGS_API",
5
- prefix: s = "",
5
+ prefix: o = "",
6
6
  headers: i = {},
7
- ...p
8
- } = t, y = "".concat(T(r)).concat(s), A = _.create({
9
- ...p,
10
- baseURL: y,
7
+ ...l
8
+ } = t, O = "".concat(I(r)).concat(o), A = E.create({
9
+ ...l,
10
+ baseURL: O,
11
11
  headers: e ? i : {
12
12
  "Content-Type": "application/json",
13
13
  ...i
14
14
  }
15
15
  });
16
- return A.interceptors.request.use((v) => {
17
- var f, $, S;
18
- const P = JSON.parse((f = localStorage.getItem("user")) != null ? f : "{}"), O = (S = ($ = P.jwt) != null ? $ : P.token) != null ? S : "";
19
- return v.headers.Authorization = "Bearer ".concat(O), v;
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
+ return m.headers.Authorization = "Bearer ".concat(w), m;
20
20
  }), A;
21
- }, u = a({
21
+ }, g = a({
22
22
  prefix: "/v1/global-settings/auth"
23
- }), b = (t) => {
24
- var e, r, s, i;
25
- return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((i = (s = t.response) == null ? void 0 : s.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
- }, x = {
23
+ }), U = (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
+ }, j = {
27
27
  login: (t) => {
28
28
  const e = { ...t, isMobile: !1 };
29
- return u.post("/login", e);
29
+ return g.post("/login", e);
30
30
  },
31
- reLogin: (t) => (u.interceptors.response.use((e) => e, b), u.post("/login", t)),
31
+ reLogin: (t) => (g.interceptors.response.use((e) => e, U), g.post("/login", t)),
32
32
  requestOTP: (t) => {
33
33
  const e = { email: t };
34
- return u.post("/request-otp", e);
34
+ return g.post("/request-otp", e);
35
35
  },
36
36
  requestResetPassLink: (t) => {
37
37
  const e = { email: t };
38
- return u.post("/request-reset-link", e);
38
+ return g.post("/request-reset-link", e);
39
39
  },
40
- setPassword: (t) => u.post("/set-password", t),
41
- verifyToken: (t) => u.get("/verify-token/".concat(t)),
40
+ setPassword: (t) => g.post("/set-password", t),
41
+ verifyToken: (t) => g.get("/verify-token/".concat(t)),
42
42
  confirmEmailChange: (t) => {
43
43
  const e = { token: t };
44
- return u.put("/confirm-email-change/confirm", e);
44
+ return g.put("/confirm-email-change/confirm", e);
45
45
  },
46
- postLogout: () => u.post("/logout"),
46
+ postLogout: () => g.post("/logout"),
47
47
  /**
48
48
  *
49
49
  * @deprecated use postLogout instead
50
50
  */
51
- logout: () => u.post("/logout")
52
- }, h = (t, e, r) => {
53
- const s = new URL(T("APP_TAGSAMURAI_API") || "").origin;
54
- let i = t.startsWith("http") ? t : "".concat(s, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
51
+ logout: () => g.post("/logout")
52
+ }, _ = (t, e, r) => {
53
+ const o = new URL(I("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 p = new URLSearchParams();
57
- e && (p.set("width", e.toString()), p.set("height", (r == null ? void 0 : r.toString()) || e.toString())), i += "?".concat(p.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
60
  }, L = () => {
61
- var e, r, s;
61
+ var e, r, o;
62
62
  const t = JSON.parse((e = localStorage.getItem("user")) != null ? e : "{}");
63
- return (s = (r = t.jwt) != null ? r : t.token) != null ? s : "";
63
+ return (o = (r = t.jwt) != null ? r : t.token) != null ? o : "";
64
64
  }, R = async (t, e) => {
65
65
  const r = await fetch(t, {
66
66
  headers: {
@@ -69,22 +69,22 @@ const E = { 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 s = await r.arrayBuffer();
73
- return new Blob([s], {
72
+ const o = await r.arrayBuffer();
73
+ return new Blob([o], {
74
74
  type: r.headers.get("Content-Type") || "image/webp"
75
75
  });
76
- }, w = async (t) => {
76
+ }, G = async (t) => {
77
77
  try {
78
78
  const e = L(), r = await R(t, e);
79
79
  return URL.createObjectURL(r);
80
80
  } catch (e) {
81
81
  return;
82
82
  }
83
- }, C = async (t, e, r, s) => {
83
+ }, B = async (t, e, r, o) => {
84
84
  if (!t) return;
85
- const i = h(t, e, r);
86
- return s ? i : w(i);
87
- }, N = (t) => {
85
+ const i = _(t, e, r);
86
+ return o ? i : G(i);
87
+ }, J = (t) => {
88
88
  if (!t || typeof t == "string")
89
89
  return;
90
90
  const e = {};
@@ -95,53 +95,95 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
95
95
  [r]: t[r]
96
96
  });
97
97
  }), e;
98
- }, I = a({
98
+ }, x = (t) => {
99
+ if (typeof t != "string") return !1;
100
+ const e = t.trim();
101
+ if (!e) return !1;
102
+ try {
103
+ return JSON.parse(e), !0;
104
+ } catch (r) {
105
+ return !1;
106
+ }
107
+ }, p = (t) => {
108
+ if (!t)
109
+ return {};
110
+ const e = {};
111
+ return Object.keys(t).forEach((r) => {
112
+ const o = t[r];
113
+ e[r] = x(o) ? JSON.parse(o.trim()) : o;
114
+ }), e;
115
+ }, T = a({
99
116
  prefix: "/v1/global-settings/change-log"
100
- }), k = {
101
- getChangelogs: (t) => I.get("", { params: t }),
102
- getChangelogOptions: (t) => I.get("/options", { params: t })
103
- }, c = a({
117
+ }), M = {
118
+ getChangelogs: (t) => T.get("", { params: t }),
119
+ getChangelogOptions: (t) => T.get("/options", { params: t })
120
+ }, d = a({
104
121
  prefix: "/v1/global-settings/division"
105
- }), B = {
106
- getDivisions: (t) => c.get("", { params: t }),
107
- getDivisionDetail: (t) => c.get("/".concat(t)),
108
- postCreateDivision: (t) => c.post("/", t),
109
- putEditDivision: (t, e) => c.put("/".concat(t), e),
122
+ }), q = {
123
+ getDivisions: (t) => d.get("", { params: t }),
124
+ getDivisionDetail: (t) => d.get("/".concat(t)),
125
+ postCreateDivision: (t) => d.post("/", t),
126
+ putEditDivision: (t, e) => d.put("/".concat(t), e),
110
127
  deleteDivisions: (t) => {
111
128
  const e = { id: JSON.stringify(t) };
112
- return c.delete("", { params: e });
129
+ return d.delete("", { params: e });
113
130
  }
114
- }, g = a({
115
- prefix: "/v1/global-settings"
116
- }), j = {
117
- getTAGAllPaired: (t, e) => g.get("/".concat(t), { params: e }),
118
- getTAGAllPairedOptions: (t, e) => g.get("/".concat(t, "/options"), { params: e }),
119
- getTAGNotPaired: (t, e) => g.get("/".concat(t, "/not-paired"), { params: e }),
120
- getTAGNotPairedOptions: (t, e) => g.get("/".concat(t, "/not-paired/options"), { params: e }),
121
- getScanTAG: (t, e) => g.get("/".concat(t, "/scan"), { params: e }),
122
- putDetailAuditTAG: (t, e) => g.put("/".concat(t, "/audit-detail"), e),
123
- putAuditTAG: (t, e) => g.put("/".concat(t, "/audit"), e),
124
- putAllocateTAG: (t, e) => g.put("/".concat(t, "/allocate"), e),
125
- putCombineTAG: (t) => g.put("/combine", t)
131
+ }, c = a({
132
+ prefix: "/v2/hardware-tagging"
133
+ }), F = {
134
+ getAllTAG: (t, e) => {
135
+ const r = p(e);
136
+ return c.post("/".concat(t), r);
137
+ },
138
+ getAllTAGOptions: (t, e) => {
139
+ const r = p(e);
140
+ return c.post("/".concat(t, "/options"), r);
141
+ },
142
+ getNotPairedYetCounts: () => c.get("/not-paired-yet/tag-count"),
143
+ getNotPairedYetList: (t) => {
144
+ const e = p(t);
145
+ return c.post("/not-paired-yet/list", e);
146
+ },
147
+ getNotPairedYetOptions: (t) => {
148
+ const e = p(t);
149
+ return c.post("/not-paired-yet/options", e);
150
+ },
151
+ getAuditTAGDetail: (t) => c.post("/audit/detail", t),
152
+ submitAuditTAG: (t) => c.post("/audit/submit", t),
153
+ submitCombineTAG: (t) => c.post("/combine-tag/combine", t),
154
+ submitSeparateTAG: (t) => c.post("/combine-tag/separate", t)
126
155
  }, n = a({
127
- prefix: "/v1/global-settings"
128
- }), M = {
129
- getHandheldReader: (t) => n.get("/reader", { params: t }),
130
- getHandheldReaderDetail: (t) => n.get("/reader/".concat(t)),
131
- getHandheldReaderOptions: (t) => n.get("/reader/options", { params: t }),
132
- putMarkHandheldStatus: (t) => n.put("/reader/mark-status", t),
156
+ prefix: "/v2/hardware-tagging"
157
+ }), H = {
158
+ getHandheldReader: (t) => {
159
+ const e = p(t);
160
+ return n.post("/handheld-reader/list", e);
161
+ },
162
+ getHandheldReaderDetail: (t) => n.get("/handheld-reader/".concat(t)),
163
+ getHandheldReaderOptions: (t) => {
164
+ const e = p(t);
165
+ return n.post("/handheld-reader/options", e);
166
+ },
167
+ putMarkHandheldStatus: (t) => n.patch("/handheld-reader/status", t),
133
168
  putPingReaders: (t) => n.put("/iot-reader/ping", t),
134
169
  putMarkIOTStatus: (t, e) => n.put("/".concat(e, "/mark-status"), t),
135
- putEditReaderGroup: (t, e, r) => n.put(
136
- "/".concat(t === "iot" ? "iot-" : "", "reader/").concat(r, "/set-group"),
170
+ putEditReaderGroup: (t, e, r) => n.patch(
171
+ "/".concat(t === "iot" ? "iot-" : "handheld-", "reader/").concat(r, "/group"),
137
172
  e
138
173
  ),
139
174
  putEditAntennaGroup: (t, e) => n.put("/iot-reader/".concat(e, "/set-port-group"), t),
140
175
  putEditPortStatus: (t, e) => n.put("/iot-reader/".concat(e, "/set-port-status"), t),
141
- putEditAliasName: (t, e, r) => n.put(
142
- "/".concat(t === "iot" ? "iot-" : "", "reader/").concat(r, "/set-alias-name"),
176
+ putEditAliasName: (t, e, r) => n.patch(
177
+ "/".concat(t === "iot" ? "iot-" : "handheld-", "reader/").concat(r, "/alias-name"),
178
+ e
179
+ ),
180
+ postActivateHardware: (t, e) => n.post(
181
+ "/".concat(t === "iot" ? "iot-" : "handheld-", "reader/activate"),
143
182
  e
144
183
  ),
184
+ deleteHardware: (t, e) => n.delete("/".concat(t === "iot" ? "iot-" : "handheld-", "-reader"), {
185
+ params: e
186
+ }),
145
187
  putAntennaPower: (t, e) => n.put("/iot-reader/".concat(e, "/set-antenna-power"), t),
146
188
  getIOTReaderOrAntenna: (t, e) => n.get("/".concat(t), { params: e }),
147
189
  getIOTReaderDetail: (t) => n.get("/iot-reader/".concat(t)),
@@ -152,82 +194,182 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
152
194
  getDetailActivityLogOptions: (t) => n.get("/activity-log/options", { params: t }),
153
195
  getExistingAliasNames: () => n.get("/reader/alias-names"),
154
196
  getIotReaderPort: (t, e) => n.get("/iot-reader/".concat(t, "/ports"), { params: e })
155
- }, G = a({
197
+ }, C = a({
156
198
  env: "APP_LOGS_NOTIFICATION_API",
157
199
  prefix: "/v2"
158
- }), q = {
159
- getSessionLogList: (t) => G.get("/session-log", { params: t })
160
- }, m = a({
200
+ }), V = {
201
+ getSessionLogList: (t) => C.get("/session-log", { params: t })
202
+ }, $ = a({
161
203
  prefix: "/v1/global-settings/option"
162
- }), J = {
163
- getPositions: () => m.get("/position"),
164
- getDivisions: () => m.get("/division")
165
- }, l = a({
204
+ }), Y = {
205
+ getPositions: () => $.get("/position"),
206
+ getDivisions: () => $.get("/division")
207
+ }, v = a({
166
208
  prefix: "/v1/global-settings/position"
167
- }), V = {
168
- getPositions: (t) => l.get("", { params: t }),
169
- getPositionDetail: (t) => l.get("/".concat(t)),
170
- postCreatePosition: (t) => l.post("/", t),
171
- putEditPosition: (t, e) => l.put("/".concat(t), e),
209
+ }), z = {
210
+ getPositions: (t) => v.get("", { params: t }),
211
+ getPositionDetail: (t) => v.get("/".concat(t)),
212
+ postCreatePosition: (t) => v.post("/", t),
213
+ putEditPosition: (t, e) => v.put("/".concat(t), e),
172
214
  deletePositions: (t) => {
173
215
  const e = { id: JSON.stringify(t) };
174
- return l.delete("", { params: e });
216
+ return v.delete("", { params: e });
175
217
  }
176
- }, U = a({
218
+ }, N = a({
177
219
  env: "APP_TAGSAMURAI_API",
178
220
  prefix: "/tag/v2"
179
- }), H = {
180
- getTagInfo: (t) => U.get("/rfid-qr/scan", { params: t })
181
- }, d = a({
182
- prefix: "/v1/global-settings/change-log"
183
- }), F = {
184
- getTAGEventlog: (t) => d.get("/tag-event-log", { params: t }),
185
- getTAGEventlogOptions: (t) => d.get("/tag-event-log/options", { params: t }),
186
- getDetailTAGEventlog: (t) => d.get("/tag-event-log/".concat(t))
187
- }, o = a({
221
+ }), X = {
222
+ getTagInfo: (t) => N.get("/rfid-qr/scan", { params: t })
223
+ }, f = a({
224
+ prefix: "/v2/hardware-tagging"
225
+ }), W = {
226
+ getTAGEventlog: (t) => {
227
+ const e = p(t);
228
+ return f.post("/tag-event-log/list", e);
229
+ },
230
+ getTAGEventlogOptions: (t) => {
231
+ const e = p(t);
232
+ return f.post("/tag-event-log/options", e);
233
+ },
234
+ getDetailTAGEventlog: (t) => f.get("/tag-event-log/".concat(t))
235
+ }, u = a({
188
236
  prefix: "/v1/global-settings/user"
189
- }), z = {
190
- getUsers: (t) => o.get("", { params: t }),
191
- getUserDetail: (t) => o.get("/".concat(t)),
192
- getUserSystemLogs: (t, e) => o.get("/".concat(t, "/system-logs"), { params: e }),
237
+ }), K = {
238
+ getUsers: (t) => u.get("", { params: t }),
239
+ getUserDetail: (t) => u.get("/".concat(t)),
240
+ getUserSystemLogs: (t, e) => u.get("/".concat(t, "/system-logs"), { params: e }),
193
241
  getUserSystemLogOptions: (t, e) => {
194
242
  const r = {};
195
- return r[e] = !0, o.get("/".concat(t, "/system-logs/options"), { params: r });
243
+ return r[e] = !0, u.get("/".concat(t, "/system-logs/options"), { params: r });
196
244
  },
197
245
  postCreateUser: (t) => {
198
246
  const e = { "Content-Type": "multipart/form-data" };
199
- return o.post("", t, { headers: e });
247
+ return u.post("", t, { headers: e });
200
248
  },
201
249
  putEditUser: (t, e) => {
202
250
  const r = { "Content-Type": "multipart/form-data" };
203
- return o.put("/".concat(t), e, { headers: r });
251
+ return u.put("/".concat(t), e, { headers: r });
204
252
  },
205
253
  deleteUsers: (t) => {
206
254
  const e = { id: JSON.stringify(t) };
207
- return o.delete("", { params: e });
255
+ return u.delete("", { params: e });
208
256
  },
209
- putToggleStatusUsers: (t) => o.put("/active-status", t),
257
+ putToggleStatusUsers: (t) => u.put("/active-status", t),
210
258
  getUserOptions: (t) => {
211
259
  const e = {};
212
- return e[t] = !0, o.get("/options", { params: e });
260
+ return e[t] = !0, u.get("/options", { params: e });
261
+ },
262
+ deleteCancelEmailChange: (t) => u.delete("/cancel-email-change/".concat(t)),
263
+ postResendEmail: (t) => u.post("/resend-email", t),
264
+ putChangePassword: (t, e) => u.put("/change-password/".concat(t), e)
265
+ }, h = a({
266
+ prefix: "/v2/hardware-tagging"
267
+ }), Q = {
268
+ getTabletList: (t) => h.post("/tablet/list", t),
269
+ getTabletOption: (t) => h.post("/tablet/options", t),
270
+ updateTabletStatus: (t, e) => h.patch("/tablet/status", e, { params: { ids: t } }),
271
+ disconnectTablet: (t) => h.patch("/tablet/disconnect-reader", { params: { ids: t } }),
272
+ deleteTablet: (t) => h.delete("/tablet", { params: { ids: t } })
273
+ }, s = a({
274
+ prefix: "/v2/iam"
275
+ }), Z = {
276
+ login: (t) => s.post("/auth/login", t),
277
+ logout: () => s.post("/auth/logout"),
278
+ verifyToken: (t) => s.get("/auth/verify-token/".concat(t)),
279
+ requestOtp: (t) => s.post("/auth/request-otp", { email: t }),
280
+ requestResetLink: (t) => s.post("/auth/request-reset-link", { email: t }),
281
+ setPassword: (t) => s.post("/auth/set-password", t),
282
+ confirmEmailChange: (t) => s.post("/auth/confirm-email-change", { token: t }),
283
+ cancelEmailChange: (t) => s.delete("/auth/cancel-email-change/".concat(t)),
284
+ getPositionList: (t) => {
285
+ const e = p(t);
286
+ return s.post("/position/list", e);
287
+ },
288
+ getPositionDetail: (t) => s.get("/position/".concat(t)),
289
+ createPosition: (t) => s.post("/position", t),
290
+ editPosition: (t, e) => s.patch("/position/".concat(t), e),
291
+ deletePosition: (t) => {
292
+ const e = { ids: JSON.stringify(t) };
293
+ return s.delete("/position", { params: e });
294
+ },
295
+ getDivisionList: (t) => {
296
+ const e = p(t);
297
+ return s.post("/division/list", e);
298
+ },
299
+ getDivisionDetail: (t) => s.get("/division/".concat(t)),
300
+ createDivision: (t) => s.post("/division", t),
301
+ editDivision: (t, e) => s.patch("/division/".concat(t), e),
302
+ deleteDivision: (t) => {
303
+ const e = { ids: JSON.stringify(t) };
304
+ return s.delete("/division", { params: e });
305
+ },
306
+ createUsers: (t) => {
307
+ const e = new FormData();
308
+ return Object.entries(t).forEach(([r, o]) => {
309
+ o != null && e.append(r, o);
310
+ }), s.post("/users", e, {
311
+ headers: { "Content-Type": "multipart/form-data" }
312
+ });
313
+ },
314
+ getGlobalUserList: (t) => {
315
+ const e = p(t);
316
+ return s.post("/users/list", e);
317
+ },
318
+ getGlobalUserOptions: (t) => {
319
+ const e = p(t);
320
+ return s.post("/users/options", e);
321
+ },
322
+ getGlobalUserDetail: (t) => s.get("/users/".concat(t)),
323
+ setActiveGlobalUser: (t, e) => {
324
+ const r = { ids: JSON.stringify(t) };
325
+ return s.patch("/users/set-active", e, { params: r });
326
+ },
327
+ editUsers: (t, e) => {
328
+ const r = new FormData();
329
+ return Object.entries(e).forEach(([o, i]) => {
330
+ i != null && r.append(o, i);
331
+ }), s.patch("/users/".concat(t), r, {
332
+ headers: { "Content-Type": "multipart/form-data" }
333
+ });
334
+ },
335
+ editUsersFcmToken: (t) => s.patch("/users/fcm-token", t),
336
+ resendActivationEmail: (t) => s.post("/users/resend-activation-email", t),
337
+ changePassword: (t, e) => s.patch("/users/".concat(t, "/change-password"), e),
338
+ deleteUsers: (t) => {
339
+ const e = { ids: JSON.stringify(t) };
340
+ return s.delete("/users", { params: e });
341
+ },
342
+ logoutModule: (t) => s.post("/auth/logout/module", t),
343
+ loginModule: (t) => s.post("/auth/login/module", t),
344
+ getConcurrentUsers: (t, e) => {
345
+ const r = e ? { "X-Module-ID": e } : {};
346
+ return s.post("/concurrent-users", t, { headers: r });
347
+ },
348
+ logoutSession: (t, e) => {
349
+ const r = e ? { "X-Module-ID": e } : {};
350
+ return s.post("/auth/logout/session", t, { headers: r });
213
351
  },
214
- deleteCancelEmailChange: (t) => o.delete("/cancel-email-change/".concat(t)),
215
- postResendEmail: (t) => o.post("/resend-email", t),
216
- putChangePassword: (t, e) => o.put("/change-password/".concat(t), e)
352
+ getPositionDropdown: () => s.get("/position/dropdown"),
353
+ getDivisionDropdown: () => s.get("/division/dropdown"),
354
+ exportPositionTable: () => s.post("/position/list/export", {}, { responseType: "blob" }),
355
+ exportDivisionTable: () => s.post("/division/list/export", {}, { responseType: "blob" }),
356
+ exportUserTable: () => s.post("/users/list/export", {}, { responseType: "blob" })
217
357
  };
218
358
  export {
219
- x as AuthServices,
220
- k as ChangelogServices,
221
- B as DivisionServices,
222
- j as GlobalTagServices,
223
- M as HardwareServices,
224
- q as LogServices,
225
- J as OptionServices,
226
- V as PositionServices,
227
- F as TagEventlogServices,
228
- H as TagServices,
229
- z as UserServices,
230
- T as getBaseURL,
231
- C as getImageURL,
232
- N as queryParamsStringfy
359
+ j as AuthServices,
360
+ M as ChangelogServices,
361
+ q as DivisionServices,
362
+ F as GlobalTagServices,
363
+ H as HardwareServices,
364
+ Z as IamServices,
365
+ V as LogServices,
366
+ Y as OptionServices,
367
+ z as PositionServices,
368
+ Q as TabletServices,
369
+ W as TagEventlogServices,
370
+ X as TagServices,
371
+ K as UserServices,
372
+ I as getBaseURL,
373
+ B as getImageURL,
374
+ J as queryParamsStringfy
233
375
  };
package/main.d.ts CHANGED
@@ -9,4 +9,6 @@ export { default as PositionServices } from './src/services/position.service';
9
9
  export { default as TagServices } from './src/services/tag.service';
10
10
  export { default as TagEventlogServices } from './src/services/tagEventlog.service';
11
11
  export { default as UserServices } from './src/services/user.service';
12
+ export { default as TabletServices } from './src/services/tablet.service';
13
+ export { default as IamServices } from './src/services/iam.service';
12
14
  export { getBaseURL, getImageURL, queryParamsStringfy } from './src/utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/gsts-api-services",
3
- "version": "2.0.1-alpha.1",
3
+ "version": "2.0.1-alpha.11",
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;
@@ -71,6 +72,14 @@ export type DetailTableFilteredParams = Partial<Record<keyof DetailTableFilterPa
71
72
  export interface PutEditAliasName {
72
73
  aliasName: string;
73
74
  }
75
+ export interface PostActivateHardware {
76
+ serialNumber: string;
77
+ licenseKey: string;
78
+ hardwareId: string;
79
+ }
80
+ export interface DeleteHardware {
81
+ ids: string[];
82
+ }
74
83
  export interface PutEditReaderGroup {
75
84
  fixedAssetGroup?: string;
76
85
  supplyAssetGroup?: string;
@@ -97,3 +106,55 @@ export interface PutHardwareStatusBody {
97
106
  ids?: string[];
98
107
  }
99
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 {};
@@ -0,0 +1,80 @@
1
+ import { QueryParams } from '../types/fetchResponse.type';
2
+ import { GlobalUserOptions, ModuleAccess } from '../types/iam.type';
3
+ export interface LoginPayload {
4
+ email: string;
5
+ password: string | null;
6
+ overrideSession: boolean;
7
+ isMobile: boolean;
8
+ otp: string | null;
9
+ captcha: string;
10
+ agreePolicy: boolean;
11
+ }
12
+ export interface SetPasswordPayload {
13
+ type: 'confirm' | 'reset';
14
+ token: string;
15
+ password: string;
16
+ }
17
+ export interface BaseParams extends QueryParams {
18
+ page?: number;
19
+ limit?: number;
20
+ search?: string;
21
+ sortBy?: string;
22
+ sortOrder?: number;
23
+ column?: string[];
24
+ }
25
+ export interface GetPositionListParams extends BaseParams {
26
+ }
27
+ export interface CreateEditPositionPayload {
28
+ name: string;
29
+ }
30
+ export interface GetDivisionListParams extends BaseParams {
31
+ }
32
+ export interface CreateEditDivisionPayload {
33
+ name: string;
34
+ }
35
+ export interface CreateUserPayload {
36
+ profilePicture?: File | string;
37
+ firstName: string;
38
+ lastName: string;
39
+ positionId?: string;
40
+ divisionId: string;
41
+ employeeId?: string;
42
+ email: string;
43
+ access: string;
44
+ expiryDate?: string;
45
+ tag?: string;
46
+ }
47
+ export interface GetGlobalUserListParams extends BaseParams {
48
+ isActive?: boolean[];
49
+ position?: string[];
50
+ division?: string[];
51
+ modifiedBy?: string[];
52
+ updatedAt?: string[];
53
+ }
54
+ export type GetGlobalUserOptionsParams = Partial<Record<keyof GlobalUserOptions, boolean>>;
55
+ export interface SetActiveGlobalUserPayload {
56
+ isActive: boolean;
57
+ }
58
+ export interface EditUserPayload extends CreateUserPayload {
59
+ }
60
+ export interface EditUserFcmTokenPayload {
61
+ data: {
62
+ userId: string;
63
+ token: string;
64
+ }[];
65
+ }
66
+ export interface ResendActivationEmailPayload {
67
+ ids: string[];
68
+ }
69
+ export interface ChangePasswordPayload {
70
+ oldPassword: string;
71
+ newPassword: string;
72
+ }
73
+ export interface ModuleAuthPayload {
74
+ module: ModuleAccess;
75
+ }
76
+ export interface GetConcurrentUsersParams extends BaseParams {
77
+ }
78
+ export interface LogoutSessionPayload {
79
+ sessionId: string;
80
+ }
@@ -0,0 +1,38 @@
1
+ import { FetchDetailResponse, FetchResponse } from '../types/fetchResponse.type';
2
+ import { MultiSelectOption } from '../types/options.type';
3
+ import { Tab, Tablet } from '../types/tablet.type';
4
+ export interface GetTabletListQuery {
5
+ tab?: Tab;
6
+ page?: number;
7
+ limit?: number;
8
+ sortBy?: string;
9
+ sortOrder?: number;
10
+ search?: string;
11
+ column?: string[];
12
+ deviceName?: string[];
13
+ status?: string[];
14
+ group?: string[];
15
+ reader?: string[];
16
+ registeredAt?: number[];
17
+ reportedBy?: string[];
18
+ reportedAt?: number[];
19
+ }
20
+ export type GetTabletListResponse = FetchDetailResponse<Tablet>;
21
+ export interface GetTabletOptionsQuery {
22
+ tab?: Tab;
23
+ statusOptions?: boolean;
24
+ deviceNameOptions?: boolean;
25
+ readerOptions?: boolean;
26
+ reportedByOptions?: boolean;
27
+ }
28
+ export type GetTabletOptionsResponse = FetchResponse & {
29
+ data: {
30
+ deviceNameOptions: MultiSelectOption[];
31
+ readerOptions: MultiSelectOption[];
32
+ statusOptions: MultiSelectOption[];
33
+ reportedByOptions: MultiSelectOption[];
34
+ };
35
+ };
36
+ export interface UpdateTabletStatusBody {
37
+ status?: Tab;
38
+ }
@@ -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,22 @@
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<{
14
15
  data: TAGFetchOptionResponse;
15
16
  }>>;
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>>;
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>;
25
21
  };
26
22
  export default GlobalTagServices;
@@ -1,6 +1,6 @@
1
1
  import { AxiosResponse } from 'axios';
2
2
  import { BooleanOptions } from '../dto/dataTable.dto';
3
- import { HardwareDetailFilterQuery, HardwareFetchDetailResponse, HardwareFetchOptionResponse, HardwareFetchResponse, HardwareFilterQuery, PutEditAliasName, PutEditAntennaGroup, PutEditAntennaPower, PutEditPortStatus, PutEditReaderGroup, PutHardwareStatusBody, PutPingReadersBody } from '../dto/hardware.dto';
3
+ import { DeleteHardware, HardwareDetailFilterQuery, HardwareFetchDetailResponse, HardwareFetchOptionResponse, HardwareFetchResponse, HardwareFilterQuery, PostActivateHardware, PutEditAliasName, PutEditAntennaGroup, PutEditAntennaPower, PutEditPortStatus, PutEditReaderGroup, PutHardwareStatusBody, PutPingReadersBody } from '../dto/hardware.dto';
4
4
  import { AntennaPortDetail, HardwareDataType, HardwareDetailUserActivity } from '../types/hardware.type';
5
5
  declare const HardwareServices: {
6
6
  getHandheldReader: (params?: HardwareFilterQuery) => Promise<AxiosResponse<HardwareFetchResponse>>;
@@ -15,6 +15,8 @@ declare const HardwareServices: {
15
15
  putEditAntennaGroup: (body: PutEditAntennaGroup, hardwareId?: string) => Promise<AxiosResponse>;
16
16
  putEditPortStatus: (body: PutEditPortStatus, hardwareId?: string) => Promise<AxiosResponse>;
17
17
  putEditAliasName: (moduleTab: "iot" | "handheld", body: PutEditAliasName, hardwareId?: string) => Promise<AxiosResponse>;
18
+ postActivateHardware: (moduleTab: "iot" | "handheld", body: PostActivateHardware) => Promise<AxiosResponse>;
19
+ deleteHardware: (moduleTab: "iot" | "handheld", params?: DeleteHardware) => Promise<AxiosResponse>;
18
20
  putAntennaPower: (body: PutEditAntennaPower, iotId?: string) => Promise<AxiosResponse>;
19
21
  getIOTReaderOrAntenna: (subTab: "iot-reader" | "antenna", params?: HardwareFilterQuery) => Promise<AxiosResponse<HardwareFetchResponse>>;
20
22
  getIOTReaderDetail: (iotId?: string) => Promise<AxiosResponse<HardwareFetchDetailResponse>>;
@@ -0,0 +1,45 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { DropdownOption } from '../types/options.type';
3
+ import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.type';
4
+ import { CreateEditDivisionPayload, CreateEditPositionPayload, GetDivisionListParams, GetPositionListParams, LoginPayload, SetPasswordPayload, CreateUserPayload, GetGlobalUserListParams, GetGlobalUserOptionsParams, SetActiveGlobalUserPayload, EditUserPayload, EditUserFcmTokenPayload, ResendActivationEmailPayload, ChangePasswordPayload, ModuleAuthPayload, GetConcurrentUsersParams, LogoutSessionPayload } from '../dto/iam.dto';
5
+ import { PositionList, LoginResponse, RequestOtpResponse, RequestResetLinkResponse, DivisionList, DivisionListDetail, GlobalUserList, GlobalUserOptions, GlobalUserDetail, LoginModuleResponse, ConcurrentUserList, VerifyTokenResponse, PositionDetail, ChangePasswordResponse } from '../types/iam.type';
6
+ declare const IamServices: {
7
+ login: (payload: LoginPayload) => Promise<AxiosResponse<FetchDetailResponse<LoginResponse>>>;
8
+ logout: () => Promise<AxiosResponse>;
9
+ verifyToken: (token: string) => Promise<AxiosResponse<FetchDetailResponse<VerifyTokenResponse>>>;
10
+ requestOtp: (email: string) => Promise<AxiosResponse<RequestOtpResponse>>;
11
+ requestResetLink: (email: string) => Promise<AxiosResponse<RequestResetLinkResponse>>;
12
+ setPassword: (payload: SetPasswordPayload) => Promise<AxiosResponse>;
13
+ confirmEmailChange: (token: string) => Promise<AxiosResponse>;
14
+ cancelEmailChange: (id: string) => Promise<AxiosResponse>;
15
+ getPositionList: (params: GetPositionListParams) => Promise<AxiosResponse<FetchListResponse<PositionList>>>;
16
+ getPositionDetail: (id: string) => Promise<AxiosResponse<FetchDetailResponse<PositionDetail>>>;
17
+ createPosition: (payload: CreateEditPositionPayload) => Promise<AxiosResponse>;
18
+ editPosition: (id: string, payload: CreateEditPositionPayload) => Promise<AxiosResponse>;
19
+ deletePosition: (ids: string[]) => Promise<AxiosResponse>;
20
+ getDivisionList: (params: GetDivisionListParams) => Promise<AxiosResponse<FetchListResponse<DivisionList>>>;
21
+ getDivisionDetail: (id: string) => Promise<AxiosResponse<FetchDetailResponse<DivisionListDetail>>>;
22
+ createDivision: (payload: CreateEditDivisionPayload) => Promise<AxiosResponse>;
23
+ editDivision: (id: string, payload: CreateEditDivisionPayload) => Promise<AxiosResponse>;
24
+ deleteDivision: (ids: string[]) => Promise<AxiosResponse>;
25
+ createUsers: (payload: CreateUserPayload) => Promise<AxiosResponse>;
26
+ getGlobalUserList: (params: GetGlobalUserListParams) => Promise<AxiosResponse<FetchListResponse<GlobalUserList>>>;
27
+ getGlobalUserOptions: (params: GetGlobalUserOptionsParams) => Promise<AxiosResponse<FetchDetailResponse<GlobalUserOptions>>>;
28
+ getGlobalUserDetail: (id: string) => Promise<AxiosResponse<FetchDetailResponse<GlobalUserDetail>>>;
29
+ setActiveGlobalUser: (ids: string[], payload: SetActiveGlobalUserPayload) => Promise<AxiosResponse>;
30
+ editUsers: (id: string, payload: EditUserPayload) => Promise<AxiosResponse>;
31
+ editUsersFcmToken: (payload: EditUserFcmTokenPayload) => Promise<AxiosResponse>;
32
+ resendActivationEmail: (payload: ResendActivationEmailPayload) => Promise<AxiosResponse>;
33
+ changePassword: (id: string, payload: ChangePasswordPayload) => Promise<AxiosResponse<ChangePasswordResponse>>;
34
+ deleteUsers: (ids: string[]) => Promise<AxiosResponse>;
35
+ logoutModule: (payload: ModuleAuthPayload) => Promise<AxiosResponse>;
36
+ loginModule: (payload: ModuleAuthPayload) => Promise<AxiosResponse<FetchDetailResponse<LoginModuleResponse>>>;
37
+ getConcurrentUsers: (params: GetConcurrentUsersParams, moduleId?: string) => Promise<AxiosResponse<FetchDetailResponse<ConcurrentUserList>>>;
38
+ logoutSession: (payload: LogoutSessionPayload, moduleId?: string) => Promise<AxiosResponse>;
39
+ getPositionDropdown: () => Promise<AxiosResponse<FetchDetailResponse<DropdownOption[]>>>;
40
+ getDivisionDropdown: () => Promise<AxiosResponse<FetchDetailResponse<DropdownOption[]>>>;
41
+ exportPositionTable: () => Promise<AxiosResponse<Blob>>;
42
+ exportDivisionTable: () => Promise<AxiosResponse<Blob>>;
43
+ exportUserTable: () => Promise<AxiosResponse<Blob>>;
44
+ };
45
+ export default IamServices;
@@ -0,0 +1,10 @@
1
+ import { GetTabletListQuery, GetTabletListResponse, GetTabletOptionsQuery, GetTabletOptionsResponse, UpdateTabletStatusBody } from '../dto/tablet.dto';
2
+ import { AxiosResponse } from 'axios';
3
+ declare const TabletServices: {
4
+ getTabletList: (body: GetTabletListQuery) => Promise<AxiosResponse<GetTabletListResponse>>;
5
+ getTabletOption: (body: GetTabletOptionsQuery) => Promise<AxiosResponse<GetTabletOptionsResponse>>;
6
+ updateTabletStatus: (ids: string, body: UpdateTabletStatusBody) => Promise<AxiosResponse>;
7
+ disconnectTablet: (ids: string) => Promise<AxiosResponse>;
8
+ deleteTablet: (ids: string) => Promise<AxiosResponse>;
9
+ };
10
+ export default TabletServices;
@@ -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
+ };
@@ -0,0 +1,144 @@
1
+ import { MultiSelectOption } from './options.type';
2
+ export interface LoginResponse {
3
+ _id: string;
4
+ companyName: string;
5
+ companyCode: string;
6
+ fullName: string;
7
+ profilePicture: string;
8
+ email: string;
9
+ isDefault: boolean;
10
+ access: string[];
11
+ generalSetting: {
12
+ dateFormat: string;
13
+ timeFormat: string;
14
+ timezone: string;
15
+ currency: {
16
+ currency: string;
17
+ symbol: string;
18
+ locale: string;
19
+ label: string;
20
+ };
21
+ };
22
+ }
23
+ type BaseMessage = string & {};
24
+ export interface VerifyTokenResponse {
25
+ message: 'Token Verified!' | 'Token not found' | 'Internal server error' | BaseMessage;
26
+ data: boolean;
27
+ }
28
+ interface BaseResponse<TMessage> {
29
+ status: number;
30
+ message: TMessage;
31
+ data?: boolean;
32
+ }
33
+ export type RequestResetLinkMessage = 'EMAIL_NOT_REGISTERED' | BaseMessage;
34
+ export type RequestOtpMessage = 'Successfully requested otp' | 'EMAIL_NOT_REGISTERED' | 'INACTIVE_USER' | BaseMessage;
35
+ export interface RequestResetLinkResponse extends BaseResponse<RequestResetLinkMessage> {
36
+ }
37
+ export interface RequestOtpResponse extends BaseResponse<RequestOtpMessage> {
38
+ }
39
+ interface BasePosition {
40
+ _id: string;
41
+ name: string;
42
+ }
43
+ export interface PositionList extends BasePosition {
44
+ inUse: boolean;
45
+ }
46
+ export interface PositionDetail extends BasePosition {
47
+ }
48
+ interface BaseDivision {
49
+ _id: string;
50
+ name: string;
51
+ }
52
+ export interface DivisionList extends BaseDivision {
53
+ inUse: boolean;
54
+ }
55
+ export interface DivisionListDetail extends BaseDivision {
56
+ }
57
+ export interface ChangePasswordResponse {
58
+ status?: number;
59
+ message?: 'INCORRECT_PASSWORD' | BaseMessage;
60
+ }
61
+ export interface GlobalUserList {
62
+ _id: string;
63
+ isActive: boolean;
64
+ isDefault: boolean;
65
+ profilePicture: string | null;
66
+ fullName: string;
67
+ email: string;
68
+ pendingEmail: string | null;
69
+ position: string | null;
70
+ division: string;
71
+ employeeId: string | null;
72
+ modifiedBy: string;
73
+ updatedAt: string;
74
+ pendingApproval: number;
75
+ assignedAssets: number;
76
+ borrowedAssets: number;
77
+ isEmailConfirmed: boolean;
78
+ }
79
+ export interface GlobalUserOptions {
80
+ isActiveOptions: {
81
+ label: string;
82
+ value: boolean;
83
+ }[];
84
+ positionOptions: MultiSelectOption[];
85
+ divisionOptions: MultiSelectOption[];
86
+ modifiedByOptions: MultiSelectOption[];
87
+ }
88
+ export type ModuleAccess = 'Global Settings' | 'Fixed Asset' | 'Supply Asset' | 'Admin Console';
89
+ export interface GlobalUserDetail {
90
+ _id: string;
91
+ isActive: boolean;
92
+ isDefault: boolean;
93
+ isEmailConfirmed: boolean;
94
+ profilePicture: string | null;
95
+ userTag: string | null;
96
+ userType: string;
97
+ firstName: string;
98
+ lastName: string;
99
+ fullName: string;
100
+ email: string;
101
+ pendingEmailChange: string | null;
102
+ position: string | null;
103
+ division: string;
104
+ employeeId: string | null;
105
+ expiryDate: string | null;
106
+ access: (ModuleAccess | BaseMessage)[];
107
+ }
108
+ export interface LoginModuleResponse extends LoginResponse {
109
+ isTotalControl: boolean;
110
+ isReadOnly: boolean;
111
+ plan: string;
112
+ addOn: Record<string, boolean>;
113
+ systemRoles: Record<string, {
114
+ create: boolean;
115
+ view: boolean;
116
+ update: boolean;
117
+ delete: boolean;
118
+ }>;
119
+ transactionRoles: Record<string, {
120
+ manager: boolean;
121
+ monitoringReport: boolean;
122
+ approver: boolean;
123
+ staff: boolean;
124
+ }>;
125
+ generalSetting: LoginResponse['generalSetting'] & {
126
+ geolocation: boolean;
127
+ };
128
+ }
129
+ export interface ConcurrentUser {
130
+ _id: string;
131
+ profilePicture: string;
132
+ name: string;
133
+ email: string;
134
+ userType: string;
135
+ position: string;
136
+ division: string;
137
+ lastLogin: string;
138
+ }
139
+ export interface ConcurrentUserList {
140
+ moduleId: string;
141
+ activeSessions: ConcurrentUser[];
142
+ count: number;
143
+ }
144
+ export {};
@@ -0,0 +1,16 @@
1
+ export type Tab = 'Available' | 'Damaged/Missing';
2
+ export interface Tablet {
3
+ _id: string;
4
+ deviceName: string;
5
+ deviceId: string;
6
+ status: string;
7
+ group: {
8
+ fixedAsset: string | null;
9
+ supplyAsset: string | null;
10
+ };
11
+ reader: string | null;
12
+ aliasName: string | null;
13
+ registeredAt: string;
14
+ reportedBy: string | null;
15
+ reportedAt: string | null;
16
+ }