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