@tagsamurai/gsts-api-services 2.0.1-alpha.11 → 2.0.1-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api-services.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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" },
|
|
2
|
+
const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_GLOBAL_SETTINGS_API: "https://dev-api.global-settings.tagsamurai.com", VITE_APP_IMAGE_BASE_URL: "https://dev-api.tagsamurai.com/fam/utility/v2/files", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, O = (t = "APP_TAGSAMURAI_API") => D["VITE_" + t], u = (t = {}, e = !1) => {
|
|
3
3
|
const {
|
|
4
4
|
env: r = "APP_GLOBAL_SETTINGS_API",
|
|
5
5
|
prefix: o = "",
|
|
6
6
|
headers: i = {},
|
|
7
7
|
...l
|
|
8
|
-
} = t,
|
|
8
|
+
} = t, I = "".concat(O(r)).concat(o), A = E.create({
|
|
9
9
|
...l,
|
|
10
|
-
baseURL:
|
|
10
|
+
baseURL: I,
|
|
11
11
|
headers: e ? i : {
|
|
12
12
|
"Content-Type": "application/json",
|
|
13
13
|
...i
|
|
@@ -18,46 +18,46 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
18
18
|
const b = JSON.parse((P = localStorage.getItem("user")) != null ? P : "{}"), w = (S = (y = b.jwt) != null ? y : b.token) != null ? S : "";
|
|
19
19
|
return m.headers.Authorization = "Bearer ".concat(w), m;
|
|
20
20
|
}), A;
|
|
21
|
-
},
|
|
21
|
+
}, c = u({
|
|
22
22
|
prefix: "/v1/global-settings/auth"
|
|
23
|
-
}),
|
|
23
|
+
}), L = (t) => {
|
|
24
24
|
var e, r, o, i;
|
|
25
25
|
return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((i = (o = t.response) == null ? void 0 : o.data) == null ? void 0 : i.message) === "jwt malformed" ? (window.onblur = null, window.onfocus = null, window.sessionExpired = !0, window.dispatchEvent(new CustomEvent("user:expired"))) : Promise.reject(t);
|
|
26
26
|
}, j = {
|
|
27
27
|
login: (t) => {
|
|
28
28
|
const e = { ...t, isMobile: !1 };
|
|
29
|
-
return
|
|
29
|
+
return c.post("/login", e);
|
|
30
30
|
},
|
|
31
|
-
reLogin: (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
|
|
34
|
+
return c.post("/request-otp", e);
|
|
35
35
|
},
|
|
36
36
|
requestResetPassLink: (t) => {
|
|
37
37
|
const e = { email: t };
|
|
38
|
-
return
|
|
38
|
+
return c.post("/request-reset-link", e);
|
|
39
39
|
},
|
|
40
|
-
setPassword: (t) =>
|
|
41
|
-
verifyToken: (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
|
|
44
|
+
return c.put("/confirm-email-change/confirm", e);
|
|
45
45
|
},
|
|
46
|
-
postLogout: () =>
|
|
46
|
+
postLogout: () => c.post("/logout"),
|
|
47
47
|
/**
|
|
48
48
|
*
|
|
49
49
|
* @deprecated use postLogout instead
|
|
50
50
|
*/
|
|
51
|
-
logout: () =>
|
|
52
|
-
},
|
|
53
|
-
const o = new URL(
|
|
51
|
+
logout: () => c.post("/logout")
|
|
52
|
+
}, U = (t, e, r) => {
|
|
53
|
+
const o = new URL(O("APP_TAGSAMURAI_API") || "").origin;
|
|
54
54
|
let i = t.startsWith("http") ? t : "".concat(o, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
|
|
55
55
|
if (e || r) {
|
|
56
56
|
const l = new URLSearchParams();
|
|
57
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
|
+
}, _ = () => {
|
|
61
61
|
var e, r, o;
|
|
62
62
|
const t = JSON.parse((e = localStorage.getItem("user")) != null ? e : "{}");
|
|
63
63
|
return (o = (r = t.jwt) != null ? r : t.token) != null ? o : "";
|
|
@@ -75,14 +75,14 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
75
75
|
});
|
|
76
76
|
}, G = async (t) => {
|
|
77
77
|
try {
|
|
78
|
-
const e =
|
|
78
|
+
const e = _(), r = await R(t, e);
|
|
79
79
|
return URL.createObjectURL(r);
|
|
80
80
|
} catch (e) {
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
}, B = async (t, e, r, o) => {
|
|
84
84
|
if (!t) return;
|
|
85
|
-
const i =
|
|
85
|
+
const i = U(t, e, r);
|
|
86
86
|
return o ? i : G(i);
|
|
87
87
|
}, J = (t) => {
|
|
88
88
|
if (!t || typeof t == "string")
|
|
@@ -104,7 +104,7 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
104
104
|
} catch (r) {
|
|
105
105
|
return !1;
|
|
106
106
|
}
|
|
107
|
-
},
|
|
107
|
+
}, a = (t) => {
|
|
108
108
|
if (!t)
|
|
109
109
|
return {};
|
|
110
110
|
const e = {};
|
|
@@ -112,12 +112,12 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
112
112
|
const o = t[r];
|
|
113
113
|
e[r] = x(o) ? JSON.parse(o.trim()) : o;
|
|
114
114
|
}), e;
|
|
115
|
-
}, T =
|
|
115
|
+
}, T = u({
|
|
116
116
|
prefix: "/v1/global-settings/change-log"
|
|
117
117
|
}), M = {
|
|
118
118
|
getChangelogs: (t) => T.get("", { params: t }),
|
|
119
119
|
getChangelogOptions: (t) => T.get("/options", { params: t })
|
|
120
|
-
}, d =
|
|
120
|
+
}, d = u({
|
|
121
121
|
prefix: "/v1/global-settings/division"
|
|
122
122
|
}), q = {
|
|
123
123
|
getDivisions: (t) => d.get("", { params: t }),
|
|
@@ -128,40 +128,48 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
128
128
|
const e = { id: JSON.stringify(t) };
|
|
129
129
|
return d.delete("", { params: e });
|
|
130
130
|
}
|
|
131
|
-
},
|
|
131
|
+
}, g = u({
|
|
132
132
|
prefix: "/v2/hardware-tagging"
|
|
133
133
|
}), F = {
|
|
134
134
|
getAllTAG: (t, e) => {
|
|
135
|
-
const r =
|
|
136
|
-
return
|
|
135
|
+
const r = a(e);
|
|
136
|
+
return g.post("/".concat(t), r);
|
|
137
137
|
},
|
|
138
138
|
getAllTAGOptions: (t, e) => {
|
|
139
|
-
const r =
|
|
140
|
-
return
|
|
139
|
+
const r = a(e);
|
|
140
|
+
return g.post("/".concat(t, "/options"), r);
|
|
141
141
|
},
|
|
142
|
-
getNotPairedYetCounts: () =>
|
|
142
|
+
getNotPairedYetCounts: () => g.get("/not-paired-yet/tag-count"),
|
|
143
143
|
getNotPairedYetList: (t) => {
|
|
144
|
-
const e =
|
|
145
|
-
return
|
|
144
|
+
const e = a(t);
|
|
145
|
+
return g.post("/not-paired-yet/list", e);
|
|
146
146
|
},
|
|
147
147
|
getNotPairedYetOptions: (t) => {
|
|
148
|
-
const e =
|
|
149
|
-
return
|
|
148
|
+
const e = a(t);
|
|
149
|
+
return g.post("/not-paired-yet/options", e);
|
|
150
150
|
},
|
|
151
|
-
getAuditTAGDetail: (t) =>
|
|
152
|
-
submitAuditTAG: (t) =>
|
|
153
|
-
submitCombineTAG: (t) =>
|
|
154
|
-
submitSeparateTAG: (t) =>
|
|
155
|
-
|
|
151
|
+
getAuditTAGDetail: (t) => g.post("/audit/detail", t),
|
|
152
|
+
submitAuditTAG: (t) => g.post("/audit/submit", t),
|
|
153
|
+
submitCombineTAG: (t) => g.post("/combine-tag/combine", t),
|
|
154
|
+
submitSeparateTAG: (t) => g.post("/combine-tag/separate", t),
|
|
155
|
+
getPairedList: (t) => {
|
|
156
|
+
const e = a(t);
|
|
157
|
+
return g.post("/paired/list", e);
|
|
158
|
+
},
|
|
159
|
+
getPairedOptions: (t) => {
|
|
160
|
+
const e = a(t);
|
|
161
|
+
return g.post("/paired/options", e);
|
|
162
|
+
}
|
|
163
|
+
}, n = u({
|
|
156
164
|
prefix: "/v2/hardware-tagging"
|
|
157
165
|
}), H = {
|
|
158
166
|
getHandheldReader: (t) => {
|
|
159
|
-
const e =
|
|
167
|
+
const e = a(t);
|
|
160
168
|
return n.post("/handheld-reader/list", e);
|
|
161
169
|
},
|
|
162
170
|
getHandheldReaderDetail: (t) => n.get("/handheld-reader/".concat(t)),
|
|
163
171
|
getHandheldReaderOptions: (t) => {
|
|
164
|
-
const e =
|
|
172
|
+
const e = a(t);
|
|
165
173
|
return n.post("/handheld-reader/options", e);
|
|
166
174
|
},
|
|
167
175
|
putMarkHandheldStatus: (t) => n.patch("/handheld-reader/status", t),
|
|
@@ -194,17 +202,17 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
194
202
|
getDetailActivityLogOptions: (t) => n.get("/activity-log/options", { params: t }),
|
|
195
203
|
getExistingAliasNames: () => n.get("/reader/alias-names"),
|
|
196
204
|
getIotReaderPort: (t, e) => n.get("/iot-reader/".concat(t, "/ports"), { params: e })
|
|
197
|
-
}, C =
|
|
205
|
+
}, C = u({
|
|
198
206
|
env: "APP_LOGS_NOTIFICATION_API",
|
|
199
207
|
prefix: "/v2"
|
|
200
208
|
}), V = {
|
|
201
209
|
getSessionLogList: (t) => C.get("/session-log", { params: t })
|
|
202
|
-
}, $ =
|
|
210
|
+
}, $ = u({
|
|
203
211
|
prefix: "/v1/global-settings/option"
|
|
204
212
|
}), Y = {
|
|
205
213
|
getPositions: () => $.get("/position"),
|
|
206
214
|
getDivisions: () => $.get("/division")
|
|
207
|
-
}, v =
|
|
215
|
+
}, v = u({
|
|
208
216
|
prefix: "/v1/global-settings/position"
|
|
209
217
|
}), z = {
|
|
210
218
|
getPositions: (t) => v.get("", { params: t }),
|
|
@@ -215,54 +223,54 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
215
223
|
const e = { id: JSON.stringify(t) };
|
|
216
224
|
return v.delete("", { params: e });
|
|
217
225
|
}
|
|
218
|
-
}, N =
|
|
226
|
+
}, N = u({
|
|
219
227
|
env: "APP_TAGSAMURAI_API",
|
|
220
228
|
prefix: "/tag/v2"
|
|
221
229
|
}), X = {
|
|
222
230
|
getTagInfo: (t) => N.get("/rfid-qr/scan", { params: t })
|
|
223
|
-
}, f =
|
|
231
|
+
}, f = u({
|
|
224
232
|
prefix: "/v2/hardware-tagging"
|
|
225
233
|
}), W = {
|
|
226
234
|
getTAGEventlog: (t) => {
|
|
227
|
-
const e =
|
|
235
|
+
const e = a(t);
|
|
228
236
|
return f.post("/tag-event-log/list", e);
|
|
229
237
|
},
|
|
230
238
|
getTAGEventlogOptions: (t) => {
|
|
231
|
-
const e =
|
|
239
|
+
const e = a(t);
|
|
232
240
|
return f.post("/tag-event-log/options", e);
|
|
233
241
|
},
|
|
234
242
|
getDetailTAGEventlog: (t) => f.get("/tag-event-log/".concat(t))
|
|
235
|
-
},
|
|
243
|
+
}, p = u({
|
|
236
244
|
prefix: "/v1/global-settings/user"
|
|
237
245
|
}), K = {
|
|
238
|
-
getUsers: (t) =>
|
|
239
|
-
getUserDetail: (t) =>
|
|
240
|
-
getUserSystemLogs: (t, e) =>
|
|
246
|
+
getUsers: (t) => p.get("", { params: t }),
|
|
247
|
+
getUserDetail: (t) => p.get("/".concat(t)),
|
|
248
|
+
getUserSystemLogs: (t, e) => p.get("/".concat(t, "/system-logs"), { params: e }),
|
|
241
249
|
getUserSystemLogOptions: (t, e) => {
|
|
242
250
|
const r = {};
|
|
243
|
-
return r[e] = !0,
|
|
251
|
+
return r[e] = !0, p.get("/".concat(t, "/system-logs/options"), { params: r });
|
|
244
252
|
},
|
|
245
253
|
postCreateUser: (t) => {
|
|
246
254
|
const e = { "Content-Type": "multipart/form-data" };
|
|
247
|
-
return
|
|
255
|
+
return p.post("", t, { headers: e });
|
|
248
256
|
},
|
|
249
257
|
putEditUser: (t, e) => {
|
|
250
258
|
const r = { "Content-Type": "multipart/form-data" };
|
|
251
|
-
return
|
|
259
|
+
return p.put("/".concat(t), e, { headers: r });
|
|
252
260
|
},
|
|
253
261
|
deleteUsers: (t) => {
|
|
254
262
|
const e = { id: JSON.stringify(t) };
|
|
255
|
-
return
|
|
263
|
+
return p.delete("", { params: e });
|
|
256
264
|
},
|
|
257
|
-
putToggleStatusUsers: (t) =>
|
|
265
|
+
putToggleStatusUsers: (t) => p.put("/active-status", t),
|
|
258
266
|
getUserOptions: (t) => {
|
|
259
267
|
const e = {};
|
|
260
|
-
return e[t] = !0,
|
|
268
|
+
return e[t] = !0, p.get("/options", { params: e });
|
|
261
269
|
},
|
|
262
|
-
deleteCancelEmailChange: (t) =>
|
|
263
|
-
postResendEmail: (t) =>
|
|
264
|
-
putChangePassword: (t, e) =>
|
|
265
|
-
}, h =
|
|
270
|
+
deleteCancelEmailChange: (t) => p.delete("/cancel-email-change/".concat(t)),
|
|
271
|
+
postResendEmail: (t) => p.post("/resend-email", t),
|
|
272
|
+
putChangePassword: (t, e) => p.put("/change-password/".concat(t), e)
|
|
273
|
+
}, h = u({
|
|
266
274
|
prefix: "/v2/hardware-tagging"
|
|
267
275
|
}), Q = {
|
|
268
276
|
getTabletList: (t) => h.post("/tablet/list", t),
|
|
@@ -270,7 +278,7 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
270
278
|
updateTabletStatus: (t, e) => h.patch("/tablet/status", e, { params: { ids: t } }),
|
|
271
279
|
disconnectTablet: (t) => h.patch("/tablet/disconnect-reader", { params: { ids: t } }),
|
|
272
280
|
deleteTablet: (t) => h.delete("/tablet", { params: { ids: t } })
|
|
273
|
-
}, s =
|
|
281
|
+
}, s = u({
|
|
274
282
|
prefix: "/v2/iam"
|
|
275
283
|
}), Z = {
|
|
276
284
|
login: (t) => s.post("/auth/login", t),
|
|
@@ -282,7 +290,7 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
282
290
|
confirmEmailChange: (t) => s.post("/auth/confirm-email-change", { token: t }),
|
|
283
291
|
cancelEmailChange: (t) => s.delete("/auth/cancel-email-change/".concat(t)),
|
|
284
292
|
getPositionList: (t) => {
|
|
285
|
-
const e =
|
|
293
|
+
const e = a(t);
|
|
286
294
|
return s.post("/position/list", e);
|
|
287
295
|
},
|
|
288
296
|
getPositionDetail: (t) => s.get("/position/".concat(t)),
|
|
@@ -293,7 +301,7 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
293
301
|
return s.delete("/position", { params: e });
|
|
294
302
|
},
|
|
295
303
|
getDivisionList: (t) => {
|
|
296
|
-
const e =
|
|
304
|
+
const e = a(t);
|
|
297
305
|
return s.post("/division/list", e);
|
|
298
306
|
},
|
|
299
307
|
getDivisionDetail: (t) => s.get("/division/".concat(t)),
|
|
@@ -312,11 +320,11 @@ const D = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
312
320
|
});
|
|
313
321
|
},
|
|
314
322
|
getGlobalUserList: (t) => {
|
|
315
|
-
const e =
|
|
323
|
+
const e = a(t);
|
|
316
324
|
return s.post("/users/list", e);
|
|
317
325
|
},
|
|
318
326
|
getGlobalUserOptions: (t) => {
|
|
319
|
-
const e =
|
|
327
|
+
const e = a(t);
|
|
320
328
|
return s.post("/users/options", e);
|
|
321
329
|
},
|
|
322
330
|
getGlobalUserDetail: (t) => s.get("/users/".concat(t)),
|
|
@@ -369,7 +377,7 @@ export {
|
|
|
369
377
|
W as TagEventlogServices,
|
|
370
378
|
X as TagServices,
|
|
371
379
|
K as UserServices,
|
|
372
|
-
|
|
380
|
+
O as getBaseURL,
|
|
373
381
|
B as getImageURL,
|
|
374
382
|
J as queryParamsStringfy
|
|
375
383
|
};
|
package/package.json
CHANGED
|
@@ -18,5 +18,9 @@ declare const GlobalTagServices: {
|
|
|
18
18
|
submitAuditTAG: (body: SubmitAuditTAGBody) => Promise<AxiosResponse>;
|
|
19
19
|
submitCombineTAG: (body: SubmitCombineTAGBody) => Promise<AxiosResponse>;
|
|
20
20
|
submitSeparateTAG: (body: SubmitSeparateTAGBody) => Promise<AxiosResponse>;
|
|
21
|
+
getPairedList: (params?: GetAllTAGParams) => Promise<AxiosResponse<FetchDetailResponse<TAGResponseType>>>;
|
|
22
|
+
getPairedOptions: (params?: GetAllTAGParams) => Promise<AxiosResponse<{
|
|
23
|
+
data: TAGFetchOptionResponse;
|
|
24
|
+
}>>;
|
|
21
25
|
};
|
|
22
26
|
export default GlobalTagServices;
|