@tagsamurai/gsts-api-services 2.0.1-alpha.27 → 2.0.1-alpha.29
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 +133 -115
- package/package.json +1 -1
- package/src/dto/changelog.dto.d.ts +22 -12
- package/src/dto/iam.dto.d.ts +17 -0
- package/src/services/changelog.service.d.ts +5 -2
- package/src/services/iam.service.d.ts +8 -2
- package/src/types/changelog.type.d.ts +2 -11
- package/src/types/iam.type.d.ts +20 -0
package/api-services.es.js
CHANGED
|
@@ -2,33 +2,33 @@ import R from "axios";
|
|
|
2
2
|
const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_GLOBAL_SETTINGS_API: "https://dev-api.global-settings.tagsamurai.com", VITE_APP_IMAGE_BASE_URL: "https://dev-api.tagsamurai.com/fam/utility/v2/files", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, I = (t = "APP_TAGSAMURAI_API") => U["VITE_" + t], p = (t = {}, e = !1) => {
|
|
3
3
|
const {
|
|
4
4
|
env: r = "APP_GLOBAL_SETTINGS_API",
|
|
5
|
-
prefix:
|
|
6
|
-
headers:
|
|
5
|
+
prefix: n = "",
|
|
6
|
+
headers: u = {},
|
|
7
7
|
...l
|
|
8
|
-
} = t, w = "".concat(I(r)).concat(
|
|
8
|
+
} = t, w = "".concat(I(r)).concat(n), h = R.create({
|
|
9
9
|
...l,
|
|
10
10
|
baseURL: w,
|
|
11
|
-
headers: e ?
|
|
11
|
+
headers: e ? u : {
|
|
12
12
|
"Content-Type": "application/json",
|
|
13
|
-
...
|
|
13
|
+
...u
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
return
|
|
16
|
+
return h.interceptors.request.use((A) => {
|
|
17
17
|
var S, y, $;
|
|
18
18
|
const P = JSON.parse((S = localStorage.getItem("user")) != null ? S : "{}"), O = ($ = (y = P.jwt) != null ? y : P.token) != null ? $ : "";
|
|
19
|
-
return
|
|
20
|
-
}),
|
|
19
|
+
return A.headers.Authorization = "Bearer ".concat(O), A;
|
|
20
|
+
}), h;
|
|
21
21
|
}, c = p({
|
|
22
22
|
prefix: "/v1/global-settings/auth"
|
|
23
|
-
}),
|
|
24
|
-
var e, r,
|
|
25
|
-
return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((
|
|
23
|
+
}), L = (t) => {
|
|
24
|
+
var e, r, n, u;
|
|
25
|
+
return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((u = (n = t.response) == null ? void 0 : n.data) == null ? void 0 : u.message) === "jwt malformed" ? (window.onblur = null, window.onfocus = null, window.sessionExpired = !0, window.dispatchEvent(new CustomEvent("user:expired"))) : Promise.reject(t);
|
|
26
26
|
}, k = {
|
|
27
27
|
login: (t) => {
|
|
28
28
|
const e = { ...t, isMobile: !1 };
|
|
29
29
|
return c.post("/login", e);
|
|
30
30
|
},
|
|
31
|
-
reLogin: (t) => (c.interceptors.response.use((e) => e,
|
|
31
|
+
reLogin: (t) => (c.interceptors.response.use((e) => e, L), c.post("/login", t)),
|
|
32
32
|
requestOTP: (t) => {
|
|
33
33
|
const e = { email: t };
|
|
34
34
|
return c.post("/request-otp", e);
|
|
@@ -49,19 +49,19 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
49
49
|
* @deprecated use postLogout instead
|
|
50
50
|
*/
|
|
51
51
|
logout: () => c.post("/logout")
|
|
52
|
-
},
|
|
53
|
-
const
|
|
54
|
-
let
|
|
52
|
+
}, E = (t, e, r) => {
|
|
53
|
+
const n = new URL(I("APP_TAGSAMURAI_API") || "").origin;
|
|
54
|
+
let u = t.startsWith("http") ? t : "".concat(n, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
|
|
55
55
|
if (e || r) {
|
|
56
56
|
const l = new URLSearchParams();
|
|
57
|
-
e && (l.set("width", e.toString()), l.set("height", (r == null ? void 0 : r.toString()) || e.toString())),
|
|
57
|
+
e && (l.set("width", e.toString()), l.set("height", (r == null ? void 0 : r.toString()) || e.toString())), u += "?".concat(l.toString());
|
|
58
58
|
}
|
|
59
|
-
return
|
|
59
|
+
return u;
|
|
60
60
|
}, _ = () => {
|
|
61
|
-
var e, r,
|
|
61
|
+
var e, r, n;
|
|
62
62
|
const t = JSON.parse((e = localStorage.getItem("user")) != null ? e : "{}");
|
|
63
|
-
return (
|
|
64
|
-
},
|
|
63
|
+
return (n = (r = t.jwt) != null ? r : t.token) != null ? n : "";
|
|
64
|
+
}, C = async (t, e) => {
|
|
65
65
|
const r = await fetch(t, {
|
|
66
66
|
headers: {
|
|
67
67
|
Authorization: "Bearer ".concat(e)
|
|
@@ -69,22 +69,22 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
69
69
|
});
|
|
70
70
|
if (!r.ok)
|
|
71
71
|
throw new Error("Image fetch failed: ".concat(r.status, " ").concat(r.statusText));
|
|
72
|
-
const
|
|
73
|
-
return new Blob([
|
|
72
|
+
const n = await r.arrayBuffer();
|
|
73
|
+
return new Blob([n], {
|
|
74
74
|
type: r.headers.get("Content-Type") || "image/webp"
|
|
75
75
|
});
|
|
76
|
-
},
|
|
76
|
+
}, N = async (t) => {
|
|
77
77
|
try {
|
|
78
|
-
const e = _(), r = await
|
|
78
|
+
const e = _(), r = await C(t, e);
|
|
79
79
|
return URL.createObjectURL(r);
|
|
80
80
|
} catch (e) {
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, J = async (t, e, r, n) => {
|
|
84
84
|
if (!t) return;
|
|
85
|
-
const
|
|
86
|
-
return
|
|
87
|
-
},
|
|
85
|
+
const u = E(t, e, r);
|
|
86
|
+
return n ? u : N(u);
|
|
87
|
+
}, H = (t) => {
|
|
88
88
|
if (!t || typeof t == "string")
|
|
89
89
|
return;
|
|
90
90
|
const e = {};
|
|
@@ -95,7 +95,7 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
95
95
|
[r]: t[r]
|
|
96
96
|
});
|
|
97
97
|
}), e;
|
|
98
|
-
},
|
|
98
|
+
}, x = (t) => {
|
|
99
99
|
if (typeof t != "string") return !1;
|
|
100
100
|
const e = t.trim();
|
|
101
101
|
if (!e) return !1;
|
|
@@ -104,19 +104,22 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
104
104
|
} catch (r) {
|
|
105
105
|
return !1;
|
|
106
106
|
}
|
|
107
|
-
},
|
|
107
|
+
}, a = (t) => {
|
|
108
108
|
if (!t)
|
|
109
109
|
return {};
|
|
110
110
|
const e = {};
|
|
111
111
|
return Object.keys(t).forEach((r) => {
|
|
112
|
-
const
|
|
113
|
-
e[r] =
|
|
112
|
+
const n = t[r];
|
|
113
|
+
e[r] = x(n) ? JSON.parse(n.trim()) : n;
|
|
114
114
|
}), e;
|
|
115
115
|
}, T = p({
|
|
116
|
-
prefix: "/
|
|
116
|
+
prefix: "v2/analytics-reporting"
|
|
117
117
|
}), j = {
|
|
118
|
-
getChangelogs: (t) =>
|
|
119
|
-
|
|
118
|
+
getChangelogs: (t) => {
|
|
119
|
+
const e = a(t);
|
|
120
|
+
return T.post("/change-log/list", e);
|
|
121
|
+
},
|
|
122
|
+
getChangelogOptions: (t) => T.post("/change-log/options", t)
|
|
120
123
|
}, m = p({
|
|
121
124
|
prefix: "/v1/global-settings/division"
|
|
122
125
|
}), B = {
|
|
@@ -128,84 +131,84 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
128
131
|
const e = { id: JSON.stringify(t) };
|
|
129
132
|
return m.delete("", { params: e });
|
|
130
133
|
}
|
|
131
|
-
},
|
|
134
|
+
}, d = p({
|
|
132
135
|
prefix: "/v2/hardware-tagging"
|
|
133
136
|
}), q = {
|
|
134
137
|
getAllTAG: (t) => {
|
|
135
|
-
const e =
|
|
136
|
-
return
|
|
138
|
+
const e = a(t);
|
|
139
|
+
return d.post("/all-tag/list", e);
|
|
137
140
|
},
|
|
138
141
|
getAllTAGOptions: (t) => {
|
|
139
|
-
const e =
|
|
140
|
-
return
|
|
142
|
+
const e = a(t);
|
|
143
|
+
return d.post("all-tag/options", e);
|
|
141
144
|
},
|
|
142
|
-
getNotPairedYetCounts: () =>
|
|
145
|
+
getNotPairedYetCounts: () => d.get("/not-paired-yet/tag-count"),
|
|
143
146
|
getNotPairedYetList: (t) => {
|
|
144
|
-
const e =
|
|
145
|
-
return
|
|
147
|
+
const e = a(t);
|
|
148
|
+
return d.post("/not-paired-yet/list", e);
|
|
146
149
|
},
|
|
147
150
|
getNotPairedYetOptions: (t) => {
|
|
148
|
-
const e =
|
|
149
|
-
return
|
|
151
|
+
const e = a(t);
|
|
152
|
+
return d.post("/not-paired-yet/options", e);
|
|
150
153
|
},
|
|
151
|
-
getAuditTAGDetail: (t) =>
|
|
152
|
-
submitAuditTAG: (t) =>
|
|
153
|
-
submitCombineTAG: (t) =>
|
|
154
|
-
submitSeparateTAG: (t) =>
|
|
154
|
+
getAuditTAGDetail: (t) => d.post("/audit/detail", t),
|
|
155
|
+
submitAuditTAG: (t) => d.post("/audit/submit", t),
|
|
156
|
+
submitCombineTAG: (t) => d.post("/combine-tag/combine", t),
|
|
157
|
+
submitSeparateTAG: (t) => d.post("/combine-tag/separate", t),
|
|
155
158
|
getPairedList: (t) => {
|
|
156
|
-
const e =
|
|
157
|
-
return
|
|
159
|
+
const e = a(t);
|
|
160
|
+
return d.post("/paired/list", e);
|
|
158
161
|
},
|
|
159
162
|
getPairedOptions: (t) => {
|
|
160
|
-
const e =
|
|
161
|
-
return
|
|
163
|
+
const e = a(t);
|
|
164
|
+
return d.post("/paired/options", e);
|
|
162
165
|
},
|
|
163
|
-
getScanTag: (t) =>
|
|
164
|
-
},
|
|
166
|
+
getScanTag: (t) => d.get("/scan-tag", { params: { tag: t } })
|
|
167
|
+
}, o = p({
|
|
165
168
|
prefix: "/v2/hardware-tagging"
|
|
166
169
|
}), V = {
|
|
167
170
|
getHandheldReader: (t) => {
|
|
168
|
-
const e =
|
|
169
|
-
return
|
|
170
|
-
},
|
|
171
|
-
getHandheldReaderDetail: (t) =>
|
|
172
|
-
getHandheldReaderOptions: (t) =>
|
|
173
|
-
putMarkHandheldStatus: (t, e, r) =>
|
|
174
|
-
postPingReaders: (t) =>
|
|
175
|
-
putMarkIOTStatus: (t, e) =>
|
|
176
|
-
putEditReaderGroup: (t, e, r) =>
|
|
177
|
-
putEditAntennaGroup: (t, e) =>
|
|
178
|
-
putEditPortStatus: (t, e) =>
|
|
179
|
-
putEditAliasName: (t, e, r) =>
|
|
180
|
-
postActivateHardware: (t, e) =>
|
|
181
|
-
deleteHardware: (t, e) =>
|
|
171
|
+
const e = a(t);
|
|
172
|
+
return o.post("/handheld-reader/list", e);
|
|
173
|
+
},
|
|
174
|
+
getHandheldReaderDetail: (t) => o.get("/handheld-reader/".concat(t)),
|
|
175
|
+
getHandheldReaderOptions: (t) => o.post("/handheld-reader/options", t),
|
|
176
|
+
putMarkHandheldStatus: (t, e, r) => o.patch("/".concat(t, "/status"), r, { params: e }),
|
|
177
|
+
postPingReaders: (t) => o.post("/iot-reader/ping", t),
|
|
178
|
+
putMarkIOTStatus: (t, e) => o.put("/".concat(e, "/mark-status"), t),
|
|
179
|
+
putEditReaderGroup: (t, e, r) => o.patch("/".concat(t, "-reader/").concat(r, "/group"), e),
|
|
180
|
+
putEditAntennaGroup: (t, e) => o.put("/iot-reader/".concat(e, "/set-port-group"), t),
|
|
181
|
+
putEditPortStatus: (t, e) => o.put("/iot-reader/".concat(e, "/set-port-status"), t),
|
|
182
|
+
putEditAliasName: (t, e, r) => o.patch("/".concat(t, "-reader/").concat(r, "/alias-name"), e),
|
|
183
|
+
postActivateHardware: (t, e) => o.post("/".concat(t, "-reader/activate"), e),
|
|
184
|
+
deleteHardware: (t, e) => o.delete("/".concat(t, "-reader"), {
|
|
182
185
|
params: e
|
|
183
186
|
}),
|
|
184
|
-
putAntennaPower: (t, e) =>
|
|
187
|
+
putAntennaPower: (t, e) => o.put("/iot-reader/".concat(e, "/set-antenna-power"), t),
|
|
185
188
|
getIotReader: (t) => {
|
|
186
|
-
const e =
|
|
187
|
-
return
|
|
188
|
-
},
|
|
189
|
-
getIotReaderDetail: (t) =>
|
|
190
|
-
getIotReaderOptions: (t) =>
|
|
191
|
-
getIotReaderPort: (t, e) =>
|
|
192
|
-
getIotReaderTablet: (t, e) =>
|
|
193
|
-
getIotReaderTabletOptions: (t, e) =>
|
|
194
|
-
putEditIotReader: (t, e) =>
|
|
195
|
-
disconnectIotTablet: (t, e) =>
|
|
189
|
+
const e = a({ ...t });
|
|
190
|
+
return o.post("/iot-reader", e);
|
|
191
|
+
},
|
|
192
|
+
getIotReaderDetail: (t) => o.get("/iot-reader/".concat(t)),
|
|
193
|
+
getIotReaderOptions: (t) => o.post("/iot-reader/options", t),
|
|
194
|
+
getIotReaderPort: (t, e) => o.post("/iot-reader/".concat(t, "/port/list"), { params: e }),
|
|
195
|
+
getIotReaderTablet: (t, e) => o.post("/iot-reader/".concat(t, "/tablet/list"), { params: e }),
|
|
196
|
+
getIotReaderTabletOptions: (t, e) => o.post("/iot-reader/".concat(t, "/tablet/options"), e),
|
|
197
|
+
putEditIotReader: (t, e) => o.patch("/iot-reader/".concat(t), e),
|
|
198
|
+
disconnectIotTablet: (t, e) => o.delete("/iot-reader/".concat(t, "/tablet"), {
|
|
196
199
|
data: e
|
|
197
200
|
}),
|
|
198
201
|
// TODO: Activity API spec not finished yet
|
|
199
|
-
getActivityLog: (t) =>
|
|
200
|
-
getActivityLogOptions: (t) =>
|
|
201
|
-
getDetailActivityLog: (t) =>
|
|
202
|
-
getDetailActivityLogOptions: (t) =>
|
|
203
|
-
getExistingAliasNames: () =>
|
|
204
|
-
},
|
|
202
|
+
getActivityLog: (t) => o.get("/activity-log", { params: t }),
|
|
203
|
+
getActivityLogOptions: (t) => o.get("/activity-log/options", { params: t }),
|
|
204
|
+
getDetailActivityLog: (t) => o.get("/activity-log", { params: t }),
|
|
205
|
+
getDetailActivityLogOptions: (t) => o.get("/activity-log/options", { params: t }),
|
|
206
|
+
getExistingAliasNames: () => o.get("/reader/alias-names")
|
|
207
|
+
}, F = p({
|
|
205
208
|
env: "APP_LOGS_NOTIFICATION_API",
|
|
206
209
|
prefix: "/v2"
|
|
207
210
|
}), Y = {
|
|
208
|
-
getSessionLogList: (t) =>
|
|
211
|
+
getSessionLogList: (t) => F.get("/session-log", { params: t })
|
|
209
212
|
}, D = p({
|
|
210
213
|
prefix: "/v1/global-settings/option"
|
|
211
214
|
}), z = {
|
|
@@ -222,53 +225,53 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
222
225
|
const e = { id: JSON.stringify(t) };
|
|
223
226
|
return f.delete("", { params: e });
|
|
224
227
|
}
|
|
225
|
-
},
|
|
228
|
+
}, G = p({
|
|
226
229
|
env: "APP_TAGSAMURAI_API",
|
|
227
230
|
prefix: "/tag/v2"
|
|
228
231
|
}), W = {
|
|
229
|
-
getTagInfo: (t) =>
|
|
232
|
+
getTagInfo: (t) => G.get("/rfid-qr/scan", { params: t })
|
|
230
233
|
}, b = p({
|
|
231
234
|
prefix: "/v2/hardware-tagging"
|
|
232
235
|
}), K = {
|
|
233
236
|
getTAGEventlog: (t) => {
|
|
234
|
-
const e =
|
|
237
|
+
const e = a(t);
|
|
235
238
|
return b.post("/tag-event-log/list", e);
|
|
236
239
|
},
|
|
237
240
|
getTAGEventlogOptions: (t) => {
|
|
238
|
-
const e =
|
|
241
|
+
const e = a(t);
|
|
239
242
|
return b.post("/tag-event-log/options", e);
|
|
240
243
|
},
|
|
241
244
|
getDetailTAGEventlog: (t) => b.get("/tag-event-log/".concat(t))
|
|
242
|
-
},
|
|
245
|
+
}, g = p({
|
|
243
246
|
prefix: "/v1/global-settings/user"
|
|
244
247
|
}), Q = {
|
|
245
|
-
getUsers: (t) =>
|
|
246
|
-
getUserDetail: (t) =>
|
|
247
|
-
getUserSystemLogs: (t, e) =>
|
|
248
|
+
getUsers: (t) => g.get("", { params: t }),
|
|
249
|
+
getUserDetail: (t) => g.get("/".concat(t)),
|
|
250
|
+
getUserSystemLogs: (t, e) => g.get("/".concat(t, "/system-logs"), { params: e }),
|
|
248
251
|
getUserSystemLogOptions: (t, e) => {
|
|
249
252
|
const r = {};
|
|
250
|
-
return r[e] = !0,
|
|
253
|
+
return r[e] = !0, g.get("/".concat(t, "/system-logs/options"), { params: r });
|
|
251
254
|
},
|
|
252
255
|
postCreateUser: (t) => {
|
|
253
256
|
const e = { "Content-Type": "multipart/form-data" };
|
|
254
|
-
return
|
|
257
|
+
return g.post("", t, { headers: e });
|
|
255
258
|
},
|
|
256
259
|
putEditUser: (t, e) => {
|
|
257
260
|
const r = { "Content-Type": "multipart/form-data" };
|
|
258
|
-
return
|
|
261
|
+
return g.put("/".concat(t), e, { headers: r });
|
|
259
262
|
},
|
|
260
263
|
deleteUsers: (t) => {
|
|
261
264
|
const e = { id: JSON.stringify(t) };
|
|
262
|
-
return
|
|
265
|
+
return g.delete("", { params: e });
|
|
263
266
|
},
|
|
264
|
-
putToggleStatusUsers: (t) =>
|
|
267
|
+
putToggleStatusUsers: (t) => g.put("/active-status", t),
|
|
265
268
|
getUserOptions: (t) => {
|
|
266
269
|
const e = {};
|
|
267
|
-
return e[t] = !0,
|
|
270
|
+
return e[t] = !0, g.get("/options", { params: e });
|
|
268
271
|
},
|
|
269
|
-
deleteCancelEmailChange: (t) =>
|
|
270
|
-
postResendEmail: (t) =>
|
|
271
|
-
putChangePassword: (t, e) =>
|
|
272
|
+
deleteCancelEmailChange: (t) => g.delete("/cancel-email-change/".concat(t)),
|
|
273
|
+
postResendEmail: (t) => g.post("/resend-email", t),
|
|
274
|
+
putChangePassword: (t, e) => g.put("/change-password/".concat(t), e)
|
|
272
275
|
}, v = p({
|
|
273
276
|
prefix: "/v2/hardware-tagging"
|
|
274
277
|
}), Z = {
|
|
@@ -289,7 +292,7 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
289
292
|
confirmEmailChange: (t) => s.post("/auth/confirm-email-change", { token: t }),
|
|
290
293
|
cancelEmailChange: (t) => s.delete("/auth/cancel-email-change/".concat(t)),
|
|
291
294
|
getPositionList: (t) => {
|
|
292
|
-
const e =
|
|
295
|
+
const e = a(t);
|
|
293
296
|
return s.post("/position/list", e);
|
|
294
297
|
},
|
|
295
298
|
getPositionDetail: (t) => s.get("/position/".concat(t)),
|
|
@@ -300,7 +303,7 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
300
303
|
return s.delete("/position", { params: e });
|
|
301
304
|
},
|
|
302
305
|
getDivisionList: (t) => {
|
|
303
|
-
const e =
|
|
306
|
+
const e = a(t);
|
|
304
307
|
return s.post("/division/list", e);
|
|
305
308
|
},
|
|
306
309
|
getDivisionDetail: (t) => s.get("/division/".concat(t)),
|
|
@@ -312,18 +315,18 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
312
315
|
},
|
|
313
316
|
createUsers: (t) => {
|
|
314
317
|
const e = new FormData();
|
|
315
|
-
return Object.entries(t).forEach(([r,
|
|
316
|
-
|
|
318
|
+
return Object.entries(t).forEach(([r, n]) => {
|
|
319
|
+
n != null && e.append(r, n);
|
|
317
320
|
}), s.post("/users", e, {
|
|
318
321
|
headers: { "Content-Type": "multipart/form-data" }
|
|
319
322
|
});
|
|
320
323
|
},
|
|
321
324
|
getGlobalUserList: (t) => {
|
|
322
|
-
const e =
|
|
325
|
+
const e = a(t);
|
|
323
326
|
return s.post("/users/list", e);
|
|
324
327
|
},
|
|
325
328
|
getGlobalUserOptions: (t) => {
|
|
326
|
-
const e =
|
|
329
|
+
const e = a(t);
|
|
327
330
|
return s.post("/users/options", e);
|
|
328
331
|
},
|
|
329
332
|
getGlobalUserDetail: (t) => s.get("/users/".concat(t)),
|
|
@@ -333,8 +336,8 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
333
336
|
},
|
|
334
337
|
editUsers: (t, e) => {
|
|
335
338
|
const r = new FormData();
|
|
336
|
-
return Object.entries(e).forEach(([
|
|
337
|
-
|
|
339
|
+
return Object.entries(e).forEach(([n, u]) => {
|
|
340
|
+
u != null && r.append(n, u);
|
|
338
341
|
}), s.patch("/users/".concat(t), r, {
|
|
339
342
|
headers: { "Content-Type": "multipart/form-data" }
|
|
340
343
|
});
|
|
@@ -360,7 +363,22 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
360
363
|
getDivisionDropdown: () => s.get("/division/dropdown"),
|
|
361
364
|
exportPositionTable: () => s.post("/position/list/export", {}, { responseType: "blob" }),
|
|
362
365
|
exportDivisionTable: () => s.post("/division/list/export", {}, { responseType: "blob" }),
|
|
363
|
-
exportUserTable: () => s.post("/users/list/export", {}, { responseType: "blob" })
|
|
366
|
+
exportUserTable: () => s.post("/users/list/export", {}, { responseType: "blob" }),
|
|
367
|
+
getCustomFieldList: (t) => {
|
|
368
|
+
const e = a(t);
|
|
369
|
+
return s.post("/custom-field/list", e);
|
|
370
|
+
},
|
|
371
|
+
getCustomFieldOptions: (t) => s.post("/custom-field/options", t),
|
|
372
|
+
createCustomField: (t) => s.post("/custom-field", t),
|
|
373
|
+
editCustomField: (t, e) => s.patch("/custom-field/".concat(t), e),
|
|
374
|
+
setActiveCustomField: (t, e) => {
|
|
375
|
+
const r = { ids: JSON.stringify(t) };
|
|
376
|
+
return s.patch("/custom-field/set-active", e, { params: r });
|
|
377
|
+
},
|
|
378
|
+
deleteCustomField: (t) => {
|
|
379
|
+
const e = { ids: JSON.stringify(t) };
|
|
380
|
+
return s.delete("/custom-field", { params: e });
|
|
381
|
+
}
|
|
364
382
|
}, i = p({
|
|
365
383
|
prefix: "/v2/import"
|
|
366
384
|
}), et = {
|
|
@@ -426,6 +444,6 @@ export {
|
|
|
426
444
|
W as TagServices,
|
|
427
445
|
Q as UserServices,
|
|
428
446
|
I as getBaseURL,
|
|
429
|
-
|
|
430
|
-
|
|
447
|
+
J as getImageURL,
|
|
448
|
+
H as queryParamsStringfy
|
|
431
449
|
};
|
package/package.json
CHANGED
|
@@ -1,22 +1,32 @@
|
|
|
1
|
+
import { TableParams } from '../types/dataTable.type';
|
|
1
2
|
import { ChangelogType } from '../types/changelog.type';
|
|
2
3
|
import { FetchListResponse, FetchOptionResponse } from '../types/fetchResponse.type';
|
|
3
|
-
import { FilterOptions } from './dataTable.dto';
|
|
4
4
|
export type ChangelogResponse = FetchListResponse<ChangelogType>;
|
|
5
|
-
export type ChangelogOptionResponse = FetchOptionResponse<
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
objectName?: string;
|
|
9
|
-
field?: string;
|
|
10
|
-
action?: string;
|
|
11
|
-
modifiedBy?: string;
|
|
12
|
-
createdAt?:
|
|
5
|
+
export type ChangelogOptionResponse = FetchOptionResponse<ChangelogOptionFilter>;
|
|
6
|
+
export interface ChangelogFilterQuery extends TableParams {
|
|
7
|
+
objects?: string[];
|
|
8
|
+
objectName?: string[];
|
|
9
|
+
field?: string[];
|
|
10
|
+
action?: string[];
|
|
11
|
+
modifiedBy?: string[];
|
|
12
|
+
createdAt?: number[];
|
|
13
13
|
userId?: string;
|
|
14
14
|
modifiedById?: string;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
objectId?: string;
|
|
16
|
+
module?: string;
|
|
17
|
+
activityLog?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export type ChangelogOptionFilter = {
|
|
17
20
|
actionOptions?: boolean;
|
|
18
21
|
modifiedByOptions?: boolean;
|
|
19
22
|
fieldOptions?: boolean;
|
|
20
23
|
objectNameOptions?: boolean;
|
|
21
|
-
|
|
24
|
+
objectOptions?: boolean;
|
|
22
25
|
};
|
|
26
|
+
export interface ChangelogOptionQuery extends ChangelogOptionFilter {
|
|
27
|
+
module?: string;
|
|
28
|
+
objects?: string[];
|
|
29
|
+
objectId?: string;
|
|
30
|
+
userId?: string;
|
|
31
|
+
activityLog?: boolean;
|
|
32
|
+
}
|
package/src/dto/iam.dto.d.ts
CHANGED
|
@@ -70,3 +70,20 @@ export interface GetConcurrentUsersParams extends TableParams {
|
|
|
70
70
|
export interface LogoutSessionPayload {
|
|
71
71
|
sessionId: string;
|
|
72
72
|
}
|
|
73
|
+
export interface GetCustomFieldListParams extends TableParams {
|
|
74
|
+
isActive?: boolean[];
|
|
75
|
+
dataType?: string[];
|
|
76
|
+
isRequired?: boolean[];
|
|
77
|
+
}
|
|
78
|
+
export type GetCustomFieldOptionsParams = Partial<{
|
|
79
|
+
dataTypeOptions: boolean;
|
|
80
|
+
}>;
|
|
81
|
+
export interface CreateEditCustomFieldPayload {
|
|
82
|
+
isRequired: boolean;
|
|
83
|
+
name: string;
|
|
84
|
+
dataType: string;
|
|
85
|
+
optionValue: string[];
|
|
86
|
+
}
|
|
87
|
+
export interface SetActiveCustomFieldPayload {
|
|
88
|
+
isActive: boolean;
|
|
89
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { ChangelogFilterQuery, ChangelogOptionQuery, ChangelogOptionResponse, ChangelogResponse } from '../dto/changelog.dto';
|
|
3
|
+
import { FilterQuery } from '../types/fetchResponse.type';
|
|
3
4
|
declare const ChangelogServices: {
|
|
4
|
-
getChangelogs: (params?: ChangelogFilterQuery) => Promise<AxiosResponse<ChangelogResponse>>;
|
|
5
|
-
getChangelogOptions: (
|
|
5
|
+
getChangelogs: (params?: FilterQuery<ChangelogFilterQuery>) => Promise<AxiosResponse<ChangelogResponse>>;
|
|
6
|
+
getChangelogOptions: (body?: ChangelogOptionQuery) => Promise<AxiosResponse<{
|
|
7
|
+
data: ChangelogOptionResponse;
|
|
8
|
+
}>>;
|
|
6
9
|
};
|
|
7
10
|
export default ChangelogServices;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.type';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Division, CustomField, CustomFieldOptions, PositionList, LoginResponse, RequestOtpResponse, RequestResetLinkResponse, DivisionList, DivisionListDetail, GlobalUserList, GlobalUserOptions, GlobalUserDetail, LoginModuleResponse, ConcurrentUserList, VerifyTokenResponse, PositionDetail, ChangePasswordResponse, Position } from '../types/iam.type';
|
|
4
|
+
import { CreateEditDivisionPayload, CreateEditPositionPayload, GetDivisionListParams, GetPositionListParams, LoginPayload, SetPasswordPayload, CreateUserPayload, GetGlobalUserListParams, GetGlobalUserOptionsParams, SetActiveGlobalUserPayload, EditUserPayload, EditUserFcmTokenPayload, ResendActivationEmailPayload, ChangePasswordPayload, ModuleAuthPayload, GetConcurrentUsersParams, LogoutSessionPayload, GetCustomFieldListParams, GetCustomFieldOptionsParams, CreateEditCustomFieldPayload, SetActiveCustomFieldPayload } from '../dto/iam.dto';
|
|
5
5
|
declare const IamServices: {
|
|
6
6
|
login: (payload: LoginPayload) => Promise<AxiosResponse<FetchDetailResponse<LoginResponse>>>;
|
|
7
7
|
logout: () => Promise<AxiosResponse>;
|
|
@@ -40,5 +40,11 @@ declare const IamServices: {
|
|
|
40
40
|
exportPositionTable: () => Promise<AxiosResponse<Blob>>;
|
|
41
41
|
exportDivisionTable: () => Promise<AxiosResponse<Blob>>;
|
|
42
42
|
exportUserTable: () => Promise<AxiosResponse<Blob>>;
|
|
43
|
+
getCustomFieldList: (params: GetCustomFieldListParams) => Promise<AxiosResponse<FetchListResponse<CustomField>>>;
|
|
44
|
+
getCustomFieldOptions: (params: GetCustomFieldOptionsParams) => Promise<AxiosResponse<FetchDetailResponse<CustomFieldOptions>>>;
|
|
45
|
+
createCustomField: (payload: CreateEditCustomFieldPayload) => Promise<AxiosResponse>;
|
|
46
|
+
editCustomField: (id: string, payload: CreateEditCustomFieldPayload) => Promise<AxiosResponse>;
|
|
47
|
+
setActiveCustomField: (ids: string[], payload: SetActiveCustomFieldPayload) => Promise<AxiosResponse>;
|
|
48
|
+
deleteCustomField: (ids: string[]) => Promise<AxiosResponse>;
|
|
43
49
|
};
|
|
44
50
|
export default IamServices;
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import { Option } from '../../node_modules/@fewangsit/wangsvue-gsts/dropdown';
|
|
2
1
|
export type ChangelogType = {
|
|
3
2
|
_id: string;
|
|
4
3
|
action: string;
|
|
5
|
-
field
|
|
4
|
+
field?: string;
|
|
6
5
|
oldValue?: string;
|
|
7
6
|
newValue?: string;
|
|
8
|
-
modifiedBy
|
|
9
|
-
modifiedById?: string;
|
|
7
|
+
modifiedBy: string;
|
|
10
8
|
object: string;
|
|
11
|
-
objectId: string;
|
|
12
9
|
objectName: string;
|
|
13
10
|
createdAt: string;
|
|
14
11
|
updatedAt: string;
|
|
15
12
|
};
|
|
16
|
-
export type ChangelogOptionFilter = {
|
|
17
|
-
actionOptions?: Option[];
|
|
18
|
-
modifiedByOptions?: Option[];
|
|
19
|
-
fieldOptions?: Option[];
|
|
20
|
-
objectNameOptions?: Option[];
|
|
21
|
-
};
|
package/src/types/iam.type.d.ts
CHANGED
|
@@ -149,4 +149,24 @@ export interface Position extends DropdownOption {
|
|
|
149
149
|
}
|
|
150
150
|
export interface Division extends DropdownOption {
|
|
151
151
|
}
|
|
152
|
+
export interface CustomField {
|
|
153
|
+
_id: string;
|
|
154
|
+
name: string;
|
|
155
|
+
dataType: string;
|
|
156
|
+
optionValue: string[];
|
|
157
|
+
isActive: boolean;
|
|
158
|
+
isRequired: 'Yes' | 'No' | BaseMessage;
|
|
159
|
+
createdAt: string;
|
|
160
|
+
updatedAt: string;
|
|
161
|
+
}
|
|
162
|
+
export interface CustomFieldList {
|
|
163
|
+
totalRecords: number;
|
|
164
|
+
data: CustomField[];
|
|
165
|
+
}
|
|
166
|
+
export interface CustomFieldOptions {
|
|
167
|
+
dataTypeOptions: {
|
|
168
|
+
label: string;
|
|
169
|
+
value: string;
|
|
170
|
+
}[];
|
|
171
|
+
}
|
|
152
172
|
export {};
|