@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.
@@ -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: o = "",
6
- headers: a = {},
5
+ prefix: n = "",
6
+ headers: u = {},
7
7
  ...l
8
- } = t, w = "".concat(I(r)).concat(o), A = R.create({
8
+ } = t, w = "".concat(I(r)).concat(n), h = R.create({
9
9
  ...l,
10
10
  baseURL: w,
11
- headers: e ? a : {
11
+ headers: e ? u : {
12
12
  "Content-Type": "application/json",
13
- ...a
13
+ ...u
14
14
  }
15
15
  });
16
- return A.interceptors.request.use((h) => {
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 h.headers.Authorization = "Bearer ".concat(O), h;
20
- }), A;
19
+ return A.headers.Authorization = "Bearer ".concat(O), A;
20
+ }), h;
21
21
  }, c = p({
22
22
  prefix: "/v1/global-settings/auth"
23
- }), E = (t) => {
24
- var e, r, o, a;
25
- return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((a = (o = t.response) == null ? void 0 : o.data) == null ? void 0 : a.message) === "jwt malformed" ? (window.onblur = null, window.onfocus = null, window.sessionExpired = !0, window.dispatchEvent(new CustomEvent("user:expired"))) : Promise.reject(t);
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, E), c.post("/login", t)),
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
- }, L = (t, e, r) => {
53
- const o = new URL(I("APP_TAGSAMURAI_API") || "").origin;
54
- let a = t.startsWith("http") ? t : "".concat(o, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
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())), a += "?".concat(l.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 a;
59
+ return u;
60
60
  }, _ = () => {
61
- var e, r, o;
61
+ var e, r, n;
62
62
  const t = JSON.parse((e = localStorage.getItem("user")) != null ? e : "{}");
63
- return (o = (r = t.jwt) != null ? r : t.token) != null ? o : "";
64
- }, x = async (t, e) => {
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 o = await r.arrayBuffer();
73
- return new Blob([o], {
72
+ const n = await r.arrayBuffer();
73
+ return new Blob([n], {
74
74
  type: r.headers.get("Content-Type") || "image/webp"
75
75
  });
76
- }, C = async (t) => {
76
+ }, N = async (t) => {
77
77
  try {
78
- const e = _(), r = await x(t, e);
78
+ const e = _(), r = await C(t, e);
79
79
  return URL.createObjectURL(r);
80
80
  } catch (e) {
81
81
  return;
82
82
  }
83
- }, H = async (t, e, r, o) => {
83
+ }, J = async (t, e, r, n) => {
84
84
  if (!t) return;
85
- const a = L(t, e, r);
86
- return o ? a : C(a);
87
- }, J = (t) => {
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
- }, G = (t) => {
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
- }, u = (t) => {
107
+ }, a = (t) => {
108
108
  if (!t)
109
109
  return {};
110
110
  const e = {};
111
111
  return Object.keys(t).forEach((r) => {
112
- const o = t[r];
113
- e[r] = G(o) ? JSON.parse(o.trim()) : o;
112
+ const n = t[r];
113
+ e[r] = x(n) ? JSON.parse(n.trim()) : n;
114
114
  }), e;
115
115
  }, T = p({
116
- prefix: "/v1/global-settings/change-log"
116
+ prefix: "v2/analytics-reporting"
117
117
  }), j = {
118
- getChangelogs: (t) => T.get("", { params: t }),
119
- getChangelogOptions: (t) => T.get("/options", { params: t })
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
- }, g = p({
134
+ }, d = p({
132
135
  prefix: "/v2/hardware-tagging"
133
136
  }), q = {
134
137
  getAllTAG: (t) => {
135
- const e = u(t);
136
- return g.post("/all-tag/list", e);
138
+ const e = a(t);
139
+ return d.post("/all-tag/list", e);
137
140
  },
138
141
  getAllTAGOptions: (t) => {
139
- const e = u(t);
140
- return g.post("all-tag/options", e);
142
+ const e = a(t);
143
+ return d.post("all-tag/options", e);
141
144
  },
142
- getNotPairedYetCounts: () => g.get("/not-paired-yet/tag-count"),
145
+ getNotPairedYetCounts: () => d.get("/not-paired-yet/tag-count"),
143
146
  getNotPairedYetList: (t) => {
144
- const e = u(t);
145
- return g.post("/not-paired-yet/list", e);
147
+ const e = a(t);
148
+ return d.post("/not-paired-yet/list", e);
146
149
  },
147
150
  getNotPairedYetOptions: (t) => {
148
- const e = u(t);
149
- return g.post("/not-paired-yet/options", e);
151
+ const e = a(t);
152
+ return d.post("/not-paired-yet/options", e);
150
153
  },
151
- getAuditTAGDetail: (t) => g.post("/audit/detail", t),
152
- submitAuditTAG: (t) => g.post("/audit/submit", t),
153
- submitCombineTAG: (t) => g.post("/combine-tag/combine", t),
154
- submitSeparateTAG: (t) => g.post("/combine-tag/separate", 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 = u(t);
157
- return g.post("/paired/list", e);
159
+ const e = a(t);
160
+ return d.post("/paired/list", e);
158
161
  },
159
162
  getPairedOptions: (t) => {
160
- const e = u(t);
161
- return g.post("/paired/options", e);
163
+ const e = a(t);
164
+ return d.post("/paired/options", e);
162
165
  },
163
- getScanTag: (t) => g.get("/scan-tag", { params: { tag: t } })
164
- }, n = p({
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 = u(t);
169
- return n.post("/handheld-reader/list", e);
170
- },
171
- getHandheldReaderDetail: (t) => n.get("/handheld-reader/".concat(t)),
172
- getHandheldReaderOptions: (t) => n.post("/handheld-reader/options", t),
173
- putMarkHandheldStatus: (t, e, r) => n.patch("/".concat(t, "/status"), r, { params: e }),
174
- postPingReaders: (t) => n.post("/iot-reader/ping", t),
175
- putMarkIOTStatus: (t, e) => n.put("/".concat(e, "/mark-status"), t),
176
- putEditReaderGroup: (t, e, r) => n.patch("/".concat(t, "-reader/").concat(r, "/group"), e),
177
- putEditAntennaGroup: (t, e) => n.put("/iot-reader/".concat(e, "/set-port-group"), t),
178
- putEditPortStatus: (t, e) => n.put("/iot-reader/".concat(e, "/set-port-status"), t),
179
- putEditAliasName: (t, e, r) => n.patch("/".concat(t, "-reader/").concat(r, "/alias-name"), e),
180
- postActivateHardware: (t, e) => n.post("/".concat(t, "-reader/activate"), e),
181
- deleteHardware: (t, e) => n.delete("/".concat(t, "-reader"), {
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) => n.put("/iot-reader/".concat(e, "/set-antenna-power"), t),
187
+ putAntennaPower: (t, e) => o.put("/iot-reader/".concat(e, "/set-antenna-power"), t),
185
188
  getIotReader: (t) => {
186
- const e = u({ ...t });
187
- return n.post("/iot-reader", e);
188
- },
189
- getIotReaderDetail: (t) => n.get("/iot-reader/".concat(t)),
190
- getIotReaderOptions: (t) => n.post("/iot-reader/options", t),
191
- getIotReaderPort: (t, e) => n.post("/iot-reader/".concat(t, "/port/list"), { params: e }),
192
- getIotReaderTablet: (t, e) => n.post("/iot-reader/".concat(t, "/tablet/list"), { params: e }),
193
- getIotReaderTabletOptions: (t, e) => n.post("/iot-reader/".concat(t, "/tablet/options"), e),
194
- putEditIotReader: (t, e) => n.patch("/iot-reader/".concat(t), e),
195
- disconnectIotTablet: (t, e) => n.delete("/iot-reader/".concat(t, "/tablet"), {
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) => n.get("/activity-log", { params: t }),
200
- getActivityLogOptions: (t) => n.get("/activity-log/options", { params: t }),
201
- getDetailActivityLog: (t) => n.get("/activity-log", { params: t }),
202
- getDetailActivityLogOptions: (t) => n.get("/activity-log/options", { params: t }),
203
- getExistingAliasNames: () => n.get("/reader/alias-names")
204
- }, N = p({
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) => N.get("/session-log", { params: 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
- }, F = p({
228
+ }, G = p({
226
229
  env: "APP_TAGSAMURAI_API",
227
230
  prefix: "/tag/v2"
228
231
  }), W = {
229
- getTagInfo: (t) => F.get("/rfid-qr/scan", { params: 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 = u(t);
237
+ const e = a(t);
235
238
  return b.post("/tag-event-log/list", e);
236
239
  },
237
240
  getTAGEventlogOptions: (t) => {
238
- const e = u(t);
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
- }, d = p({
245
+ }, g = p({
243
246
  prefix: "/v1/global-settings/user"
244
247
  }), Q = {
245
- getUsers: (t) => d.get("", { params: t }),
246
- getUserDetail: (t) => d.get("/".concat(t)),
247
- getUserSystemLogs: (t, e) => d.get("/".concat(t, "/system-logs"), { params: 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, d.get("/".concat(t, "/system-logs/options"), { params: r });
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 d.post("", t, { headers: e });
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 d.put("/".concat(t), e, { headers: r });
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 d.delete("", { params: e });
265
+ return g.delete("", { params: e });
263
266
  },
264
- putToggleStatusUsers: (t) => d.put("/active-status", t),
267
+ putToggleStatusUsers: (t) => g.put("/active-status", t),
265
268
  getUserOptions: (t) => {
266
269
  const e = {};
267
- return e[t] = !0, d.get("/options", { params: e });
270
+ return e[t] = !0, g.get("/options", { params: e });
268
271
  },
269
- deleteCancelEmailChange: (t) => d.delete("/cancel-email-change/".concat(t)),
270
- postResendEmail: (t) => d.post("/resend-email", t),
271
- putChangePassword: (t, e) => d.put("/change-password/".concat(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 = u(t);
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 = u(t);
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, o]) => {
316
- o != null && e.append(r, o);
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 = u(t);
325
+ const e = a(t);
323
326
  return s.post("/users/list", e);
324
327
  },
325
328
  getGlobalUserOptions: (t) => {
326
- const e = u(t);
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(([o, a]) => {
337
- a != null && r.append(o, a);
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
- H as getImageURL,
430
- J as queryParamsStringfy
447
+ J as getImageURL,
448
+ H as queryParamsStringfy
431
449
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/gsts-api-services",
3
- "version": "2.0.1-alpha.27",
3
+ "version": "2.0.1-alpha.29",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Global Settings Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -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<FilterOptions>;
6
- export type ChangelogFilterQuery = {
7
- object?: string;
8
- objectName?: string;
9
- field?: string;
10
- action?: string;
11
- modifiedBy?: string;
12
- createdAt?: string;
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
- export type ChangelogOptionQuery = {
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
- object?: string;
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
+ }
@@ -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: (params?: ChangelogOptionQuery) => Promise<AxiosResponse<ChangelogOptionResponse>>;
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 { CreateEditDivisionPayload, CreateEditPositionPayload, GetDivisionListParams, GetPositionListParams, LoginPayload, SetPasswordPayload, CreateUserPayload, GetGlobalUserListParams, GetGlobalUserOptionsParams, SetActiveGlobalUserPayload, EditUserPayload, EditUserFcmTokenPayload, ResendActivationEmailPayload, ChangePasswordPayload, ModuleAuthPayload, GetConcurrentUsersParams, LogoutSessionPayload } from '../dto/iam.dto';
4
- import { PositionList, LoginResponse, RequestOtpResponse, RequestResetLinkResponse, DivisionList, DivisionListDetail, GlobalUserList, GlobalUserOptions, GlobalUserDetail, LoginModuleResponse, ConcurrentUserList, VerifyTokenResponse, PositionDetail, ChangePasswordResponse, Position, Division } from '../types/iam.type';
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: string;
4
+ field?: string;
6
5
  oldValue?: string;
7
6
  newValue?: string;
8
- modifiedBy?: string;
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
- };
@@ -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 {};