@tagsamurai/gsts-api-services 1.0.1-alpha.5 → 1.0.1-alpha.7
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 +122 -69
- package/api-services.system.js +1 -1
- package/main.d.ts +3 -0
- package/package.json +1 -1
- package/src/dto/dataTable.dto.d.ts +40 -0
- package/src/dto/hardware.dto.d.ts +99 -0
- package/src/dto/tag.dto.d.ts +24 -0
- package/src/dto/tagEventlog.dto.d.ts +31 -0
- package/src/services/globalTag.service.d.ts +16 -0
- package/src/services/hardware.service.d.ts +35 -0
- package/src/services/tagEventlog.service.d.ts +11 -0
- package/src/types/hardware.type.d.ts +88 -0
- package/src/types/tag.type.d.ts +21 -0
- package/src/types/tagEventlog.type.d.ts +8 -0
package/api-services.es.js
CHANGED
|
@@ -1,118 +1,171 @@
|
|
|
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
|
-
env:
|
|
4
|
+
env: r = "APP_GLOBAL_SETTINGS_API",
|
|
5
5
|
prefix: u = "",
|
|
6
|
-
headers:
|
|
7
|
-
...
|
|
8
|
-
} = t,
|
|
9
|
-
return
|
|
10
|
-
...
|
|
11
|
-
baseURL:
|
|
12
|
-
headers: e ?
|
|
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 : {
|
|
13
13
|
"Content-Type": "application/json",
|
|
14
|
-
Authorization: `Bearer ${
|
|
15
|
-
...
|
|
14
|
+
Authorization: `Bearer ${$}`,
|
|
15
|
+
...c
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
}, h = (t) => {
|
|
19
19
|
if (!t) return;
|
|
20
20
|
const e = l("APP_TAGSAMURAI_API");
|
|
21
|
-
|
|
22
|
-
const s = t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
|
|
23
|
-
return console.log("🚀 ~ filePath:", s), s;
|
|
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 = {};
|
|
28
|
-
return Object.keys(t).forEach((
|
|
29
|
-
Array.isArray(t[
|
|
30
|
-
[
|
|
31
|
-
}) : t[
|
|
32
|
-
[
|
|
26
|
+
return Object.keys(t).forEach((r) => {
|
|
27
|
+
Array.isArray(t[r]) ? t[r].length > 0 && Object.assign(e, {
|
|
28
|
+
[r]: JSON.stringify(t[r])
|
|
29
|
+
}) : t[r] !== void 0 && Object.assign(e, {
|
|
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) =>
|
|
40
|
-
},
|
|
35
|
+
}), E = {
|
|
36
|
+
getChangelogs: (t) => d.get("", { params: t }),
|
|
37
|
+
getChangelogOptions: (t) => d.get("/options", { params: t })
|
|
38
|
+
}, i = o({
|
|
41
39
|
prefix: "/v1/global-settings/division"
|
|
42
|
-
}),
|
|
43
|
-
getDivisions: (t) =>
|
|
44
|
-
getDivisionDetail: (t) =>
|
|
45
|
-
postCreateDivision: (t) =>
|
|
46
|
-
putEditDivision: (t, e) =>
|
|
40
|
+
}), y = {
|
|
41
|
+
getDivisions: (t) => i.get("", { params: t }),
|
|
42
|
+
getDivisionDetail: (t) => i.get(`/${t}`),
|
|
43
|
+
postCreateDivision: (t) => i.post("/", t),
|
|
44
|
+
putEditDivision: (t, e) => i.put(`/${t}`, e),
|
|
47
45
|
deleteDivisions: (t) => {
|
|
48
46
|
const e = { id: JSON.stringify(t) };
|
|
49
|
-
return
|
|
47
|
+
return i.delete("", { params: e });
|
|
50
48
|
}
|
|
51
|
-
},
|
|
49
|
+
}, g = o({
|
|
50
|
+
env: "APP_TAGSAMURAI_API",
|
|
51
|
+
prefix: "/v1/global-settings"
|
|
52
|
+
}), G = {
|
|
53
|
+
getTAGAllPaired: (t, e) => g.get(`/${t}`, { params: e }),
|
|
54
|
+
getTAGAllPairedOptions: (t, e) => g.get(`/${t}/options`, { params: e }),
|
|
55
|
+
getTAGNotPaired: (t, e) => g.get(`/${t}/not-paired`, { params: e }),
|
|
56
|
+
getTAGNotPairedOptions: (t, e) => g.get(`/${t}/not-paired/options`, { params: e })
|
|
57
|
+
}, s = ({ headers: t = {}, params: e = {} } = {}) => {
|
|
58
|
+
const r = l("APP_GLOBAL_SETTINGS_API"), u = JSON.parse(localStorage.getItem("user") ?? "{}");
|
|
59
|
+
return v.create({
|
|
60
|
+
baseURL: `${r}/v1/global-settings`,
|
|
61
|
+
headers: {
|
|
62
|
+
"Content-type": "application/json",
|
|
63
|
+
Authorization: `Bearer ${u.token}`,
|
|
64
|
+
...t
|
|
65
|
+
},
|
|
66
|
+
params: e
|
|
67
|
+
});
|
|
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(
|
|
76
|
+
`/${t === "iot" ? "iot-" : ""}reader/${r}/set-group`,
|
|
77
|
+
e
|
|
78
|
+
),
|
|
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(
|
|
82
|
+
`/${t === "iot" ? "iot-" : ""}reader/${r}/set-alias-name`,
|
|
83
|
+
e
|
|
84
|
+
),
|
|
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({
|
|
52
96
|
env: "APP_LOGS_NOTIFICATION_API",
|
|
53
97
|
prefix: "/v2"
|
|
54
|
-
}),
|
|
55
|
-
getSessionLogList: (t) =>
|
|
56
|
-
},
|
|
98
|
+
}), R = {
|
|
99
|
+
getSessionLogList: (t) => T.get("/session-log", { params: t })
|
|
100
|
+
}, P = o({
|
|
57
101
|
prefix: "/v1/global-settings/option"
|
|
58
102
|
}), U = {
|
|
59
|
-
getPositions: () =>
|
|
60
|
-
getDivisions: () =>
|
|
61
|
-
},
|
|
103
|
+
getPositions: () => P.get("/position"),
|
|
104
|
+
getDivisions: () => P.get("/division")
|
|
105
|
+
}, a = o({
|
|
62
106
|
prefix: "/v1/global-settings/position"
|
|
63
|
-
}),
|
|
64
|
-
getPositions: (t) =>
|
|
65
|
-
getPositionDetail: (t) =>
|
|
66
|
-
postCreatePosition: (t) =>
|
|
67
|
-
putEditPosition: (t, e) =>
|
|
107
|
+
}), D = {
|
|
108
|
+
getPositions: (t) => a.get("", { params: t }),
|
|
109
|
+
getPositionDetail: (t) => a.get(`/${t}`),
|
|
110
|
+
postCreatePosition: (t) => a.post("/", t),
|
|
111
|
+
putEditPosition: (t, e) => a.put(`/${t}`, e),
|
|
68
112
|
deletePositions: (t) => {
|
|
69
113
|
const e = { id: JSON.stringify(t) };
|
|
70
|
-
return
|
|
114
|
+
return a.delete("", { params: e });
|
|
71
115
|
}
|
|
72
|
-
},
|
|
116
|
+
}, O = o({
|
|
73
117
|
env: "APP_TAGSAMURAI_API",
|
|
74
118
|
prefix: "/tag/v2"
|
|
75
|
-
}),
|
|
76
|
-
getTagInfo: (t) =>
|
|
77
|
-
},
|
|
119
|
+
}), N = {
|
|
120
|
+
getTagInfo: (t) => O.get("/rfid-qr/scan", { params: t })
|
|
121
|
+
}, p = o({
|
|
122
|
+
prefix: "/v1/global-settings/change-log"
|
|
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({
|
|
78
128
|
prefix: "/v1/global-settings/user"
|
|
79
|
-
}),
|
|
80
|
-
getUsers: (t) =>
|
|
81
|
-
getUserDetail: (t) =>
|
|
82
|
-
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 }),
|
|
83
133
|
getUserSystemLogOptions: (t, e) => {
|
|
84
|
-
const
|
|
85
|
-
return
|
|
134
|
+
const r = {};
|
|
135
|
+
return r[e] = !0, n.get(`/${t}/system-logs/options`, { params: r });
|
|
86
136
|
},
|
|
87
137
|
postCreateUser: (t) => {
|
|
88
138
|
const e = { "Content-Type": "multipart/form-data" };
|
|
89
|
-
return
|
|
139
|
+
return n.post("", t, { headers: e });
|
|
90
140
|
},
|
|
91
141
|
putEditUser: (t, e) => {
|
|
92
|
-
const
|
|
93
|
-
return
|
|
142
|
+
const r = { "Content-Type": "multipart/form-data" };
|
|
143
|
+
return n.put(`/${t}`, e, { headers: r });
|
|
94
144
|
},
|
|
95
145
|
deleteUsers: (t) => {
|
|
96
146
|
const e = { id: JSON.stringify(t) };
|
|
97
|
-
return
|
|
147
|
+
return n.delete("", { params: e });
|
|
98
148
|
},
|
|
99
|
-
putToggleStatusUsers: (t) =>
|
|
149
|
+
putToggleStatusUsers: (t) => n.put("/active-status", t),
|
|
100
150
|
getUserOptions: (t) => {
|
|
101
151
|
const e = {};
|
|
102
|
-
return e[t] = !0,
|
|
152
|
+
return e[t] = !0, n.get("/options", { params: e });
|
|
103
153
|
},
|
|
104
|
-
deleteCancelEmailChange: (t) =>
|
|
105
|
-
postResendEmail: (t) =>
|
|
106
|
-
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)
|
|
107
157
|
};
|
|
108
158
|
export {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
159
|
+
E as ChangelogServices,
|
|
160
|
+
y as DivisionServices,
|
|
161
|
+
G as GlobalTagServices,
|
|
162
|
+
L as HardwareServices,
|
|
163
|
+
R as LogServices,
|
|
112
164
|
U as OptionServices,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
165
|
+
D as PositionServices,
|
|
166
|
+
b as TagEventlogServices,
|
|
167
|
+
N as TagServices,
|
|
168
|
+
C as UserServices,
|
|
116
169
|
l as getBaseURL,
|
|
117
170
|
h as getImageURL,
|
|
118
171
|
m as queryParamsStringfy
|
package/api-services.system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["axios"],function(
|
|
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/main.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export { default as ChangelogServices } from './src/services/changelog.service';
|
|
2
2
|
export { default as DivisionServices } from './src/services/division.service';
|
|
3
|
+
export { default as GlobalTagServices } from './src/services/globalTag.service';
|
|
4
|
+
export { default as HardwareServices } from './src/services/hardware.service';
|
|
3
5
|
export { default as LogServices } from './src/services/logNotification.service';
|
|
4
6
|
export { default as OptionServices } from './src/services/option.service';
|
|
5
7
|
export { default as PositionServices } from './src/services/position.service';
|
|
6
8
|
export { default as TagServices } from './src/services/tag.service';
|
|
9
|
+
export { default as TagEventlogServices } from './src/services/tagEventlog.service';
|
|
7
10
|
export { default as UserServices } from './src/services/user.service';
|
|
8
11
|
export { getBaseURL, getImageURL, queryParamsStringfy } from './src/utils';
|
package/package.json
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { MultiSelectOption } from '../types/options.type';
|
|
2
|
+
import { ApplicationModule } from '../types/tag.type';
|
|
3
|
+
export type FilterOptions = {
|
|
4
|
+
deviceNameOptions?: MultiSelectOption[];
|
|
5
|
+
nameOptions?: MultiSelectOption[];
|
|
6
|
+
userFullNameOptions?: MultiSelectOption[];
|
|
7
|
+
networkStatusOptions?: MultiSelectOption[];
|
|
8
|
+
brandOptions?: MultiSelectOption[];
|
|
9
|
+
modelOptions?: MultiSelectOption[];
|
|
10
|
+
moduleOptions?: MultiSelectOption[];
|
|
11
|
+
reportedByOptions?: MultiSelectOption[];
|
|
12
|
+
modifiedByOptions?: MultiSelectOption[];
|
|
13
|
+
fieldOptions?: MultiSelectOption[];
|
|
14
|
+
activityOptions?: MultiSelectOption[];
|
|
15
|
+
pairedInOptions?: MultiSelectOption[];
|
|
16
|
+
availabilityOptions?: MultiSelectOption[];
|
|
17
|
+
skuOptions?: MultiSelectOption[];
|
|
18
|
+
statusOptions?: MultiSelectOption[];
|
|
19
|
+
typeOptions?: MultiSelectOption[];
|
|
20
|
+
};
|
|
21
|
+
export type BooleanOptions = {
|
|
22
|
+
deviceNameOptions?: boolean;
|
|
23
|
+
nameOptions?: boolean;
|
|
24
|
+
userFullNameOptions?: boolean;
|
|
25
|
+
networkStatusOptions?: boolean;
|
|
26
|
+
brandOptions?: boolean;
|
|
27
|
+
modelOptions?: boolean;
|
|
28
|
+
moduleOptions?: boolean;
|
|
29
|
+
reportedByOptions?: boolean;
|
|
30
|
+
modifiedByOptions?: boolean;
|
|
31
|
+
fieldOptions?: boolean;
|
|
32
|
+
activityOptions?: boolean;
|
|
33
|
+
pairedInOptions?: boolean;
|
|
34
|
+
availabilityOptions?: boolean;
|
|
35
|
+
module?: ApplicationModule;
|
|
36
|
+
status?: string;
|
|
37
|
+
skuOptions?: boolean;
|
|
38
|
+
statusOptions?: boolean;
|
|
39
|
+
typeOptions?: boolean;
|
|
40
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { AntennaPortDetail, HardwareDataType, HardwareDetailDataType } from '../types/hardware.type';
|
|
2
|
+
import { MultiSelectOption } from '../types/options.type';
|
|
3
|
+
export interface HardwareFetchResponse<T = HardwareDataType> {
|
|
4
|
+
message: string;
|
|
5
|
+
status: number;
|
|
6
|
+
data: {
|
|
7
|
+
data: T[];
|
|
8
|
+
totalRecords: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface HardwareFetchDetailResponse<T = HardwareDetailDataType> {
|
|
12
|
+
message: string;
|
|
13
|
+
status: number;
|
|
14
|
+
data: T;
|
|
15
|
+
}
|
|
16
|
+
export type HardwareFetchOptionResponse<Opt = Record<string, boolean>> = Record<keyof Opt, MultiSelectOption[]>;
|
|
17
|
+
export interface HardwareShortFetchResponse<T = AntennaPortDetail> {
|
|
18
|
+
message: string;
|
|
19
|
+
status: number;
|
|
20
|
+
data: T[];
|
|
21
|
+
}
|
|
22
|
+
export type HardwareFilterRaw = {
|
|
23
|
+
deviceName?: number[];
|
|
24
|
+
name?: number[];
|
|
25
|
+
type?: string[];
|
|
26
|
+
readerGroup?: number[];
|
|
27
|
+
readerType?: string;
|
|
28
|
+
networkStatus?: string[];
|
|
29
|
+
brand?: number[];
|
|
30
|
+
model?: number[];
|
|
31
|
+
status?: string[];
|
|
32
|
+
tag?: string;
|
|
33
|
+
sku?: string[];
|
|
34
|
+
groupModule?: string[];
|
|
35
|
+
antennaGroupModule?: string[];
|
|
36
|
+
antennaGroup?: number[];
|
|
37
|
+
userFullName?: number[];
|
|
38
|
+
action?: string[];
|
|
39
|
+
reportedBy?: number[];
|
|
40
|
+
createdAt?: number[];
|
|
41
|
+
lastReportDate?: number[];
|
|
42
|
+
};
|
|
43
|
+
export type HardwareFilterQuery = Partial<Record<keyof HardwareFilterRaw, string>>;
|
|
44
|
+
export type HardwareDetailFilterRaw = {
|
|
45
|
+
date?: number[];
|
|
46
|
+
readerId?: string;
|
|
47
|
+
groupModule?: string[];
|
|
48
|
+
antennaGroupModule?: string[];
|
|
49
|
+
action?: string[];
|
|
50
|
+
userFullName?: number[];
|
|
51
|
+
modifiedBy?: number[];
|
|
52
|
+
isActive?: string[];
|
|
53
|
+
field?: string[];
|
|
54
|
+
};
|
|
55
|
+
export type HardwareDetailFilterQuery = Partial<Record<keyof HardwareDetailFilterRaw, string>>;
|
|
56
|
+
export type DetailTableFilterParams = {
|
|
57
|
+
createdAt?: string;
|
|
58
|
+
activity?: string;
|
|
59
|
+
assetName?: string;
|
|
60
|
+
assignedTo?: string;
|
|
61
|
+
borrower?: string;
|
|
62
|
+
type?: string;
|
|
63
|
+
condition?: string;
|
|
64
|
+
reportedBy?: string;
|
|
65
|
+
staff?: string;
|
|
66
|
+
manager?: string;
|
|
67
|
+
group?: string;
|
|
68
|
+
tag?: string;
|
|
69
|
+
};
|
|
70
|
+
export type DetailTableFilteredParams = Partial<Record<keyof DetailTableFilterParams, string>>;
|
|
71
|
+
export interface PutEditAliasName {
|
|
72
|
+
aliasName: string;
|
|
73
|
+
}
|
|
74
|
+
export interface PutEditReaderGroup {
|
|
75
|
+
fixedAssetGroup?: string;
|
|
76
|
+
supplyAssetGroup?: string;
|
|
77
|
+
receivingFixedAssetGroup?: string[];
|
|
78
|
+
receivingSupplyAssetGroup?: string[];
|
|
79
|
+
}
|
|
80
|
+
export interface PutEditAntennaGroup {
|
|
81
|
+
group: Omit<PutEditReaderGroup, 'receivingFixedAssetGroup' | 'receivingSupplyAssetGroup'>[];
|
|
82
|
+
}
|
|
83
|
+
export interface PutEditAntennaPower {
|
|
84
|
+
power: number[];
|
|
85
|
+
}
|
|
86
|
+
export interface PutEditPortStatus {
|
|
87
|
+
data: {
|
|
88
|
+
isActive: boolean;
|
|
89
|
+
port: number;
|
|
90
|
+
}[];
|
|
91
|
+
}
|
|
92
|
+
export interface PutPingReadersBody {
|
|
93
|
+
ids: string[];
|
|
94
|
+
}
|
|
95
|
+
export interface PutHardwareStatusBody {
|
|
96
|
+
status: 'Missing' | 'Damaged' | 'Available';
|
|
97
|
+
ids?: string[];
|
|
98
|
+
}
|
|
99
|
+
export type HardwareFormType = PutEditAliasName | PutEditAntennaGroup | PutEditAntennaPower | PutHardwareStatusBody | PutEditReaderGroup;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MultiSelectOption } from '../types/options.type';
|
|
2
|
+
import { TAGCountType, TAGDataType } from '../types/tag.type';
|
|
3
|
+
export interface TAGFetchResponse<T = TAGDataType> {
|
|
4
|
+
message: string;
|
|
5
|
+
status: number;
|
|
6
|
+
data: {
|
|
7
|
+
data: T[];
|
|
8
|
+
totalRecords: number;
|
|
9
|
+
} & TAGCountType;
|
|
10
|
+
}
|
|
11
|
+
export type TAGFetchOptionResponse<Opt = Record<string, boolean>> = Record<keyof Opt, MultiSelectOption[]>;
|
|
12
|
+
export interface TAGFilterRaw {
|
|
13
|
+
rfidCode?: ('Yes' | 'No')[];
|
|
14
|
+
qrCode?: ('Yes' | 'No')[];
|
|
15
|
+
nfcCode?: ('Yes' | 'No')[];
|
|
16
|
+
sku?: string[];
|
|
17
|
+
type?: string[];
|
|
18
|
+
status?: string[];
|
|
19
|
+
pairedIn?: string[];
|
|
20
|
+
fixedAssetGroup?: number[];
|
|
21
|
+
supplyAssetGroup?: number[];
|
|
22
|
+
tag?: string[];
|
|
23
|
+
}
|
|
24
|
+
export type TAGFilterQuery = Partial<Record<keyof TAGFilterRaw, string>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FetchListResponse, FetchOptionResponse } from '../types/fetchResponse.type';
|
|
2
|
+
import { MultiSelectOption } from '../types/options.type';
|
|
3
|
+
import { TAGType } from '../types/tag.type';
|
|
4
|
+
import { TAGEventlogData } from '../types/tagEventlog.type';
|
|
5
|
+
export interface TAGEventlogFilterQuery {
|
|
6
|
+
status?: string[];
|
|
7
|
+
modifiedBy?: number[];
|
|
8
|
+
type?: TAGType;
|
|
9
|
+
}
|
|
10
|
+
export type TAGEventlogFetchResponse = FetchListResponse<TAGEventlogData>;
|
|
11
|
+
export type TAGEventlogFetchOptionResponse = FetchOptionResponse<{
|
|
12
|
+
modifiedByOptions?: MultiSelectOption[];
|
|
13
|
+
}>;
|
|
14
|
+
export type TAGEventlogDetailResponse = {
|
|
15
|
+
status: number;
|
|
16
|
+
message: string;
|
|
17
|
+
data: {
|
|
18
|
+
type: 'Audit' | 'Allocation';
|
|
19
|
+
detail: {
|
|
20
|
+
type: 'availableFound' | 'damagedMissingFound' | 'availableMarkDamagedMissing' | 'fixedAssetMoveToPortal' | 'supplyAssetMoveToPortal' | 'allocated';
|
|
21
|
+
isChecked?: boolean;
|
|
22
|
+
groupName?: string;
|
|
23
|
+
rfid?: number;
|
|
24
|
+
nfc?: number;
|
|
25
|
+
rfidQr?: number;
|
|
26
|
+
nfcQr?: number;
|
|
27
|
+
rfidNfc?: number;
|
|
28
|
+
rfidNfcQr?: number;
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { BooleanOptions } from '../dto/dataTable.dto';
|
|
3
|
+
import { HardwareFilterQuery } from '../dto/hardware.dto';
|
|
4
|
+
import { TAGFetchOptionResponse, TAGFetchResponse } from '../dto/tag.dto';
|
|
5
|
+
import { TAGType } from '../types/tag.type';
|
|
6
|
+
declare const GlobalTagServices: {
|
|
7
|
+
getTAGAllPaired: (tagType: TAGType, params?: HardwareFilterQuery) => Promise<AxiosResponse<TAGFetchResponse>>;
|
|
8
|
+
getTAGAllPairedOptions: (tagType: TAGType, params?: BooleanOptions) => Promise<AxiosResponse<{
|
|
9
|
+
data: TAGFetchOptionResponse;
|
|
10
|
+
}>>;
|
|
11
|
+
getTAGNotPaired: (tagType: TAGType, params?: HardwareFilterQuery) => Promise<AxiosResponse<TAGFetchResponse>>;
|
|
12
|
+
getTAGNotPairedOptions: (tagType: TAGType, params?: BooleanOptions) => Promise<AxiosResponse<{
|
|
13
|
+
data: TAGFetchOptionResponse;
|
|
14
|
+
}>>;
|
|
15
|
+
};
|
|
16
|
+
export default GlobalTagServices;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { BooleanOptions } from '../dto/dataTable.dto';
|
|
3
|
+
import { HardwareDetailFilterQuery, HardwareFetchDetailResponse, HardwareFetchOptionResponse, HardwareFetchResponse, HardwareFilterQuery, PutEditAliasName, PutEditAntennaGroup, PutEditAntennaPower, PutEditPortStatus, PutEditReaderGroup, PutHardwareStatusBody, PutPingReadersBody } from '../dto/hardware.dto';
|
|
4
|
+
import { AntennaPortDetail, HardwareDataType, HardwareDetailUserActivity } from '../types/hardware.type';
|
|
5
|
+
declare const HardwareServices: {
|
|
6
|
+
getHandheldReader: (params?: HardwareFilterQuery) => Promise<AxiosResponse<HardwareFetchResponse>>;
|
|
7
|
+
getHandheldReaderDetail: (handheldId?: string) => Promise<AxiosResponse<HardwareFetchDetailResponse>>;
|
|
8
|
+
getHandheldReaderOptions: (params?: BooleanOptions) => Promise<AxiosResponse<{
|
|
9
|
+
data: HardwareFetchOptionResponse;
|
|
10
|
+
}>>;
|
|
11
|
+
putMarkHandheldStatus: (body: PutHardwareStatusBody) => Promise<AxiosResponse>;
|
|
12
|
+
putPingReaders: (body: PutPingReadersBody) => Promise<AxiosResponse>;
|
|
13
|
+
putMarkIOTStatus: (body: PutHardwareStatusBody, subTab: "iot-reader" | "antenna") => Promise<AxiosResponse>;
|
|
14
|
+
putEditReaderGroup: (moduleTab: "iot" | "handheld", body: PutEditReaderGroup, hardwareId?: string) => Promise<AxiosResponse>;
|
|
15
|
+
putEditAntennaGroup: (body: PutEditAntennaGroup, hardwareId?: string) => Promise<AxiosResponse>;
|
|
16
|
+
putEditPortStatus: (body: PutEditPortStatus, hardwareId?: string) => Promise<AxiosResponse>;
|
|
17
|
+
putEditAliasName: (moduleTab: "iot" | "handheld", body: PutEditAliasName, hardwareId?: string) => Promise<AxiosResponse>;
|
|
18
|
+
putAntennaPower: (body: PutEditAntennaPower, iotId?: string) => Promise<AxiosResponse>;
|
|
19
|
+
getIOTReaderOrAntenna: (subTab: "iot-reader" | "antenna", params?: HardwareFilterQuery) => Promise<AxiosResponse<HardwareFetchResponse>>;
|
|
20
|
+
getIOTReaderDetail: (iotId?: string) => Promise<AxiosResponse<HardwareFetchDetailResponse>>;
|
|
21
|
+
getIOTReaderOrAntennaOptions: (subTab: "iot-reader" | "antenna", params?: BooleanOptions) => Promise<AxiosResponse<{
|
|
22
|
+
data: HardwareFetchOptionResponse;
|
|
23
|
+
}>>;
|
|
24
|
+
getActivityLog: (params?: HardwareFilterQuery) => Promise<AxiosResponse<HardwareFetchResponse<HardwareDataType>>>;
|
|
25
|
+
getActivityLogOptions: (params?: BooleanOptions) => Promise<AxiosResponse<{
|
|
26
|
+
data: HardwareFetchOptionResponse;
|
|
27
|
+
}>>;
|
|
28
|
+
getDetailActivityLog: (params?: HardwareDetailFilterQuery) => Promise<AxiosResponse<HardwareFetchResponse<HardwareDetailUserActivity>>>;
|
|
29
|
+
getDetailActivityLogOptions: (params?: BooleanOptions) => Promise<AxiosResponse<{
|
|
30
|
+
data: HardwareFetchOptionResponse;
|
|
31
|
+
}>>;
|
|
32
|
+
getExistingAliasNames: () => Promise<AxiosResponse>;
|
|
33
|
+
getIotReaderPort: (id: string, params?: HardwareDetailFilterQuery) => Promise<AxiosResponse<HardwareFetchResponse<AntennaPortDetail>>>;
|
|
34
|
+
};
|
|
35
|
+
export default HardwareServices;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { BooleanOptions } from '../dto/dataTable.dto';
|
|
3
|
+
import { TAGEventlogDetailResponse, TAGEventlogFetchOptionResponse, TAGEventlogFetchResponse, TAGEventlogFilterQuery } from '../dto/tagEventlog.dto';
|
|
4
|
+
declare const TagEventlogServices: {
|
|
5
|
+
getTAGEventlog: (params?: TAGEventlogFilterQuery) => Promise<AxiosResponse<TAGEventlogFetchResponse>>;
|
|
6
|
+
getTAGEventlogOptions: (params?: BooleanOptions) => Promise<AxiosResponse<{
|
|
7
|
+
data: TAGEventlogFetchOptionResponse;
|
|
8
|
+
}>>;
|
|
9
|
+
getDetailTAGEventlog: (eventlogId?: string) => Promise<AxiosResponse<TAGEventlogDetailResponse>>;
|
|
10
|
+
};
|
|
11
|
+
export default TagEventlogServices;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export type HardwareTabType = 'activity-log' | 'handheld-damaged-missing' | 'handheld' | 'iot-reader' | 'iot-antenna' | 'iot-damaged-missing-reader' | 'iot-damaged-missing-antenna';
|
|
2
|
+
export type HardwareDetailTabType = 'All' | 'Tagging' | 'User' | 'Antenna' | 'Changelog';
|
|
3
|
+
export type ModuleGroup = {
|
|
4
|
+
_id: string;
|
|
5
|
+
key: number;
|
|
6
|
+
name: string;
|
|
7
|
+
module: 'fixedAsset' | 'supplyAsset';
|
|
8
|
+
};
|
|
9
|
+
export interface HardwareDataType {
|
|
10
|
+
_id: string;
|
|
11
|
+
imageSmall?: string;
|
|
12
|
+
imageBig?: string;
|
|
13
|
+
name: string;
|
|
14
|
+
sku: string;
|
|
15
|
+
aliasName?: string;
|
|
16
|
+
brand?: string;
|
|
17
|
+
model?: string;
|
|
18
|
+
type: string;
|
|
19
|
+
networkStatus?: 'Online' | 'Offline';
|
|
20
|
+
status: string;
|
|
21
|
+
createdAt?: string;
|
|
22
|
+
updatedAt?: string;
|
|
23
|
+
group?: ModuleGroup[];
|
|
24
|
+
antennaGroup?: {
|
|
25
|
+
port?: number;
|
|
26
|
+
groups?: ModuleGroup[];
|
|
27
|
+
}[];
|
|
28
|
+
activePort?: string;
|
|
29
|
+
reportedBy?: string;
|
|
30
|
+
lastReportDate?: string;
|
|
31
|
+
action?: string;
|
|
32
|
+
userFullName?: string;
|
|
33
|
+
readerName?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface HardwareDetailDataType {
|
|
36
|
+
_id: string;
|
|
37
|
+
imageSmall?: string;
|
|
38
|
+
imageBig?: string;
|
|
39
|
+
readerName?: string;
|
|
40
|
+
serialNumber?: string;
|
|
41
|
+
name: {
|
|
42
|
+
_id: string;
|
|
43
|
+
nameWithSequence: string;
|
|
44
|
+
name: string;
|
|
45
|
+
key: number;
|
|
46
|
+
nameNumber?: number;
|
|
47
|
+
};
|
|
48
|
+
aliasName?: string;
|
|
49
|
+
networkStatus?: 'Online' | 'Offline';
|
|
50
|
+
lastReportDate?: string;
|
|
51
|
+
group?: ModuleGroup[];
|
|
52
|
+
brand?: {
|
|
53
|
+
name?: string;
|
|
54
|
+
key?: number;
|
|
55
|
+
};
|
|
56
|
+
model?: {
|
|
57
|
+
name?: string;
|
|
58
|
+
key?: number;
|
|
59
|
+
};
|
|
60
|
+
manager?: {
|
|
61
|
+
_id: string;
|
|
62
|
+
name?: string;
|
|
63
|
+
key?: number;
|
|
64
|
+
};
|
|
65
|
+
type: string;
|
|
66
|
+
status: string;
|
|
67
|
+
key: number;
|
|
68
|
+
}
|
|
69
|
+
export interface AntennaPortDetail {
|
|
70
|
+
_id: number;
|
|
71
|
+
isActive: boolean;
|
|
72
|
+
port: string;
|
|
73
|
+
group: ModuleGroup[];
|
|
74
|
+
antennaPower: string;
|
|
75
|
+
powerInt: number;
|
|
76
|
+
invalid?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface HardwareDetailUserActivity {
|
|
79
|
+
_id: string;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
userFullName?: string;
|
|
82
|
+
action?: string;
|
|
83
|
+
objectName?: string;
|
|
84
|
+
field?: string;
|
|
85
|
+
oldValue?: string;
|
|
86
|
+
newValue?: string;
|
|
87
|
+
modifiedBy?: string;
|
|
88
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type TAGType = 'rfid' | 'nfc';
|
|
2
|
+
export type TAGTabType = 'all' | 'paired' | 'not-paired' | 'combine-tag';
|
|
3
|
+
export type ApplicationModule = 'Settings Portal' | 'Fixed Asset' | 'Supply Asset';
|
|
4
|
+
export interface TAGCountType {
|
|
5
|
+
settingsPortalAvailable?: number;
|
|
6
|
+
settingsPortalDamagedMissing?: number;
|
|
7
|
+
fixedAssetAvailable?: number;
|
|
8
|
+
fixedAssetDamagedMissing?: number;
|
|
9
|
+
supplyAssetAvailable?: number;
|
|
10
|
+
supplyAssetDamagedMissing?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface TAGDataType {
|
|
13
|
+
_id: string;
|
|
14
|
+
rfidCode: string;
|
|
15
|
+
nfcCode: string;
|
|
16
|
+
qrCode: string;
|
|
17
|
+
sku: string;
|
|
18
|
+
type: 'Asset TAG' | 'User TAG';
|
|
19
|
+
status: 'Available' | 'Paired' | 'Damaged/Missing';
|
|
20
|
+
pairedIn: ApplicationModule;
|
|
21
|
+
}
|