@tagsamurai/gsts-api-services 1.0.2 → 1.1.0-alpha.1

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
- import _ from "axios";
2
- const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_GLOBAL_SETTINGS_API: "https://api.global-settings.tagsamurai.com", VITE_APP_IMAGE_BASE_URL: "https://api.tagsamurai.com/fam/utility/v2/files", VITE_APP_LOGS_NOTIFICATION_API: "https://api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://api.tagsamurai.com" }, T = (t = "APP_TAGSAMURAI_API") => E["VITE_" + t], a = (t = {}, e = !1) => {
1
+ import L from "axios";
2
+ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.local" }, I = (t = "APP_TAGSAMURAI_API") => C["VITE_" + t], u = (t = {}, e = !1) => {
3
3
  const {
4
- env: r = "APP_GLOBAL_SETTINGS_API",
5
- prefix: s = "",
6
- headers: i = {},
7
- ...p
8
- } = t, y = "".concat(T(r)).concat(s), A = _.create({
9
- ...p,
10
- baseURL: y,
11
- headers: e ? i : {
4
+ env: r = "APP_TAGSAMURAI_API",
5
+ prefix: n = "",
6
+ headers: p = {},
7
+ ...f
8
+ } = t, U = "".concat(I(r)).concat(n), A = L.create({
9
+ ...f,
10
+ baseURL: U,
11
+ headers: e ? p : {
12
12
  "Content-Type": "application/json",
13
- ...i
13
+ ...p
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(($) => {
17
+ var P, D, w;
18
+ const S = JSON.parse((P = localStorage.getItem("user")) != null ? P : "{}"), R = (w = (D = S.jwt) != null ? D : S.token) != null ? w : "";
19
+ return $.headers.Authorization = "Bearer ".concat(R), $;
20
20
  }), A;
21
- }, u = a({
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 = {
21
+ }, d = u({
22
+ prefix: "/global-settings/v1/global-settings/auth"
23
+ }), E = (t) => {
24
+ var e, r, n, p;
25
+ return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((p = (n = t.response) == null ? void 0 : n.data) == null ? void 0 : p.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 d.post("/login", e);
30
30
  },
31
- reLogin: (t) => (u.interceptors.response.use((e) => e, b), u.post("/login", t)),
31
+ reLogin: (t) => (d.interceptors.response.use((e) => e, E), d.post("/login", t)),
32
32
  requestOTP: (t) => {
33
33
  const e = { email: t };
34
- return u.post("/request-otp", e);
34
+ return d.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 d.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) => d.post("/set-password", t),
41
+ verifyToken: (t) => d.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 d.put("/confirm-email-change/confirm", e);
45
45
  },
46
- postLogout: () => u.post("/logout"),
46
+ postLogout: () => d.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: () => d.post("/logout")
52
+ }, F = (t, e, r) => {
53
+ const n = new URL(I("APP_TAGSAMURAI_API") || "").origin;
54
+ let p = t.startsWith("http") ? t : "".concat(n, "/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 f = new URLSearchParams();
57
+ e && (f.set("width", e.toString()), f.set("height", (r == null ? void 0 : r.toString()) || e.toString())), p += "?".concat(f.toString());
58
58
  }
59
- return i;
60
- }, L = () => {
61
- var e, r, s;
59
+ return p;
60
+ }, x = () => {
61
+ var e, r, n;
62
62
  const t = JSON.parse((e = localStorage.getItem("user")) != null ? e : "{}");
63
- return (s = (r = t.jwt) != null ? r : t.token) != null ? s : "";
64
- }, R = async (t, e) => {
63
+ return (n = (r = t.jwt) != null ? r : t.token) != null ? n : "";
64
+ }, M = async (t, e) => {
65
65
  const r = await fetch(t, {
66
66
  headers: {
67
67
  Authorization: "Bearer ".concat(e)
@@ -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 n = await r.arrayBuffer();
73
+ return new Blob([n], {
74
74
  type: r.headers.get("Content-Type") || "image/webp"
75
75
  });
76
- }, w = async (t) => {
76
+ }, N = async (t) => {
77
77
  try {
78
- const e = L(), r = await R(t, e);
78
+ const e = x(), r = await M(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
+ }, j = async (t, e, r, n) => {
84
84
  if (!t) return;
85
- const i = h(t, e, r);
86
- return s ? i : w(i);
87
- }, N = (t) => {
85
+ const p = F(t, e, r);
86
+ return n ? p : N(p);
87
+ }, B = (t) => {
88
88
  if (!t || typeof t == "string")
89
89
  return;
90
90
  const e = {};
@@ -95,139 +95,400 @@ 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({
99
- 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({
104
- 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),
110
- deleteDivisions: (t) => {
111
- const e = { id: JSON.stringify(t) };
112
- return c.delete("", { params: e });
98
+ }, G = (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;
113
106
  }
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)
126
- }, 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),
133
- putPingReaders: (t) => n.put("/iot-reader/ping", t),
134
- 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"),
137
- e
138
- ),
139
- putEditAntennaGroup: (t, e) => n.put("/iot-reader/".concat(e, "/set-port-group"), t),
140
- 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"),
143
- e
144
- ),
145
- putAntennaPower: (t, e) => n.put("/iot-reader/".concat(e, "/set-antenna-power"), t),
146
- getIOTReaderOrAntenna: (t, e) => n.get("/".concat(t), { params: e }),
147
- getIOTReaderDetail: (t) => n.get("/iot-reader/".concat(t)),
148
- getIOTReaderOrAntennaOptions: (t, e) => n.get("/".concat(t, "/options"), { params: e }),
149
- getActivityLog: (t) => n.get("/activity-log", { params: t }),
150
- getActivityLogOptions: (t) => n.get("/activity-log/options", { params: t }),
151
- getDetailActivityLog: (t) => n.get("/activity-log", { params: t }),
152
- getDetailActivityLogOptions: (t) => n.get("/activity-log/options", { params: t }),
153
- getExistingAliasNames: () => n.get("/reader/alias-names"),
154
- getIotReaderPort: (t, e) => n.get("/iot-reader/".concat(t, "/ports"), { params: e })
155
- }, G = a({
156
- env: "APP_LOGS_NOTIFICATION_API",
157
- prefix: "/v2"
107
+ }, i = (t) => {
108
+ if (!t)
109
+ return {};
110
+ const e = {};
111
+ return Object.keys(t).forEach((r) => {
112
+ const n = t[r];
113
+ e[r] = G(n) ? JSON.parse(n.trim()) : n;
114
+ }), e;
115
+ }, c = u({
116
+ prefix: "/global-settings/v1/global-settings/change-log"
158
117
  }), q = {
159
- getSessionLogList: (t) => G.get("/session-log", { params: t })
160
- }, m = a({
161
- prefix: "/v1/global-settings/option"
162
- }), J = {
163
- getPositions: () => m.get("/position"),
164
- getDivisions: () => m.get("/division")
165
- }, l = a({
166
- prefix: "/v1/global-settings/position"
118
+ getChangelogs: (t) => {
119
+ const e = i(t);
120
+ return c.post("/change-log/list", e);
121
+ },
122
+ getChangelogOptions: (t) => c.post("/change-log/options", t),
123
+ getSessionList: (t) => {
124
+ const e = i(t);
125
+ return c.post("/session-log/list", e);
126
+ },
127
+ getSessionOptions: (t) => c.post("/session-log/options", t),
128
+ getHardwareChangelogs: (t) => {
129
+ const e = i(t);
130
+ return c.post("/hardware-change-log/list", e);
131
+ },
132
+ getHardwareOptions: (t) => c.post("/hardware-change-log/options", t),
133
+ getTaggingList: (t) => {
134
+ const e = i(t);
135
+ return c.post("/reader-tagging-log/list", e);
136
+ },
137
+ getTaggingOptions: (t) => c.post("/reader-tagging-log/options", t),
138
+ getUserTagList: (t) => {
139
+ const e = i(t);
140
+ return c.post("/reader-user-tag-log/list", e);
141
+ },
142
+ getUserTagOptions: (t) => c.post("/reader-user-tag-log/options", t)
143
+ }, b = u({
144
+ prefix: "/global-settings/v1/global-settings/division"
167
145
  }), 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),
172
- deletePositions: (t) => {
146
+ getDivisions: (t) => b.get("", { params: t }),
147
+ getDivisionDetail: (t) => b.get("/".concat(t)),
148
+ postCreateDivision: (t) => b.post("/", t),
149
+ putEditDivision: (t, e) => b.put("/".concat(t), e),
150
+ deleteDivisions: (t) => {
173
151
  const e = { id: JSON.stringify(t) };
174
- return l.delete("", { params: e });
152
+ return b.delete("", { params: e });
175
153
  }
176
- }, U = a({
177
- env: "APP_TAGSAMURAI_API",
178
- 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({
188
- prefix: "/v1/global-settings/user"
154
+ }, g = u({
155
+ prefix: "/global-settings/v1/global-settings"
156
+ }), Y = {
157
+ getAllTAG: (t) => {
158
+ const e = i(t);
159
+ return g.post("/all-tag/list", e);
160
+ },
161
+ getAllTAGOptions: (t) => {
162
+ const e = i(t);
163
+ return g.post("all-tag/options", e);
164
+ },
165
+ getNotPairedYetCounts: () => g.get("/not-paired-yet/tag-count"),
166
+ getNotPairedYetList: (t) => {
167
+ const e = i(t);
168
+ return g.post("/not-paired-yet/list", e);
169
+ },
170
+ getNotPairedYetOptions: (t) => {
171
+ const e = i(t);
172
+ return g.post("/not-paired-yet/options", e);
173
+ },
174
+ getAuditTAGDetail: (t) => g.post("/audit/detail", t),
175
+ submitAuditTAG: (t) => g.post("/audit/submit", t),
176
+ submitCombineTAG: (t) => g.post("/combine-tag/combine", t),
177
+ submitSeparateTAG: (t) => g.post("/combine-tag/separate", t),
178
+ getPairedList: (t) => {
179
+ const e = i(t);
180
+ return g.post("/paired/list", e);
181
+ },
182
+ getPairedOptions: (t) => {
183
+ const e = i(t);
184
+ return g.post("/paired/options", e);
185
+ },
186
+ getScanTag: (t) => g.get("/scan-tag", { params: { tag: t } })
187
+ }, o = u({
188
+ prefix: "/global-settings/v1/global-settings"
189
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 }),
190
+ getHandheldReader: (t) => {
191
+ const e = i(t);
192
+ return o.post("/handheld-reader/list", e);
193
+ },
194
+ getHandheldReaderDetail: (t) => o.get("/handheld-reader/".concat(t)),
195
+ getHandheldReaderOptions: (t) => o.post("/handheld-reader/options", t),
196
+ putMarkHandheldStatus: (t, e, r) => o.patch("/".concat(t, "/status"), r, { params: e }),
197
+ postPingReaders: (t) => o.post("/iot-reader/ping", t),
198
+ putMarkIOTStatus: (t, e) => o.put("/".concat(e, "/mark-status"), t),
199
+ putEditReaderGroup: (t, e, r) => o.patch("/".concat(t, "-reader/").concat(r, "/group"), e),
200
+ putEditAntennaGroup: (t, e) => o.put("/iot-reader/".concat(e, "/set-port-group"), t),
201
+ putEditPortStatus: (t, e) => o.put("/iot-reader/".concat(e, "/set-port-status"), t),
202
+ putEditAliasName: (t, e, r) => o.patch("/".concat(t, "-reader/").concat(r, "/alias-name"), e),
203
+ postActivateHardware: (t, e) => o.post("/".concat(t, "-reader/activate"), e),
204
+ deleteHardware: (t, e) => o.delete("/".concat(t, "-reader"), {
205
+ params: e
206
+ }),
207
+ putAntennaPower: (t, e) => o.put("/iot-reader/".concat(e, "/set-antenna-power"), t),
208
+ getIotReader: (t) => {
209
+ const e = i({ ...t });
210
+ return o.post("/iot-reader", e);
211
+ },
212
+ getIotReaderDetail: (t) => o.get("/iot-reader/".concat(t)),
213
+ getIotReaderOptions: (t) => o.post("/iot-reader/options", t),
214
+ getIotReaderPort: (t, e) => o.post("/iot-reader/".concat(t, "/port/list"), { params: e }),
215
+ getIotReaderTablet: (t, e) => o.post("/iot-reader/".concat(t, "/tablet/list"), { params: e }),
216
+ getIotReaderTabletOptions: (t, e) => o.post("/iot-reader/".concat(t, "/tablet/options"), e),
217
+ putEditIotReader: (t, e) => o.patch("/iot-reader/".concat(t), e),
218
+ disconnectIotTablet: (t, e) => o.delete("/iot-reader/".concat(t, "/tablet"), {
219
+ data: e
220
+ }),
221
+ // TODO: Activity API spec not finished yet
222
+ getActivityLog: (t) => o.get("/activity-log", { params: t }),
223
+ getActivityLogOptions: (t) => o.get("/activity-log/options", { params: t }),
224
+ getDetailActivityLog: (t) => o.get("/activity-log", { params: t }),
225
+ getDetailActivityLogOptions: (t) => o.get("/activity-log/options", { params: t }),
226
+ getExistingAliasNames: () => o.get("/reader/alias-names")
227
+ }, k = u({
228
+ prefix: "/fam/utility/v2"
229
+ }), X = {
230
+ getSessionLogList: (t) => k.get("/session-log", { params: t })
231
+ }, T = u({
232
+ prefix: "/global-settings/v1/global-settings/option"
233
+ }), W = {
234
+ getPositions: () => T.get("/position"),
235
+ getDivisions: () => T.get("/division")
236
+ }, v = u({
237
+ prefix: "/global-settings/v1/global-settings/position"
238
+ }), K = {
239
+ getPositions: (t) => v.get("", { params: t }),
240
+ getPositionDetail: (t) => v.get("/".concat(t)),
241
+ postCreatePosition: (t) => v.post("/", t),
242
+ putEditPosition: (t, e) => v.put("/".concat(t), e),
243
+ deletePositions: (t) => {
244
+ const e = { id: JSON.stringify(t) };
245
+ return v.delete("", { params: e });
246
+ }
247
+ }, _ = u({
248
+ prefix: "/fam/tag/v2"
249
+ }), Q = {
250
+ getTagInfo: (t) => _.get("/rfid-qr/scan", { params: t })
251
+ }, y = u({
252
+ prefix: "/global-settings/v1/global-settings/change-log"
253
+ }), Z = {
254
+ getTAGEventlog: (t) => {
255
+ const e = i(t);
256
+ return y.post("/tag-event-log/list", e);
257
+ },
258
+ getTAGEventlogOptions: (t) => {
259
+ const e = i(t);
260
+ return y.post("/tag-event-log/options", e);
261
+ },
262
+ getDetailTAGEventlog: (t) => y.get("/tag-event-log/".concat(t))
263
+ }, l = u({
264
+ prefix: "/global-settings/v1/global-settings/user"
265
+ }), tt = {
266
+ getUsers: (t) => l.get("", { params: t }),
267
+ getUserDetail: (t) => l.get("/".concat(t)),
268
+ getUserSystemLogs: (t, e) => l.get("/".concat(t, "/system-logs"), { params: e }),
193
269
  getUserSystemLogOptions: (t, e) => {
194
270
  const r = {};
195
- return r[e] = !0, o.get("/".concat(t, "/system-logs/options"), { params: r });
271
+ return r[e] = !0, l.get("/".concat(t, "/system-logs/options"), { params: r });
196
272
  },
197
273
  postCreateUser: (t) => {
198
274
  const e = { "Content-Type": "multipart/form-data" };
199
- return o.post("", t, { headers: e });
275
+ return l.post("", t, { headers: e });
200
276
  },
201
277
  putEditUser: (t, e) => {
202
278
  const r = { "Content-Type": "multipart/form-data" };
203
- return o.put("/".concat(t), e, { headers: r });
279
+ return l.put("/".concat(t), e, { headers: r });
204
280
  },
205
281
  deleteUsers: (t) => {
206
282
  const e = { id: JSON.stringify(t) };
207
- return o.delete("", { params: e });
283
+ return l.delete("", { params: e });
208
284
  },
209
- putToggleStatusUsers: (t) => o.put("/active-status", t),
285
+ putToggleStatusUsers: (t) => l.put("/active-status", t),
210
286
  getUserOptions: (t) => {
211
287
  const e = {};
212
- return e[t] = !0, o.get("/options", { params: e });
288
+ return e[t] = !0, l.get("/options", { params: e });
289
+ },
290
+ deleteCancelEmailChange: (t) => l.delete("/cancel-email-change/".concat(t)),
291
+ postResendEmail: (t) => l.post("/resend-email", t),
292
+ putChangePassword: (t, e) => l.put("/change-password/".concat(t), e)
293
+ }, h = u({
294
+ prefix: "/v2/hardware-tagging"
295
+ }), et = {
296
+ getTabletList: (t) => h.post("/tablet/list", t),
297
+ getTabletOption: (t) => h.post("/tablet/options", t),
298
+ updateTabletStatus: (t, e) => h.patch("/tablet/status", e, { params: { ids: t } }),
299
+ disconnectTablet: (t) => h.patch("/tablet/disconnect-reader", { params: { ids: t } }),
300
+ deleteTablet: (t) => h.delete("/tablet", { params: { ids: t } })
301
+ }, s = u({
302
+ prefix: "/v2/iam"
303
+ }), rt = {
304
+ login: (t) => s.post("/auth/login", t),
305
+ logout: () => s.post("/auth/logout"),
306
+ verifyToken: (t) => s.get("/auth/verify-token/".concat(t)),
307
+ requestOtp: (t) => s.post("/auth/request-otp", { email: t }),
308
+ requestResetLink: (t) => s.post("/auth/request-reset-link", { email: t }),
309
+ setPassword: (t) => s.post("/auth/set-password", t),
310
+ confirmEmailChange: (t) => s.post("/auth/confirm-email-change", { token: t }),
311
+ cancelEmailChange: (t) => s.delete("/auth/cancel-email-change/".concat(t)),
312
+ getPositionList: (t) => {
313
+ const e = i(t);
314
+ return s.post("/position/list", e);
315
+ },
316
+ getPositionDetail: (t) => s.get("/position/".concat(t)),
317
+ createPosition: (t) => s.post("/position", t),
318
+ editPosition: (t, e) => s.patch("/position/".concat(t), e),
319
+ deletePosition: (t) => {
320
+ const e = { ids: JSON.stringify(t) };
321
+ return s.delete("/position", { params: e });
322
+ },
323
+ getDivisionList: (t) => {
324
+ const e = i(t);
325
+ return s.post("/division/list", e);
326
+ },
327
+ getDivisionDetail: (t) => s.get("/division/".concat(t)),
328
+ createDivision: (t) => s.post("/division", t),
329
+ editDivision: (t, e) => s.patch("/division/".concat(t), e),
330
+ deleteDivision: (t) => {
331
+ const e = { ids: JSON.stringify(t) };
332
+ return s.delete("/division", { params: e });
333
+ },
334
+ createUsers: (t) => {
335
+ const e = new FormData();
336
+ return Object.entries(t).forEach(([r, n]) => {
337
+ n != null && e.append(r, n);
338
+ }), s.post("/users", e, {
339
+ headers: { "Content-Type": "multipart/form-data" }
340
+ });
341
+ },
342
+ getGlobalUserList: (t) => {
343
+ const e = i(t);
344
+ return s.post("/users/list", e);
345
+ },
346
+ getGlobalUserOptions: (t) => {
347
+ const e = i(t);
348
+ return s.post("/users/options", e);
349
+ },
350
+ getGlobalUserDetail: (t) => s.get("/users/".concat(t)),
351
+ setActiveGlobalUser: (t, e) => {
352
+ const r = { ids: JSON.stringify(t) };
353
+ return s.patch("/users/set-active", e, { params: r });
354
+ },
355
+ editUsers: (t, e) => {
356
+ const r = new FormData();
357
+ return Object.entries(e).forEach(([n, p]) => {
358
+ p != null && r.append(n, p);
359
+ }), s.patch("/users/".concat(t), r, {
360
+ headers: { "Content-Type": "multipart/form-data" }
361
+ });
362
+ },
363
+ editUsersFcmToken: (t) => s.patch("/users/fcm-token", t),
364
+ resendActivationEmail: (t) => s.post("/users/resend-activation-email", t),
365
+ changePassword: (t, e) => s.patch("/users/".concat(t, "/change-password"), e),
366
+ deleteUsers: (t) => {
367
+ const e = { ids: JSON.stringify(t) };
368
+ return s.delete("/users", { params: e });
369
+ },
370
+ logoutModule: (t) => s.post("/auth/logout/module", t),
371
+ loginModule: (t) => s.post("/auth/login/module", t),
372
+ getConcurrentUsers: (t, e) => {
373
+ const r = e ? { "X-Module-ID": e } : {};
374
+ return s.post("/concurrent-users", t, { headers: r });
375
+ },
376
+ logoutSession: (t, e) => {
377
+ const r = e ? { "X-Module-ID": e } : {};
378
+ return s.post("/auth/logout/session", t, { headers: r });
379
+ },
380
+ getPositionDropdown: () => s.get("/position/dropdown"),
381
+ getDivisionDropdown: () => s.get("/division/dropdown"),
382
+ exportPositionTable: () => s.post("/position/list/export", {}, { responseType: "blob" }),
383
+ exportDivisionTable: () => s.post("/division/list/export", {}, { responseType: "blob" }),
384
+ exportUserTable: () => s.post("/users/list/export", {}, { responseType: "blob" }),
385
+ getCustomFieldList: (t) => {
386
+ const e = i(t);
387
+ return s.post("/custom-fields/list", e);
388
+ },
389
+ getCustomFieldOptions: (t) => s.post("/custom-fields/options", t),
390
+ createCustomField: (t) => s.post("/custom-fields", t),
391
+ editCustomField: (t, e) => s.patch("/custom-fields/".concat(t), e),
392
+ setActiveCustomField: (t, e) => {
393
+ const r = { ids: JSON.stringify(t) };
394
+ return s.patch("/custom-fields/set-active", e, { params: r });
395
+ },
396
+ deleteCustomField: (t) => {
397
+ const e = { ids: JSON.stringify(t) };
398
+ return s.delete("/custom-fields", { params: e });
399
+ },
400
+ getActiveCustomField: () => s.get("/custom-fields/active"),
401
+ getAvailableCustomField: (t) => {
402
+ const e = { name: t };
403
+ return s.get("/custom-fields", { params: e });
404
+ }
405
+ }, a = u({
406
+ prefix: "/v2/import"
407
+ }), st = {
408
+ // --- Division ---
409
+ submitDivisionFile: (t) => {
410
+ const e = new FormData();
411
+ return e.append("data", t.data), t.isFirstRowHeading !== void 0 && e.append("isFirstRowHeading", String(t.isFirstRowHeading)), t.columnMapping && e.append("columnMapping", t.columnMapping), a.post("/division/file", e, {
412
+ headers: { "Content-Type": "multipart/form-data" }
413
+ });
414
+ },
415
+ getDivisionList: (t) => a.post("/division/list", t),
416
+ editDivisionData: (t) => a.put("/division", t),
417
+ duplicateDivisionData: (t) => a.post("/division/".concat(t, "/duplicate")),
418
+ submitDivisionData: (t) => a.post("/division", t),
419
+ deleteDivisionData: (t) => {
420
+ const e = { ids: JSON.stringify(t.ids) };
421
+ return a.delete("/division", { params: e });
422
+ },
423
+ // --- Position ---
424
+ submitPositionFile: (t) => {
425
+ const e = new FormData();
426
+ return e.append("data", t.data), t.isFirstRowHeading !== void 0 && e.append("isFirstRowHeading", String(t.isFirstRowHeading)), t.columnMapping && e.append("columnMapping", t.columnMapping), a.post("/position/file", e, {
427
+ headers: { "Content-Type": "multipart/form-data" }
428
+ });
429
+ },
430
+ getPositionList: (t) => a.post("/position/list", t),
431
+ editPositionData: (t) => a.put("/position", t),
432
+ duplicatePositionData: (t) => a.post("/position/".concat(t, "/duplicate")),
433
+ submitPositionData: (t) => a.post("/position", t),
434
+ deletePositionData: (t) => {
435
+ const e = { ids: JSON.stringify(t.ids) };
436
+ return a.delete("/position", { params: e });
437
+ },
438
+ // --- User ---
439
+ submitUserFile: (t) => {
440
+ const e = new FormData();
441
+ return e.append("data", t.data), t.isFirstRowHeading !== void 0 && e.append("isFirstRowHeading", String(t.isFirstRowHeading)), t.columnMapping && e.append("columnMapping", t.columnMapping), a.post("/user/file", e, {
442
+ headers: { "Content-Type": "multipart/form-data" }
443
+ });
444
+ },
445
+ getUserList: (t) => a.post("/user/list", t),
446
+ editUserData: (t) => a.put("/user", t),
447
+ duplicateUserData: (t) => a.post("/user/".concat(t, "/duplicate")),
448
+ submitUserData: (t) => a.post("/user", t),
449
+ deleteUserData: (t) => {
450
+ const e = { ids: JSON.stringify(t.ids) };
451
+ return a.delete("/user", { params: e });
452
+ }
453
+ }, O = u({
454
+ prefix: "/v2/general-settings"
455
+ }), ot = {
456
+ get: () => O.get("/"),
457
+ update: (t) => O.put("/", t)
458
+ }, m = u({
459
+ prefix: "/utility/v2/file-manager"
460
+ }), nt = {
461
+ getStorageInformation: () => m.get("/files/storage"),
462
+ postFileManager: (t, e) => {
463
+ const r = i(e);
464
+ return m.post("/".concat(t, "/list"), r);
465
+ },
466
+ postFileManagerOption: (t, e) => {
467
+ const r = i(e);
468
+ return m.post("/".concat(t, "/options"), r);
213
469
  },
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)
470
+ recoverFiles: (t, e) => m.put("/".concat(t, "/recover"), e),
471
+ deleteFiles: (t, e) => m.delete("/".concat(t), { params: e }),
472
+ deletePermanently: (t, e) => m.delete("/".concat(t, "/delete-permanent"), { params: e })
217
473
  };
218
474
  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
475
+ J as AuthServices,
476
+ q as ChangelogServices,
477
+ V as DivisionServices,
478
+ nt as FileManagerServices,
479
+ ot as GeneralSettingServices,
480
+ Y as GlobalTagServices,
481
+ z as HardwareServices,
482
+ rt as IamServices,
483
+ st as ImportServices,
484
+ X as LogServices,
485
+ W as OptionServices,
486
+ K as PositionServices,
487
+ et as TabletServices,
488
+ Z as TagEventlogServices,
489
+ Q as TagServices,
490
+ tt as UserServices,
491
+ I as getBaseURL,
492
+ j as getImageURL,
493
+ B as queryParamsStringfy
233
494
  };