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