@tagsamurai/gsts-api-services 1.0.1-alpha.18 → 1.0.1-alpha.19
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
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import S from "axios";
|
|
2
2
|
const T = { 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" }, d = (t = "APP_TAGSAMURAI_API") => T["VITE_" + t], o = (t = {}, e = !1) => {
|
|
3
3
|
const {
|
|
4
|
-
env:
|
|
4
|
+
env: n = "APP_GLOBAL_SETTINGS_API",
|
|
5
5
|
prefix: v = "",
|
|
6
6
|
headers: p = {},
|
|
7
7
|
...P
|
|
8
|
-
} = t, $ = `${d(
|
|
8
|
+
} = t, $ = `${d(n)}${v}`, l = JSON.parse(localStorage.getItem("user") ?? "{}"), I = l.jwt ?? l.token ?? "";
|
|
9
9
|
return S.create({
|
|
10
10
|
...P,
|
|
11
11
|
baseURL: $,
|
|
@@ -15,24 +15,24 @@ const T = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
15
15
|
...p
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
},
|
|
18
|
+
}, G = (t) => {
|
|
19
19
|
if (!t) return;
|
|
20
20
|
const e = d("APP_TAGSAMURAI_API");
|
|
21
21
|
return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
|
|
22
|
-
},
|
|
22
|
+
}, y = (t) => {
|
|
23
23
|
if (!t || typeof t == "string")
|
|
24
24
|
return;
|
|
25
25
|
const e = {};
|
|
26
|
-
return Object.keys(t).forEach((
|
|
27
|
-
Array.isArray(t[
|
|
28
|
-
[
|
|
29
|
-
}) : t[
|
|
30
|
-
[
|
|
26
|
+
return Object.keys(t).forEach((n) => {
|
|
27
|
+
Array.isArray(t[n]) ? t[n].length > 0 && Object.assign(e, {
|
|
28
|
+
[n]: JSON.stringify(t[n])
|
|
29
|
+
}) : t[n] !== void 0 && Object.assign(e, {
|
|
30
|
+
[n]: t[n]
|
|
31
31
|
});
|
|
32
32
|
}), e;
|
|
33
33
|
}, f = o({
|
|
34
34
|
prefix: "/v1/global-settings/auth"
|
|
35
|
-
}), O = () => f.post("/logout"),
|
|
35
|
+
}), O = () => f.post("/logout"), E = { logout: O }, c = o({
|
|
36
36
|
prefix: "/v1/global-settings/change-log"
|
|
37
37
|
}), R = {
|
|
38
38
|
getChangelogs: (t) => c.get("", { params: t }),
|
|
@@ -58,7 +58,8 @@ const T = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
58
58
|
getScanTAG: (t, e) => i.get(`/${t}/scan`, { params: e }),
|
|
59
59
|
putDetailAuditTAG: (t, e) => i.put(`/${t}/audit-detail`, e),
|
|
60
60
|
putAuditTAG: (t, e) => i.put(`/${t}/audit`, e),
|
|
61
|
-
putAllocateTAG: (t, e) => i.put(`/${t}/allocate`, e)
|
|
61
|
+
putAllocateTAG: (t, e) => i.put(`/${t}/allocate`, e),
|
|
62
|
+
putCombineTAG: (t) => i.put("/combine", t)
|
|
62
63
|
}, r = o({
|
|
63
64
|
prefix: "/v1/global-settings"
|
|
64
65
|
}), U = {
|
|
@@ -68,14 +69,14 @@ const T = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
68
69
|
putMarkHandheldStatus: (t) => r.put("/reader/mark-status", t),
|
|
69
70
|
putPingReaders: (t) => r.put("/iot-reader/ping", t),
|
|
70
71
|
putMarkIOTStatus: (t, e) => r.put(`/${e}/mark-status`, t),
|
|
71
|
-
putEditReaderGroup: (t, e,
|
|
72
|
-
`/${t === "iot" ? "iot-" : ""}reader/${
|
|
72
|
+
putEditReaderGroup: (t, e, n) => r.put(
|
|
73
|
+
`/${t === "iot" ? "iot-" : ""}reader/${n}/set-group`,
|
|
73
74
|
e
|
|
74
75
|
),
|
|
75
76
|
putEditAntennaGroup: (t, e) => r.put(`/iot-reader/${e}/set-port-group`, t),
|
|
76
77
|
putEditPortStatus: (t, e) => r.put(`/iot-reader/${e}/set-port-status`, t),
|
|
77
|
-
putEditAliasName: (t, e,
|
|
78
|
-
`/${t === "iot" ? "iot-" : ""}reader/${
|
|
78
|
+
putEditAliasName: (t, e, n) => r.put(
|
|
79
|
+
`/${t === "iot" ? "iot-" : ""}reader/${n}/set-alias-name`,
|
|
79
80
|
e
|
|
80
81
|
),
|
|
81
82
|
putAntennaPower: (t, e) => r.put(`/iot-reader/${e}/set-antenna-power`, t),
|
|
@@ -120,39 +121,39 @@ const T = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
120
121
|
getTAGEventlog: (t) => u.get("/tag-event-log", { params: t }),
|
|
121
122
|
getTAGEventlogOptions: (t) => u.get("/tag-event-log/options", { params: t }),
|
|
122
123
|
getDetailTAGEventlog: (t) => u.get(`/tag-event-log/${t}`)
|
|
123
|
-
},
|
|
124
|
+
}, s = o({
|
|
124
125
|
prefix: "/v1/global-settings/user"
|
|
125
126
|
}), M = {
|
|
126
|
-
getUsers: (t) =>
|
|
127
|
-
getUserDetail: (t) =>
|
|
128
|
-
getUserSystemLogs: (t, e) =>
|
|
127
|
+
getUsers: (t) => s.get("", { params: t }),
|
|
128
|
+
getUserDetail: (t) => s.get(`/${t}`),
|
|
129
|
+
getUserSystemLogs: (t, e) => s.get(`/${t}/system-logs`, { params: e }),
|
|
129
130
|
getUserSystemLogOptions: (t, e) => {
|
|
130
|
-
const
|
|
131
|
-
return
|
|
131
|
+
const n = {};
|
|
132
|
+
return n[e] = !0, s.get(`/${t}/system-logs/options`, { params: n });
|
|
132
133
|
},
|
|
133
134
|
postCreateUser: (t) => {
|
|
134
135
|
const e = { "Content-Type": "multipart/form-data" };
|
|
135
|
-
return
|
|
136
|
+
return s.post("", t, { headers: e });
|
|
136
137
|
},
|
|
137
138
|
putEditUser: (t, e) => {
|
|
138
|
-
const
|
|
139
|
-
return
|
|
139
|
+
const n = { "Content-Type": "multipart/form-data" };
|
|
140
|
+
return s.put(`/${t}`, e, { headers: n });
|
|
140
141
|
},
|
|
141
142
|
deleteUsers: (t) => {
|
|
142
143
|
const e = { id: JSON.stringify(t) };
|
|
143
|
-
return
|
|
144
|
+
return s.delete("", { params: e });
|
|
144
145
|
},
|
|
145
|
-
putToggleStatusUsers: (t) =>
|
|
146
|
+
putToggleStatusUsers: (t) => s.put("/active-status", t),
|
|
146
147
|
getUserOptions: (t) => {
|
|
147
148
|
const e = {};
|
|
148
|
-
return e[t] = !0,
|
|
149
|
+
return e[t] = !0, s.get("/options", { params: e });
|
|
149
150
|
},
|
|
150
|
-
deleteCancelEmailChange: (t) =>
|
|
151
|
-
postResendEmail: (t) =>
|
|
152
|
-
putChangePassword: (t, e) =>
|
|
151
|
+
deleteCancelEmailChange: (t) => s.delete(`/cancel-email-change/${t}`),
|
|
152
|
+
postResendEmail: (t) => s.post("/resend-email", t),
|
|
153
|
+
putChangePassword: (t, e) => s.put(`/change-password/${t}`, e)
|
|
153
154
|
};
|
|
154
155
|
export {
|
|
155
|
-
|
|
156
|
+
E as AuthServices,
|
|
156
157
|
R as ChangelogServices,
|
|
157
158
|
D as DivisionServices,
|
|
158
159
|
L as GlobalTagServices,
|
|
@@ -164,6 +165,6 @@ export {
|
|
|
164
165
|
N as TagServices,
|
|
165
166
|
M as UserServices,
|
|
166
167
|
d as getBaseURL,
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
G as getImageURL,
|
|
169
|
+
y as queryParamsStringfy
|
|
169
170
|
};
|
package/api-services.system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["axios"],function(s,
|
|
1
|
+
System.register(["axios"],function(s,h){"use strict";var p;return{setters:[l=>{p=l.default}],execute:function(){const l={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"},A=s("getBaseURL",(t="APP_TAGSAMURAI_API")=>l["VITE_"+t]),o=(t={},e=!1)=>{const{env:n="APP_GLOBAL_SETTINGS_API",prefix:f="",headers:P={},...O}=t,_=`${A(n)}${f}`,S=JSON.parse(localStorage.getItem("user")??"{}"),m=S.jwt??S.token??"";return p.create({...O,baseURL:_,headers:e?P:{"Content-Type":"application/json",Authorization:`Bearer ${m}`,...P}})},y=s("getImageURL",t=>{if(!t)return;const e=A("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),G=s("queryParamsStringfy",t=>{if(!t||typeof t=="string")return;const e={};return Object.keys(t).forEach(n=>{Array.isArray(t[n])?t[n].length>0&&Object.assign(e,{[n]:JSON.stringify(t[n])}):t[n]!==void 0&&Object.assign(e,{[n]:t[n]})}),e}),$=o({prefix:"/v1/global-settings/auth"}),L=s("AuthServices",{logout:()=>$.post("/logout")}),d=o({prefix:"/v1/global-settings/change-log"}),R=s("ChangelogServices",{getChangelogs:t=>d.get("",{params:t}),getChangelogOptions:t=>d.get("/options",{params:t})}),g=o({prefix:"/v1/global-settings/division"}),U=s("DivisionServices",{getDivisions:t=>g.get("",{params:t}),getDivisionDetail:t=>g.get(`/${t}`),postCreateDivision:t=>g.post("/",t),putEditDivision:(t,e)=>g.put(`/${t}`,e),deleteDivisions:t=>{const e={id:JSON.stringify(t)};return g.delete("",{params:e})}}),a=o({prefix:"/v1/global-settings"}),D=s("GlobalTagServices",{getTAGAllPaired:(t,e)=>a.get(`/${t}`,{params:e}),getTAGAllPairedOptions:(t,e)=>a.get(`/${t}/options`,{params:e}),getTAGNotPaired:(t,e)=>a.get(`/${t}/not-paired`,{params:e}),getTAGNotPairedOptions:(t,e)=>a.get(`/${t}/not-paired/options`,{params:e}),getScanTAG:(t,e)=>a.get(`/${t}/scan`,{params:e}),putDetailAuditTAG:(t,e)=>a.put(`/${t}/audit-detail`,e),putAuditTAG:(t,e)=>a.put(`/${t}/audit`,e),putAllocateTAG:(t,e)=>a.put(`/${t}/allocate`,e),putCombineTAG:t=>a.put("/combine",t)}),r=o({prefix:"/v1/global-settings"}),b=s("HardwareServices",{getHandheldReader:t=>r.get("/reader",{params:t}),getHandheldReaderDetail:t=>r.get(`/reader/${t}`),getHandheldReaderOptions:t=>r.get("/reader/options",{params:t}),putMarkHandheldStatus:t=>r.put("/reader/mark-status",t),putPingReaders:t=>r.put("/iot-reader/ping",t),putMarkIOTStatus:(t,e)=>r.put(`/${e}/mark-status`,t),putEditReaderGroup:(t,e,n)=>r.put(`/${t==="iot"?"iot-":""}reader/${n}/set-group`,e),putEditAntennaGroup:(t,e)=>r.put(`/iot-reader/${e}/set-port-group`,t),putEditPortStatus:(t,e)=>r.put(`/iot-reader/${e}/set-port-status`,t),putEditAliasName:(t,e,n)=>r.put(`/${t==="iot"?"iot-":""}reader/${n}/set-alias-name`,e),putAntennaPower:(t,e)=>r.put(`/iot-reader/${e}/set-antenna-power`,t),getIOTReaderOrAntenna:(t,e)=>r.get(`/${t}`,{params:e}),getIOTReaderDetail:t=>r.get(`/iot-reader/${t}`),getIOTReaderOrAntennaOptions:(t,e)=>r.get(`/${t}/options`,{params:e}),getActivityLog:t=>r.get("/activity-log",{params:t}),getActivityLogOptions:t=>r.get("/activity-log/options",{params:t}),getDetailActivityLog:t=>r.get("/activity-log",{params:t}),getDetailActivityLogOptions:t=>r.get("/activity-log/options",{params:t}),getExistingAliasNames:()=>r.get("/reader/alias-names"),getIotReaderPort:(t,e)=>r.get(`/iot-reader/${t}/ports`,{params:e})}),I=o({env:"APP_LOGS_NOTIFICATION_API",prefix:"/v2"}),C=s("LogServices",{getSessionLogList:t=>I.get("/session-log",{params:t})}),v=o({prefix:"/v1/global-settings/option"}),N=s("OptionServices",{getPositions:()=>v.get("/position"),getDivisions:()=>v.get("/division")}),u=o({prefix:"/v1/global-settings/position"}),w=s("PositionServices",{getPositions:t=>u.get("",{params:t}),getPositionDetail:t=>u.get(`/${t}`),postCreatePosition:t=>u.post("/",t),putEditPosition:(t,e)=>u.put(`/${t}`,e),deletePositions:t=>{const e={id:JSON.stringify(t)};return u.delete("",{params:e})}}),T=o({env:"APP_TAGSAMURAI_API",prefix:"/tag/v2"}),B=s("TagServices",{getTagInfo:t=>T.get("/rfid-qr/scan",{params:t})}),c=o({prefix:"/v1/global-settings/change-log"}),M=s("TagEventlogServices",{getTAGEventlog:t=>c.get("/tag-event-log",{params:t}),getTAGEventlogOptions:t=>c.get("/tag-event-log/options",{params:t}),getDetailTAGEventlog:t=>c.get(`/tag-event-log/${t}`)}),i=o({prefix:"/v1/global-settings/user"}),j=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 n={};return n[e]=!0,i.get(`/${t}/system-logs/options`,{params:n})},postCreateUser:t=>{const e={"Content-Type":"multipart/form-data"};return i.post("",t,{headers:e})},putEditUser:(t,e)=>{const n={"Content-Type":"multipart/form-data"};return i.put(`/${t}`,e,{headers:n})},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
package/src/dto/tag.dto.d.ts
CHANGED
|
@@ -41,3 +41,12 @@ export interface PUTAllocateTAGBody {
|
|
|
41
41
|
group?: number;
|
|
42
42
|
module?: ApplicationModule;
|
|
43
43
|
}
|
|
44
|
+
export type CombineSeparateActions = 'Combine RFID & QR' | 'Combine RFID & NFC' | 'Combine RFID & NFC & QR' | 'Combine NFC & QR' | 'Separate RFID & QR' | 'Separate RFID & NFC' | 'Separate RFID & NFC & QR' | 'Separate NFC & QR';
|
|
45
|
+
export interface PUTCombineTAGBody {
|
|
46
|
+
ids: {
|
|
47
|
+
rfid?: string;
|
|
48
|
+
nfc?: string;
|
|
49
|
+
qr?: string;
|
|
50
|
+
}[];
|
|
51
|
+
action: CombineSeparateActions;
|
|
52
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { BooleanOptions } from '../dto/dataTable.dto';
|
|
3
3
|
import { HardwareFilterQuery } from '../dto/hardware.dto';
|
|
4
|
-
import { PUTAllocateTAGBody, PUTAuditTAGBody, TAGDetailAuditResponse, TAGFetchOptionResponse, TAGFetchResponse } from '../dto/tag.dto';
|
|
4
|
+
import { PUTAllocateTAGBody, PUTAuditTAGBody, PUTCombineTAGBody, TAGDetailAuditResponse, TAGFetchOptionResponse, TAGFetchResponse } from '../dto/tag.dto';
|
|
5
5
|
import { FetchResponse } from '../types/fetchResponse.type';
|
|
6
6
|
import { TAGType } from '../types/tag.type';
|
|
7
7
|
declare const GlobalTagServices: {
|
|
@@ -21,5 +21,6 @@ declare const GlobalTagServices: {
|
|
|
21
21
|
}) => Promise<AxiosResponse<TAGDetailAuditResponse>>;
|
|
22
22
|
putAuditTAG: (tagType: TAGType, body: PUTAuditTAGBody) => Promise<AxiosResponse<FetchResponse>>;
|
|
23
23
|
putAllocateTAG: (tagType: TAGType, body: PUTAllocateTAGBody) => Promise<AxiosResponse<FetchResponse>>;
|
|
24
|
+
putCombineTAG: (body: PUTCombineTAGBody) => Promise<AxiosResponse<FetchResponse>>;
|
|
24
25
|
};
|
|
25
26
|
export default GlobalTagServices;
|