@tagsamurai/gsts-api-services 1.0.1-alpha.12 → 1.0.1-alpha.13
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 +87 -89
- package/api-services.system.js +1 -1
- package/package.json +1 -1
package/api-services.es.js
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import v from "axios";
|
|
2
|
+
const _ = { 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") => _["VITE_" + t], o = (t = {}, e = !1) => {
|
|
3
3
|
const {
|
|
4
4
|
env: r = "APP_GLOBAL_SETTINGS_API",
|
|
5
5
|
prefix: u = "",
|
|
6
|
-
headers:
|
|
7
|
-
...
|
|
8
|
-
} = t,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
baseURL: $,
|
|
14
|
-
headers: e ? A : {
|
|
6
|
+
headers: c = {},
|
|
7
|
+
...I
|
|
8
|
+
} = t, S = `${l(r)}${u}`, A = JSON.parse(localStorage.getItem("user") ?? "{}"), $ = A.jwt ?? A.token ?? "";
|
|
9
|
+
return v.create({
|
|
10
|
+
...I,
|
|
11
|
+
baseURL: S,
|
|
12
|
+
headers: e ? c : {
|
|
15
13
|
"Content-Type": "application/json",
|
|
16
|
-
Authorization: `Bearer ${
|
|
17
|
-
...
|
|
14
|
+
Authorization: `Bearer ${$}`,
|
|
15
|
+
...c
|
|
18
16
|
}
|
|
19
17
|
});
|
|
20
|
-
},
|
|
18
|
+
}, h = (t) => {
|
|
21
19
|
if (!t) return;
|
|
22
|
-
const e =
|
|
20
|
+
const e = l("APP_TAGSAMURAI_API");
|
|
23
21
|
return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
|
|
24
|
-
},
|
|
22
|
+
}, m = (t) => {
|
|
25
23
|
if (!t || typeof t == "string")
|
|
26
24
|
return;
|
|
27
25
|
const e = {};
|
|
@@ -32,14 +30,14 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
32
30
|
[r]: t[r]
|
|
33
31
|
});
|
|
34
32
|
}), e;
|
|
35
|
-
},
|
|
33
|
+
}, d = o({
|
|
36
34
|
prefix: "/v1/global-settings/change-log"
|
|
37
|
-
}),
|
|
38
|
-
getChangelogs: (t) =>
|
|
39
|
-
getChangelogOptions: (t) =>
|
|
35
|
+
}), E = {
|
|
36
|
+
getChangelogs: (t) => d.get("", { params: t }),
|
|
37
|
+
getChangelogOptions: (t) => d.get("/options", { params: t })
|
|
40
38
|
}, i = o({
|
|
41
39
|
prefix: "/v1/global-settings/division"
|
|
42
|
-
}),
|
|
40
|
+
}), y = {
|
|
43
41
|
getDivisions: (t) => i.get("", { params: t }),
|
|
44
42
|
getDivisionDetail: (t) => i.get(`/${t}`),
|
|
45
43
|
postCreateDivision: (t) => i.post("/", t),
|
|
@@ -51,14 +49,14 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
51
49
|
}, g = o({
|
|
52
50
|
env: "APP_TAGSAMURAI_API",
|
|
53
51
|
prefix: "/v1/global-settings"
|
|
54
|
-
}),
|
|
52
|
+
}), G = {
|
|
55
53
|
getTAGAllPaired: (t, e) => g.get(`/${t}`, { params: e }),
|
|
56
54
|
getTAGAllPairedOptions: (t, e) => g.get(`/${t}/options`, { params: e }),
|
|
57
55
|
getTAGNotPaired: (t, e) => g.get(`/${t}/not-paired`, { params: e }),
|
|
58
56
|
getTAGNotPairedOptions: (t, e) => g.get(`/${t}/not-paired/options`, { params: e })
|
|
59
|
-
},
|
|
60
|
-
const r =
|
|
61
|
-
return
|
|
57
|
+
}, s = ({ headers: t = {}, params: e = {} } = {}) => {
|
|
58
|
+
const r = l("APP_GLOBAL_SETTINGS_API"), u = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
59
|
+
return v.create({
|
|
62
60
|
baseURL: `${r}/v1/global-settings`,
|
|
63
61
|
headers: {
|
|
64
62
|
"Content-type": "application/json",
|
|
@@ -67,46 +65,46 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
67
65
|
},
|
|
68
66
|
params: e
|
|
69
67
|
});
|
|
70
|
-
},
|
|
71
|
-
getHandheldReader: (t) =>
|
|
72
|
-
getHandheldReaderDetail: (t) =>
|
|
73
|
-
getHandheldReaderOptions: (t) =>
|
|
74
|
-
putMarkHandheldStatus: (t) =>
|
|
75
|
-
putPingReaders: (t) =>
|
|
76
|
-
putMarkIOTStatus: (t, e) =>
|
|
77
|
-
putEditReaderGroup: (t, e, r) =>
|
|
68
|
+
}, L = {
|
|
69
|
+
getHandheldReader: (t) => s({ params: t }).get("/reader"),
|
|
70
|
+
getHandheldReaderDetail: (t) => s().get(`/reader/${t}`),
|
|
71
|
+
getHandheldReaderOptions: (t) => s({ params: t }).get("/reader/options"),
|
|
72
|
+
putMarkHandheldStatus: (t) => s().put("/reader/mark-status", t),
|
|
73
|
+
putPingReaders: (t) => s().put("/iot-reader/ping", t),
|
|
74
|
+
putMarkIOTStatus: (t, e) => s().put(`/${e}/mark-status`, t),
|
|
75
|
+
putEditReaderGroup: (t, e, r) => s().put(
|
|
78
76
|
`/${t === "iot" ? "iot-" : ""}reader/${r}/set-group`,
|
|
79
77
|
e
|
|
80
78
|
),
|
|
81
|
-
putEditAntennaGroup: (t, e) =>
|
|
82
|
-
putEditPortStatus: (t, e) =>
|
|
83
|
-
putEditAliasName: (t, e, r) =>
|
|
79
|
+
putEditAntennaGroup: (t, e) => s().put(`/iot-reader/${e}/set-port-group`, t),
|
|
80
|
+
putEditPortStatus: (t, e) => s().put(`/iot-reader/${e}/set-port-status`, t),
|
|
81
|
+
putEditAliasName: (t, e, r) => s().put(
|
|
84
82
|
`/${t === "iot" ? "iot-" : ""}reader/${r}/set-alias-name`,
|
|
85
83
|
e
|
|
86
84
|
),
|
|
87
|
-
putAntennaPower: (t, e) =>
|
|
88
|
-
getIOTReaderOrAntenna: (t, e) =>
|
|
89
|
-
getIOTReaderDetail: (t) =>
|
|
90
|
-
getIOTReaderOrAntennaOptions: (t, e) =>
|
|
91
|
-
getActivityLog: (t) =>
|
|
92
|
-
getActivityLogOptions: (t) =>
|
|
93
|
-
getDetailActivityLog: (t) =>
|
|
94
|
-
getDetailActivityLogOptions: (t) =>
|
|
95
|
-
getExistingAliasNames: () =>
|
|
96
|
-
getIotReaderPort: (t, e) =>
|
|
97
|
-
},
|
|
85
|
+
putAntennaPower: (t, e) => s().put(`/iot-reader/${e}/set-antenna-power`, t),
|
|
86
|
+
getIOTReaderOrAntenna: (t, e) => s({ params: e }).get(`/${t}`),
|
|
87
|
+
getIOTReaderDetail: (t) => s().get(`/iot-reader/${t}`),
|
|
88
|
+
getIOTReaderOrAntennaOptions: (t, e) => s({ params: e }).get(`/${t}/options`),
|
|
89
|
+
getActivityLog: (t) => s({ params: t }).get("/activity-log"),
|
|
90
|
+
getActivityLogOptions: (t) => s({ params: t }).get("/activity-log/options"),
|
|
91
|
+
getDetailActivityLog: (t) => s({ params: t }).get("/activity-log"),
|
|
92
|
+
getDetailActivityLogOptions: (t) => s({ params: t }).get("/activity-log/options"),
|
|
93
|
+
getExistingAliasNames: () => s().get("/reader/alias-names"),
|
|
94
|
+
getIotReaderPort: (t, e) => s({ params: e }).get(`/iot-reader/${t}/ports`)
|
|
95
|
+
}, T = o({
|
|
98
96
|
env: "APP_LOGS_NOTIFICATION_API",
|
|
99
97
|
prefix: "/v2"
|
|
100
|
-
}),
|
|
101
|
-
getSessionLogList: (t) =>
|
|
102
|
-
},
|
|
98
|
+
}), R = {
|
|
99
|
+
getSessionLogList: (t) => T.get("/session-log", { params: t })
|
|
100
|
+
}, P = o({
|
|
103
101
|
prefix: "/v1/global-settings/option"
|
|
104
|
-
}),
|
|
105
|
-
getPositions: () =>
|
|
106
|
-
getDivisions: () =>
|
|
102
|
+
}), U = {
|
|
103
|
+
getPositions: () => P.get("/position"),
|
|
104
|
+
getDivisions: () => P.get("/division")
|
|
107
105
|
}, a = o({
|
|
108
106
|
prefix: "/v1/global-settings/position"
|
|
109
|
-
}),
|
|
107
|
+
}), D = {
|
|
110
108
|
getPositions: (t) => a.get("", { params: t }),
|
|
111
109
|
getPositionDetail: (t) => a.get(`/${t}`),
|
|
112
110
|
postCreatePosition: (t) => a.post("/", t),
|
|
@@ -115,60 +113,60 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
115
113
|
const e = { id: JSON.stringify(t) };
|
|
116
114
|
return a.delete("", { params: e });
|
|
117
115
|
}
|
|
118
|
-
},
|
|
116
|
+
}, O = o({
|
|
119
117
|
env: "APP_TAGSAMURAI_API",
|
|
120
118
|
prefix: "/tag/v2"
|
|
121
|
-
}),
|
|
122
|
-
getTagInfo: (t) =>
|
|
123
|
-
},
|
|
119
|
+
}), N = {
|
|
120
|
+
getTagInfo: (t) => O.get("/rfid-qr/scan", { params: t })
|
|
121
|
+
}, p = o({
|
|
124
122
|
prefix: "/v1/global-settings/change-log"
|
|
125
|
-
}),
|
|
126
|
-
getTAGEventlog: (t) =>
|
|
127
|
-
getTAGEventlogOptions: (t) =>
|
|
128
|
-
getDetailTAGEventlog: (t) =>
|
|
129
|
-
},
|
|
123
|
+
}), b = {
|
|
124
|
+
getTAGEventlog: (t) => p.get("/tag-event-log", { params: t }),
|
|
125
|
+
getTAGEventlogOptions: (t) => p.get("/tag-event-log/options", { params: t }),
|
|
126
|
+
getDetailTAGEventlog: (t) => p.get(`/tag-event-log/${t}`)
|
|
127
|
+
}, n = o({
|
|
130
128
|
prefix: "/v1/global-settings/user"
|
|
131
|
-
}),
|
|
132
|
-
getUsers: (t) =>
|
|
133
|
-
getUserDetail: (t) =>
|
|
134
|
-
getUserSystemLogs: (t, e) =>
|
|
129
|
+
}), C = {
|
|
130
|
+
getUsers: (t) => n.get("", { params: t }),
|
|
131
|
+
getUserDetail: (t) => n.get(`/${t}`),
|
|
132
|
+
getUserSystemLogs: (t, e) => n.get(`/${t}/system-logs`, { params: e }),
|
|
135
133
|
getUserSystemLogOptions: (t, e) => {
|
|
136
134
|
const r = {};
|
|
137
|
-
return r[e] = !0,
|
|
135
|
+
return r[e] = !0, n.get(`/${t}/system-logs/options`, { params: r });
|
|
138
136
|
},
|
|
139
137
|
postCreateUser: (t) => {
|
|
140
138
|
const e = { "Content-Type": "multipart/form-data" };
|
|
141
|
-
return
|
|
139
|
+
return n.post("", t, { headers: e });
|
|
142
140
|
},
|
|
143
141
|
putEditUser: (t, e) => {
|
|
144
142
|
const r = { "Content-Type": "multipart/form-data" };
|
|
145
|
-
return
|
|
143
|
+
return n.put(`/${t}`, e, { headers: r });
|
|
146
144
|
},
|
|
147
145
|
deleteUsers: (t) => {
|
|
148
146
|
const e = { id: JSON.stringify(t) };
|
|
149
|
-
return
|
|
147
|
+
return n.delete("", { params: e });
|
|
150
148
|
},
|
|
151
|
-
putToggleStatusUsers: (t) =>
|
|
149
|
+
putToggleStatusUsers: (t) => n.put("/active-status", t),
|
|
152
150
|
getUserOptions: (t) => {
|
|
153
151
|
const e = {};
|
|
154
|
-
return e[t] = !0,
|
|
152
|
+
return e[t] = !0, n.get("/options", { params: e });
|
|
155
153
|
},
|
|
156
|
-
deleteCancelEmailChange: (t) =>
|
|
157
|
-
postResendEmail: (t) =>
|
|
158
|
-
putChangePassword: (t, e) =>
|
|
154
|
+
deleteCancelEmailChange: (t) => n.delete(`/cancel-email-change/${t}`),
|
|
155
|
+
postResendEmail: (t) => n.post("/resend-email", t),
|
|
156
|
+
putChangePassword: (t, e) => n.put(`/change-password/${t}`, e)
|
|
159
157
|
};
|
|
160
158
|
export {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
159
|
+
E as ChangelogServices,
|
|
160
|
+
y as DivisionServices,
|
|
161
|
+
G as GlobalTagServices,
|
|
162
|
+
L as HardwareServices,
|
|
163
|
+
R as LogServices,
|
|
164
|
+
U as OptionServices,
|
|
165
|
+
D as PositionServices,
|
|
166
|
+
b as TagEventlogServices,
|
|
167
|
+
N as TagServices,
|
|
168
|
+
C as UserServices,
|
|
169
|
+
l as getBaseURL,
|
|
170
|
+
h as getImageURL,
|
|
171
|
+
m as queryParamsStringfy
|
|
174
172
|
};
|
package/api-services.system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["axios"],function(s,
|
|
1
|
+
System.register(["axios"],function(s,m){"use strict";var l;return{setters:[c=>{l=c.default}],execute:function(){const c={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"},p=s("getBaseURL",(t="APP_TAGSAMURAI_API")=>c["VITE_"+t]),o=(t={},e=!1)=>{const{env:r="APP_GLOBAL_SETTINGS_API",prefix:d="",headers:S={},...f}=t,_=`${p(r)}${d}`,I=JSON.parse(localStorage.getItem("user")??"{}"),O=I.jwt??I.token??"";return l.create({...f,baseURL:_,headers:e?S:{"Content-Type":"application/json",Authorization:`Bearer ${O}`,...S}})},h=s("getImageURL",t=>{if(!t)return;const e=p("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),y=s("queryParamsStringfy",t=>{if(!t||typeof t=="string")return;const e={};return Object.keys(t).forEach(r=>{Array.isArray(t[r])?t[r].length>0&&Object.assign(e,{[r]:JSON.stringify(t[r])}):t[r]!==void 0&&Object.assign(e,{[r]:t[r]})}),e}),v=o({prefix:"/v1/global-settings/change-log"}),E=s("ChangelogServices",{getChangelogs:t=>v.get("",{params:t}),getChangelogOptions:t=>v.get("/options",{params:t})}),a=o({prefix:"/v1/global-settings/division"}),L=s("DivisionServices",{getDivisions:t=>a.get("",{params:t}),getDivisionDetail:t=>a.get(`/${t}`),postCreateDivision:t=>a.post("/",t),putEditDivision:(t,e)=>a.put(`/${t}`,e),deleteDivisions:t=>{const e={id:JSON.stringify(t)};return a.delete("",{params:e})}}),u=o({env:"APP_TAGSAMURAI_API",prefix:"/v1/global-settings"}),R=s("GlobalTagServices",{getTAGAllPaired:(t,e)=>u.get(`/${t}`,{params:e}),getTAGAllPairedOptions:(t,e)=>u.get(`/${t}/options`,{params:e}),getTAGNotPaired:(t,e)=>u.get(`/${t}/not-paired`,{params:e}),getTAGNotPairedOptions:(t,e)=>u.get(`/${t}/not-paired/options`,{params:e})}),n=({headers:t={},params:e={}}={})=>{const r=p("APP_GLOBAL_SETTINGS_API"),d=JSON.parse(localStorage.getItem("user")??"{}");return l.create({baseURL:`${r}/v1/global-settings`,headers:{"Content-type":"application/json",Authorization:`Bearer ${d.token}`,...t},params:e})},G=s("HardwareServices",{getHandheldReader:t=>n({params:t}).get("/reader"),getHandheldReaderDetail:t=>n().get(`/reader/${t}`),getHandheldReaderOptions:t=>n({params:t}).get("/reader/options"),putMarkHandheldStatus:t=>n().put("/reader/mark-status",t),putPingReaders:t=>n().put("/iot-reader/ping",t),putMarkIOTStatus:(t,e)=>n().put(`/${e}/mark-status`,t),putEditReaderGroup:(t,e,r)=>n().put(`/${t==="iot"?"iot-":""}reader/${r}/set-group`,e),putEditAntennaGroup:(t,e)=>n().put(`/iot-reader/${e}/set-port-group`,t),putEditPortStatus:(t,e)=>n().put(`/iot-reader/${e}/set-port-status`,t),putEditAliasName:(t,e,r)=>n().put(`/${t==="iot"?"iot-":""}reader/${r}/set-alias-name`,e),putAntennaPower:(t,e)=>n().put(`/iot-reader/${e}/set-antenna-power`,t),getIOTReaderOrAntenna:(t,e)=>n({params:e}).get(`/${t}`),getIOTReaderDetail:t=>n().get(`/iot-reader/${t}`),getIOTReaderOrAntennaOptions:(t,e)=>n({params:e}).get(`/${t}/options`),getActivityLog:t=>n({params:t}).get("/activity-log"),getActivityLogOptions:t=>n({params:t}).get("/activity-log/options"),getDetailActivityLog:t=>n({params:t}).get("/activity-log"),getDetailActivityLogOptions:t=>n({params:t}).get("/activity-log/options"),getExistingAliasNames:()=>n().get("/reader/alias-names"),getIotReaderPort:(t,e)=>n({params:e}).get(`/iot-reader/${t}/ports`)}),$=o({env:"APP_LOGS_NOTIFICATION_API",prefix:"/v2"}),U=s("LogServices",{getSessionLogList:t=>$.get("/session-log",{params:t})}),P=o({prefix:"/v1/global-settings/option"}),D=s("OptionServices",{getPositions:()=>P.get("/position"),getDivisions:()=>P.get("/division")}),g=o({prefix:"/v1/global-settings/position"}),b=s("PositionServices",{getPositions:t=>g.get("",{params:t}),getPositionDetail:t=>g.get(`/${t}`),postCreatePosition:t=>g.post("/",t),putEditPosition:(t,e)=>g.put(`/${t}`,e),deletePositions:t=>{const e={id:JSON.stringify(t)};return g.delete("",{params:e})}}),T=o({env:"APP_TAGSAMURAI_API",prefix:"/tag/v2"}),C=s("TagServices",{getTagInfo:t=>T.get("/rfid-qr/scan",{params:t})}),A=o({prefix:"/v1/global-settings/change-log"}),N=s("TagEventlogServices",{getTAGEventlog:t=>A.get("/tag-event-log",{params:t}),getTAGEventlogOptions:t=>A.get("/tag-event-log/options",{params:t}),getDetailTAGEventlog:t=>A.get(`/tag-event-log/${t}`)}),i=o({prefix:"/v1/global-settings/user"}),B=s("UserServices",{getUsers:t=>i.get("",{params:t}),getUserDetail:t=>i.get(`/${t}`),getUserSystemLogs:(t,e)=>i.get(`/${t}/system-logs`,{params:e}),getUserSystemLogOptions:(t,e)=>{const r={};return r[e]=!0,i.get(`/${t}/system-logs/options`,{params:r})},postCreateUser:t=>{const e={"Content-Type":"multipart/form-data"};return i.post("",t,{headers:e})},putEditUser:(t,e)=>{const r={"Content-Type":"multipart/form-data"};return i.put(`/${t}`,e,{headers:r})},deleteUsers:t=>{const e={id:JSON.stringify(t)};return i.delete("",{params:e})},putToggleStatusUsers:t=>i.put("/active-status",t),getUserOptions:t=>{const e={};return e[t]=!0,i.get("/options",{params:e})},deleteCancelEmailChange:t=>i.delete(`/cancel-email-change/${t}`),postResendEmail:t=>i.post("/resend-email",t),putChangePassword:(t,e)=>i.put(`/change-password/${t}`,e)})}}});
|
package/package.json
CHANGED