@tagsamurai/gsts-api-services 1.0.1-alpha.2 → 1.0.1-beta.0
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 +58 -58
- package/api-services.system.js +1 -1
- package/package.json +1 -1
package/api-services.es.js
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import S from "axios";
|
|
2
|
+
const _ = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_GLOBAL_SETTINGS_API: "https://staging-api.global-settings.tagsamurai.com", VITE_APP_LOGS_NOTIFICATION_API: "https://staging-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://staging-api.tagsamurai.com" }, u = (t = "APP_TAGSAMURAI_API") => _["VITE_" + t], n = (t = {}, e = !1) => {
|
|
3
3
|
const {
|
|
4
4
|
env: s = "APP_GLOBAL_SETTINGS_API",
|
|
5
5
|
prefix: l = "",
|
|
6
6
|
headers: g = {},
|
|
7
7
|
...A
|
|
8
|
-
} =
|
|
9
|
-
return
|
|
8
|
+
} = t, P = `${u(s)}${l}`, a = JSON.parse(localStorage.getItem("user") ?? "{}"), I = a.jwt ?? a.token ?? "";
|
|
9
|
+
return S.create({
|
|
10
10
|
...A,
|
|
11
11
|
baseURL: P,
|
|
12
|
-
headers:
|
|
12
|
+
headers: e ? g : {
|
|
13
13
|
"Content-Type": "application/json",
|
|
14
|
-
Authorization: `Bearer ${
|
|
14
|
+
Authorization: `Bearer ${I}`,
|
|
15
15
|
...g
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
},
|
|
19
|
-
if (!
|
|
18
|
+
}, d = (t) => t ? `${u("APP_TAGSAMURAI_API")}/file-manager/v2/files/${t}` : void 0, O = (t) => {
|
|
19
|
+
if (!t || typeof t == "string")
|
|
20
20
|
return;
|
|
21
|
-
const
|
|
22
|
-
return Object.keys(
|
|
23
|
-
Array.isArray(
|
|
24
|
-
[s]: JSON.stringify(
|
|
25
|
-
}) :
|
|
26
|
-
[s]:
|
|
21
|
+
const e = {};
|
|
22
|
+
return Object.keys(t).forEach((s) => {
|
|
23
|
+
Array.isArray(t[s]) ? t[s].length > 0 && Object.assign(e, {
|
|
24
|
+
[s]: JSON.stringify(t[s])
|
|
25
|
+
}) : t[s] !== void 0 && Object.assign(e, {
|
|
26
|
+
[s]: t[s]
|
|
27
27
|
});
|
|
28
|
-
}),
|
|
28
|
+
}), e;
|
|
29
29
|
}, c = n({
|
|
30
30
|
prefix: "/v1/global-settings/change-log"
|
|
31
31
|
}), T = {
|
|
32
|
-
getChangelogs: (
|
|
33
|
-
getChangelogOptions: (
|
|
34
|
-
},
|
|
32
|
+
getChangelogs: (t) => c.get("", { params: t }),
|
|
33
|
+
getChangelogOptions: (t) => c.get("/options", { params: t })
|
|
34
|
+
}, i = n({
|
|
35
35
|
prefix: "/v1/global-settings/division"
|
|
36
36
|
}), U = {
|
|
37
|
-
getDivisions: (
|
|
38
|
-
getDivisionDetail: (
|
|
39
|
-
postCreateDivision: (
|
|
40
|
-
putEditDivision: (
|
|
41
|
-
deleteDivisions: (
|
|
42
|
-
const
|
|
43
|
-
return
|
|
37
|
+
getDivisions: (t) => i.get("", { params: t }),
|
|
38
|
+
getDivisionDetail: (t) => i.get(`/${t}`),
|
|
39
|
+
postCreateDivision: (t) => i.post("/", t),
|
|
40
|
+
putEditDivision: (t, e) => i.put(`/${t}`, e),
|
|
41
|
+
deleteDivisions: (t) => {
|
|
42
|
+
const e = { id: JSON.stringify(t) };
|
|
43
|
+
return i.delete("", { params: e });
|
|
44
44
|
}
|
|
45
|
-
},
|
|
45
|
+
}, f = n({
|
|
46
46
|
env: "APP_LOGS_NOTIFICATION_API",
|
|
47
47
|
prefix: "/v2"
|
|
48
48
|
}), $ = {
|
|
49
|
-
getSessionLogList: (
|
|
49
|
+
getSessionLogList: (t) => f.get("/session-log", { params: t })
|
|
50
50
|
}, p = n({
|
|
51
51
|
prefix: "/v1/global-settings/option"
|
|
52
52
|
}), h = {
|
|
53
53
|
getPositions: () => p.get("/position"),
|
|
54
54
|
getDivisions: () => p.get("/division")
|
|
55
|
-
},
|
|
55
|
+
}, o = n({
|
|
56
56
|
prefix: "/v1/global-settings/position"
|
|
57
57
|
}), y = {
|
|
58
|
-
getPositions: (
|
|
59
|
-
getPositionDetail: (
|
|
60
|
-
postCreatePosition: (
|
|
61
|
-
putEditPosition: (
|
|
62
|
-
deletePositions: (
|
|
63
|
-
const
|
|
64
|
-
return
|
|
58
|
+
getPositions: (t) => o.get("", { params: t }),
|
|
59
|
+
getPositionDetail: (t) => o.get(`/${t}`),
|
|
60
|
+
postCreatePosition: (t) => o.post("/", t),
|
|
61
|
+
putEditPosition: (t, e) => o.put(`/${t}`, e),
|
|
62
|
+
deletePositions: (t) => {
|
|
63
|
+
const e = { id: JSON.stringify(t) };
|
|
64
|
+
return o.delete("", { params: e });
|
|
65
65
|
}
|
|
66
|
-
},
|
|
66
|
+
}, v = n({
|
|
67
67
|
env: "APP_TAGSAMURAI_API",
|
|
68
68
|
prefix: "/tag/v2"
|
|
69
69
|
}), E = {
|
|
70
|
-
getTagInfo: (
|
|
70
|
+
getTagInfo: (t) => v.get("/rfid-qr/scan", { params: t })
|
|
71
71
|
}, r = n({
|
|
72
72
|
prefix: "/v1/global-settings/user"
|
|
73
73
|
}), L = {
|
|
74
|
-
getUsers: (
|
|
75
|
-
getUserDetail: (
|
|
76
|
-
getUserSystemLogs: (
|
|
77
|
-
getUserSystemLogOptions: (
|
|
74
|
+
getUsers: (t) => r.get("", { params: t }),
|
|
75
|
+
getUserDetail: (t) => r.get(`/${t}`),
|
|
76
|
+
getUserSystemLogs: (t, e) => r.get(`/${t}/system-logs`, { params: e }),
|
|
77
|
+
getUserSystemLogOptions: (t, e) => {
|
|
78
78
|
const s = {};
|
|
79
|
-
return s[
|
|
79
|
+
return s[e] = !0, r.get(`/${t}/system-logs/options`, { params: s });
|
|
80
80
|
},
|
|
81
|
-
postCreateUser: (
|
|
82
|
-
const
|
|
83
|
-
return r.post("",
|
|
81
|
+
postCreateUser: (t) => {
|
|
82
|
+
const e = { "Content-Type": "multipart/form-data" };
|
|
83
|
+
return r.post("", t, { headers: e });
|
|
84
84
|
},
|
|
85
|
-
putEditUser: (
|
|
85
|
+
putEditUser: (t, e) => {
|
|
86
86
|
const s = { "Content-Type": "multipart/form-data" };
|
|
87
|
-
return r.put(`/${
|
|
87
|
+
return r.put(`/${t}`, e, { headers: s });
|
|
88
88
|
},
|
|
89
|
-
deleteUsers: (
|
|
90
|
-
const
|
|
91
|
-
return r.delete("", { params:
|
|
89
|
+
deleteUsers: (t) => {
|
|
90
|
+
const e = { id: JSON.stringify(t) };
|
|
91
|
+
return r.delete("", { params: e });
|
|
92
92
|
},
|
|
93
|
-
putToggleStatusUsers: (
|
|
94
|
-
getUserOptions: (
|
|
95
|
-
const
|
|
96
|
-
return t
|
|
93
|
+
putToggleStatusUsers: (t) => r.put("/active-status", t),
|
|
94
|
+
getUserOptions: (t) => {
|
|
95
|
+
const e = {};
|
|
96
|
+
return e[t] = !0, r.get("/options", { params: e });
|
|
97
97
|
},
|
|
98
|
-
deleteCancelEmailChange: (
|
|
99
|
-
postResendEmail: (
|
|
100
|
-
putChangePassword: (
|
|
98
|
+
deleteCancelEmailChange: (t) => r.delete(`/cancel-email-change/${t}`),
|
|
99
|
+
postResendEmail: (t) => r.post("/resend-email", t),
|
|
100
|
+
putChangePassword: (t, e) => r.put(`/change-password/${t}`, e)
|
|
101
101
|
};
|
|
102
102
|
export {
|
|
103
103
|
T as ChangelogServices,
|
|
@@ -108,6 +108,6 @@ export {
|
|
|
108
108
|
E as TagServices,
|
|
109
109
|
L as UserServices,
|
|
110
110
|
u as getBaseURL,
|
|
111
|
-
|
|
111
|
+
d as getImageURL,
|
|
112
112
|
O as queryParamsStringfy
|
|
113
113
|
};
|
package/api-services.system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["axios"],function(
|
|
1
|
+
System.register(["axios"],function(r,d){"use strict";var c;return{setters:[a=>{c=a.default}],execute:function(){const a={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_GLOBAL_SETTINGS_API:"https://staging-api.global-settings.tagsamurai.com",VITE_APP_LOGS_NOTIFICATION_API:"https://staging-api-logs-notification.tagsamurai.com",VITE_APP_TAGSAMURAI_API:"https://staging-api.tagsamurai.com"},u=r("getBaseURL",(e="APP_TAGSAMURAI_API")=>a["VITE_"+e]),i=(e={},t=!1)=>{const{env:s="APP_GLOBAL_SETTINGS_API",prefix:I="",headers:A={},...f}=e,_=`${u(s)}${I}`,P=JSON.parse(localStorage.getItem("user")??"{}"),m=P.jwt??P.token??"";return c.create({...f,baseURL:_,headers:t?A:{"Content-Type":"application/json",Authorization:`Bearer ${m}`,...A}})},O=r("getImageURL",e=>e?`${u("APP_TAGSAMURAI_API")}/file-manager/v2/files/${e}`:void 0),T=r("queryParamsStringfy",e=>{if(!e||typeof e=="string")return;const t={};return Object.keys(e).forEach(s=>{Array.isArray(e[s])?e[s].length>0&&Object.assign(t,{[s]:JSON.stringify(e[s])}):e[s]!==void 0&&Object.assign(t,{[s]:e[s]})}),t}),l=i({prefix:"/v1/global-settings/change-log"}),U=r("ChangelogServices",{getChangelogs:e=>l.get("",{params:e}),getChangelogOptions:e=>l.get("/options",{params:e})}),o=i({prefix:"/v1/global-settings/division"}),$=r("DivisionServices",{getDivisions:e=>o.get("",{params:e}),getDivisionDetail:e=>o.get(`/${e}`),postCreateDivision:e=>o.post("/",e),putEditDivision:(e,t)=>o.put(`/${e}`,t),deleteDivisions:e=>{const t={id:JSON.stringify(e)};return o.delete("",{params:t})}}),S=i({env:"APP_LOGS_NOTIFICATION_API",prefix:"/v2"}),y=r("LogServices",{getSessionLogList:e=>S.get("/session-log",{params:e})}),p=i({prefix:"/v1/global-settings/option"}),L=r("OptionServices",{getPositions:()=>p.get("/position"),getDivisions:()=>p.get("/division")}),g=i({prefix:"/v1/global-settings/position"}),h=r("PositionServices",{getPositions:e=>g.get("",{params:e}),getPositionDetail:e=>g.get(`/${e}`),postCreatePosition:e=>g.post("/",e),putEditPosition:(e,t)=>g.put(`/${e}`,t),deletePositions:e=>{const t={id:JSON.stringify(e)};return g.delete("",{params:t})}}),v=i({env:"APP_TAGSAMURAI_API",prefix:"/tag/v2"}),E=r("TagServices",{getTagInfo:e=>v.get("/rfid-qr/scan",{params:e})}),n=i({prefix:"/v1/global-settings/user"}),C=r("UserServices",{getUsers:e=>n.get("",{params:e}),getUserDetail:e=>n.get(`/${e}`),getUserSystemLogs:(e,t)=>n.get(`/${e}/system-logs`,{params:t}),getUserSystemLogOptions:(e,t)=>{const s={};return s[t]=!0,n.get(`/${e}/system-logs/options`,{params:s})},postCreateUser:e=>{const t={"Content-Type":"multipart/form-data"};return n.post("",e,{headers:t})},putEditUser:(e,t)=>{const s={"Content-Type":"multipart/form-data"};return n.put(`/${e}`,t,{headers:s})},deleteUsers:e=>{const t={id:JSON.stringify(e)};return n.delete("",{params:t})},putToggleStatusUsers:e=>n.put("/active-status",e),getUserOptions:e=>{const t={};return t[e]=!0,n.get("/options",{params:t})},deleteCancelEmailChange:e=>n.delete(`/cancel-email-change/${e}`),postResendEmail:e=>n.post("/resend-email",e),putChangePassword:(e,t)=>n.put(`/change-password/${e}`,t)})}}});
|
package/package.json
CHANGED