@tagsamurai/gsts-api-services 2.0.1-alpha.3 → 2.0.1-alpha.30

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