@tagsamurai/gsts-api-services 1.1.0-alpha.3 → 1.1.0-alpha.30

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.
@@ -1,29 +1,29 @@
1
1
  import L from "axios";
2
- const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.local" }, T = (t = "APP_TAGSAMURAI_API") => C["VITE_" + t], i = (t = {}, e = !1) => {
2
+ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.local" }, T = (t = "APP_TAGSAMURAI_API") => C["VITE_" + t], a = (t = {}, e = !1) => {
3
3
  const {
4
4
  env: r = "APP_TAGSAMURAI_API",
5
- prefix: n = "",
6
- headers: u = {},
7
- ...f
8
- } = t, w = "".concat(T(r)).concat(n), y = L.create({
9
- ...f,
5
+ prefix: o = "",
6
+ headers: i = {},
7
+ ...b
8
+ } = t, w = "".concat(T(r)).concat(o), v = L.create({
9
+ ...b,
10
10
  baseURL: w,
11
- headers: e ? u : {
11
+ headers: e ? i : {
12
12
  "Content-Type": "application/json",
13
- ...u
13
+ ...i
14
14
  }
15
15
  });
16
- return y.interceptors.request.use((A) => {
16
+ return v.interceptors.request.use((y) => {
17
17
  var S, P, h;
18
18
  const $ = JSON.parse((S = localStorage.getItem("user")) != null ? S : "{}"), R = (h = (P = $.jwt) != null ? P : $.token) != null ? h : "";
19
- return A.headers.Authorization = "Bearer ".concat(R), A;
20
- }), y;
21
- }, l = i({
22
- prefix: "/global-settings/v1/global-settings/auth"
19
+ return y.headers.Authorization = "Bearer ".concat(R), y;
20
+ }), v;
21
+ }, l = a({
22
+ prefix: "/global-settings/auth"
23
23
  }), E = (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
- }, j = {
24
+ var e, r, o, i;
25
+ return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((i = (o = t.response) == null ? void 0 : o.data) == null ? void 0 : i.message) === "jwt malformed" ? (window.onblur = null, window.onfocus = null, window.sessionExpired = !0, window.dispatchEvent(new CustomEvent("user:expired"))) : Promise.reject(t);
26
+ }, k = {
27
27
  login: (t) => {
28
28
  const e = { ...t, isMobile: !1 };
29
29
  return l.post("/login", e);
@@ -50,17 +50,17 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
50
50
  */
51
51
  logout: () => l.post("/logout")
52
52
  }, U = (t, e, r) => {
53
- const n = new URL(T("APP_TAGSAMURAI_API") || "").origin;
54
- let u = t.startsWith("http") ? t : "".concat(n, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
53
+ const o = new URL(T("APP_TAGSAMURAI_API") || "").origin;
54
+ let i = t.startsWith("http") ? t : "".concat(o, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
55
55
  if (e || r) {
56
- const f = new URLSearchParams();
57
- e && (f.set("width", e.toString()), f.set("height", (r == null ? void 0 : r.toString()) || e.toString())), u += "?".concat(f.toString());
56
+ const b = new URLSearchParams();
57
+ e && (b.set("width", e.toString()), b.set("height", (r == null ? void 0 : r.toString()) || e.toString())), i += "?".concat(b.toString());
58
58
  }
59
- return u;
59
+ return i;
60
60
  }, x = () => {
61
- var e, r, n;
61
+ var e, r, o;
62
62
  const t = JSON.parse((e = localStorage.getItem("user")) != null ? e : "{}");
63
- return (n = (r = t.jwt) != null ? r : t.token) != null ? n : "";
63
+ return (o = (r = t.jwt) != null ? r : t.token) != null ? o : "";
64
64
  }, D = async (t, e) => {
65
65
  const r = await fetch(t, {
66
66
  headers: {
@@ -69,8 +69,8 @@ const C = { 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 n = await r.arrayBuffer();
73
- return new Blob([n], {
72
+ const o = await r.arrayBuffer();
73
+ return new Blob([o], {
74
74
  type: r.headers.get("Content-Type") || "image/webp"
75
75
  });
76
76
  }, _ = async (t) => {
@@ -80,10 +80,10 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
80
80
  } catch (e) {
81
81
  return;
82
82
  }
83
- }, B = async (t, e, r, n) => {
83
+ }, B = async (t, e, r, o) => {
84
84
  if (!t) return;
85
- const u = U(t, e, r);
86
- return n ? u : _(u);
85
+ const i = U(t, e, r);
86
+ return o ? i : _(i);
87
87
  }, J = (t) => {
88
88
  if (!t || typeof t == "string")
89
89
  return;
@@ -100,95 +100,97 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
100
100
  const e = t.trim();
101
101
  if (!e) return !1;
102
102
  try {
103
- return JSON.parse(e), !0;
103
+ const r = JSON.parse(e);
104
+ return typeof r == "object" && r !== null;
104
105
  } catch (r) {
105
106
  return !1;
106
107
  }
107
- }, o = (t) => {
108
+ }, n = (t) => {
108
109
  if (!t)
109
110
  return {};
110
111
  const e = {};
111
112
  return Object.keys(t).forEach((r) => {
112
- const n = t[r];
113
- e[r] = G(n) ? JSON.parse(n.trim()) : n;
113
+ const o = t[r], i = G(o) ? JSON.parse(o.trim()) : o;
114
+ e[r] = Array.isArray(i) && i.length === 0 ? void 0 : i;
114
115
  }), e;
115
- }, p = i({
116
- prefix: "/global-settings/v1/global-settings/change-log"
116
+ }, p = a({
117
+ prefix: "/global-settings"
117
118
  }), M = {
118
- getChangelogs: (t) => {
119
- const e = o(t);
120
- return p.post("/change-log/list", e);
121
- },
122
- getChangelogOptions: (t) => p.post("/change-log/options", t),
119
+ getChangelogs: (t) => p.get("/change-log", { params: t }),
120
+ getChangelogOptions: (t) => p.get("/change-log/options", { params: t }),
123
121
  getSessionList: (t) => {
124
- const e = o(t);
122
+ const e = n(t);
125
123
  return p.post("/session-log/list", e);
126
124
  },
127
125
  getSessionOptions: (t) => p.post("/session-log/options", t),
128
126
  getHardwareChangelogs: (t) => {
129
- const e = o(t);
127
+ const e = n(t);
130
128
  return p.post("/hardware-change-log/list", e);
131
129
  },
132
130
  getHardwareOptions: (t) => p.post("/hardware-change-log/options", t),
133
131
  getTaggingList: (t) => {
134
- const e = o(t);
132
+ const e = n(t);
135
133
  return p.post("/reader-tagging-log/list", e);
136
134
  },
137
135
  getTaggingOptions: (t) => p.post("/reader-tagging-log/options", t),
138
136
  getUserTagList: (t) => {
139
- const e = o(t);
137
+ const e = n(t);
140
138
  return p.post("/reader-user-tag-log/list", e);
141
139
  },
142
140
  getUserTagOptions: (t) => p.post("/reader-user-tag-log/options", t)
143
- }, b = i({
144
- prefix: "/global-settings/v1/global-settings/division"
141
+ }, d = a({
142
+ prefix: "/global-settings/division"
145
143
  }), H = {
146
- getDivisions: (t) => b.get("", { params: t }),
147
- getDivisionDetail: (t) => b.get("/".concat(t)),
148
- postCreateDivision: (t) => b.post("/", t),
149
- putEditDivision: (t, e) => b.put("/".concat(t), e),
144
+ getDivisions: (t) => d.get("", { params: t }),
145
+ getDivisionDetail: (t) => d.get("/".concat(t)),
146
+ postCreateDivision: (t) => d.post("/", t),
147
+ putEditDivision: (t, e) => d.put("/".concat(t), e),
150
148
  deleteDivisions: (t) => {
151
149
  const e = { id: JSON.stringify(t) };
152
- return b.delete("", { params: e });
150
+ return d.delete("", { params: e });
151
+ },
152
+ getAvailableDivision: (t) => {
153
+ const e = { name: t };
154
+ return d.get("/available", { params: e });
153
155
  }
154
- }, a = i({
155
- prefix: "/global-settings/v1/global-settings"
156
+ }, g = a({
157
+ prefix: "/global-settings"
156
158
  }), q = {
157
159
  getAllTAG: (t) => {
158
- const e = o(t);
159
- return a.post("/all-tag/list", e);
160
+ const e = n(t);
161
+ return g.post("/all-tag/list", e);
160
162
  },
161
163
  getAllTAGOptions: (t) => {
162
- const e = o(t);
163
- return a.post("all-tag/options", e);
164
+ const e = n(t);
165
+ return g.post("all-tag/options", e);
164
166
  },
165
- getNotPairedYetCounts: () => a.get("/not-paired-yet/tag-count"),
167
+ getNotPairedYetCounts: () => g.get("/not-paired-yet/tag-count"),
166
168
  getNotPairedYetList: (t) => {
167
- const e = o(t);
168
- return a.post("/not-paired-yet/list", e);
169
+ const e = n(t);
170
+ return g.post("/not-paired-yet/list", e);
169
171
  },
170
172
  getNotPairedYetOptions: (t) => {
171
- const e = o(t);
172
- return a.post("/not-paired-yet/options", e);
173
+ const e = n(t);
174
+ return g.post("/not-paired-yet/options", e);
173
175
  },
174
- getAuditTAGDetail: (t) => a.post("/audit/detail", t),
175
- submitAuditTAG: (t) => a.post("/audit/submit", t),
176
- submitCombineTAG: (t) => a.post("/combine-tag/combine", t),
177
- submitSeparateTAG: (t) => a.post("/combine-tag/separate", t),
176
+ getAuditTAGDetail: (t) => g.post("/audit/detail", t),
177
+ submitAuditTAG: (t) => g.post("/audit/submit", t),
178
+ submitCombineTAG: (t) => g.post("/combine-tag/combine", t),
179
+ submitSeparateTAG: (t) => g.post("/combine-tag/separate", t),
178
180
  getPairedList: (t) => {
179
- const e = o(t);
180
- return a.post("/paired/list", e);
181
+ const e = n(t);
182
+ return g.post("/paired/list", e);
181
183
  },
182
184
  getPairedOptions: (t) => {
183
- const e = o(t);
184
- return a.post("/paired/options", e);
185
+ const e = n(t);
186
+ return g.post("/paired/options", e);
185
187
  },
186
- getScanTag: (t) => a.get("/scan-tag", { params: { tag: t } })
187
- }, s = i({
188
- prefix: "/global-settings/v1/global-settings"
188
+ getScanTag: (t) => g.get("/scan-tag", { params: { tag: t } })
189
+ }, s = a({
190
+ prefix: "/global-settings"
189
191
  }), V = {
190
192
  getHandheldReader: (t) => {
191
- const e = o(t);
193
+ const e = n(t);
192
194
  return s.post("/handheld-reader/list", e);
193
195
  },
194
196
  getHandheldReaderDetail: (t) => s.get("/handheld-reader/".concat(t)),
@@ -206,7 +208,7 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
206
208
  }),
207
209
  putAntennaPower: (t, e) => s.put("/iot-reader/".concat(e, "/set-antenna-power"), t),
208
210
  getIotReader: (t) => {
209
- const e = o({ ...t });
211
+ const e = n({ ...t });
210
212
  return s.post("/iot-reader", e);
211
213
  },
212
214
  getIotReaderDetail: (t) => s.get("/iot-reader/".concat(t)),
@@ -224,97 +226,101 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
224
226
  getDetailActivityLog: (t) => s.get("/activity-log", { params: t }),
225
227
  getDetailActivityLogOptions: (t) => s.get("/activity-log/options", { params: t }),
226
228
  getExistingAliasNames: () => s.get("/reader/alias-names")
227
- }, F = i({
229
+ }, F = a({
228
230
  prefix: "/fam/utility/v2"
229
231
  }), Y = {
230
232
  getSessionLogList: (t) => F.get("/session-log", { params: t })
231
- }, I = i({
232
- prefix: "/global-settings/v1/global-settings/option"
233
+ }, I = a({
234
+ prefix: "/global-settings/option"
233
235
  }), z = {
234
236
  getPositions: () => I.get("/position"),
235
237
  getDivisions: () => I.get("/division")
236
- }, m = i({
237
- prefix: "/global-settings/v1/global-settings/position"
238
+ }, f = a({
239
+ prefix: "/global-settings/position"
238
240
  }), W = {
239
- getPositions: (t) => m.get("", { params: t }),
240
- getPositionDetail: (t) => m.get("/".concat(t)),
241
- postCreatePosition: (t) => m.post("/", t),
242
- putEditPosition: (t, e) => m.put("/".concat(t), e),
241
+ getPositions: (t) => f.get("", { params: t }),
242
+ getPositionDetail: (t) => f.get("/".concat(t)),
243
+ postCreatePosition: (t) => f.post("/", t),
244
+ putEditPosition: (t, e) => f.put("/".concat(t), e),
243
245
  deletePositions: (t) => {
244
246
  const e = { id: JSON.stringify(t) };
245
- return m.delete("", { params: e });
247
+ return f.delete("", { params: e });
248
+ },
249
+ getAvailablePosition: (t) => {
250
+ const e = { name: t };
251
+ return f.get("/available", { params: e });
246
252
  }
247
- }, N = i({
253
+ }, N = a({
248
254
  prefix: "/fam/tag/v2"
249
255
  }), K = {
250
256
  getTagInfo: (t) => N.get("/rfid-qr/scan", { params: t })
251
- }, v = i({
252
- prefix: "/global-settings/v1/global-settings/change-log"
257
+ }, A = a({
258
+ prefix: "/global-settings/change-log"
253
259
  }), Q = {
254
260
  getTAGEventlog: (t) => {
255
- const e = o(t);
256
- return v.post("/tag-event-log/list", e);
261
+ const e = n(t);
262
+ return A.post("/tag-event-log/list", e);
257
263
  },
258
264
  getTAGEventlogOptions: (t) => {
259
- const e = o(t);
260
- return v.post("/tag-event-log/options", e);
265
+ const e = n(t);
266
+ return A.post("/tag-event-log/options", e);
261
267
  },
262
- getDetailTAGEventlog: (t) => v.get("/tag-event-log/".concat(t))
263
- }, g = i({
264
- prefix: "/global-settings/v1/global-settings/user"
268
+ getDetailTAGEventlog: (t) => A.get("/tag-event-log/".concat(t))
269
+ }, u = a({
270
+ prefix: "/global-settings/user"
265
271
  }), X = {
266
- getUsers: (t) => g.get("", { params: t }),
267
- getUserDetail: (t) => g.get("/".concat(t)),
268
- getUserSystemLogs: (t, e) => g.get("/".concat(t, "/system-logs"), { params: e }),
272
+ getUsers: (t) => u.get("", { params: t }),
273
+ getUserDetail: (t) => u.get("/".concat(t)),
274
+ getUserSystemLogs: (t, e) => u.get("/".concat(t, "/system-logs"), { params: e }),
269
275
  getUserSystemLogOptions: (t, e) => {
270
276
  const r = {};
271
- return r[e] = !0, g.get("/".concat(t, "/system-logs/options"), { params: r });
277
+ return r[e] = !0, u.get("/".concat(t, "/system-logs/options"), { params: r });
272
278
  },
273
279
  postCreateUser: (t) => {
274
280
  const e = { "Content-Type": "multipart/form-data" };
275
- return g.post("", t, { headers: e });
281
+ return u.post("", t, { headers: e });
276
282
  },
277
283
  putEditUser: (t, e) => {
278
284
  const r = { "Content-Type": "multipart/form-data" };
279
- return g.put("/".concat(t), e, { headers: r });
285
+ return u.put("/".concat(t), e, { headers: r });
280
286
  },
281
287
  deleteUsers: (t) => {
282
288
  const e = { id: JSON.stringify(t) };
283
- return g.delete("", { params: e });
289
+ return u.delete("", { params: e });
284
290
  },
285
- putToggleStatusUsers: (t) => g.put("/active-status", t),
291
+ putToggleStatusUsers: (t) => u.put("/active-status", t),
286
292
  getUserOptions: (t) => {
287
293
  const e = {};
288
- return e[t] = !0, g.get("/options", { params: e });
294
+ return e[t] = !0, u.get("/options", { params: e });
289
295
  },
290
- deleteCancelEmailChange: (t) => g.delete("/cancel-email-change/".concat(t)),
291
- postResendEmail: (t) => g.post("/resend-email", t),
292
- putChangePassword: (t, e) => g.put("/change-password/".concat(t), e)
293
- }, O = i({
294
- prefix: "/v2/general-settings"
296
+ deleteCancelEmailChange: (t) => u.delete("/cancel-email-change/".concat(t)),
297
+ postResendEmail: (t) => u.post("/resend-email", t),
298
+ putChangePassword: (t, e) => u.put("/change-password/".concat(t), e)
299
+ }, O = a({
300
+ prefix: "/global-settings/v2/general-settings"
295
301
  }), Z = {
296
302
  get: () => O.get("/"),
297
303
  update: (t) => O.put("/", t)
298
- }, d = i({
304
+ }, m = a({
299
305
  prefix: "/fam/utility/v2/file-manager"
300
306
  }), tt = {
301
- getStorageInformation: () => d.get("/files/storage"),
307
+ getStorageInformation: () => m.get("/files/storage"),
302
308
  postFileManager: (t, e) => {
303
- const r = o(e);
304
- return d.post("/".concat(t, "/list"), r);
309
+ const r = n(e);
310
+ return m.post("/".concat(t, "/list"), r);
305
311
  },
306
312
  postFileManagerOption: (t, e) => {
307
- const r = o(e);
308
- return d.post("/".concat(t, "/options"), r);
313
+ const r = n(e);
314
+ return m.post("/".concat(t, "/options"), r);
309
315
  },
310
- recoverFiles: (t, e) => d.put("/".concat(t, "/recover"), e),
311
- deleteFiles: (t, e) => d.delete("/".concat(t), { params: e }),
312
- deletePermanently: (t, e) => d.delete("/".concat(t, "/delete-permanent"), { params: e })
313
- }, c = i({
314
- prefix: "/v1/global-settings"
316
+ recoverFiles: (t, e) => m.put("/".concat(t, "/recover"), e),
317
+ deleteFiles: (t, e) => m.delete("/".concat(t), { params: e }),
318
+ deletePermanently: (t, e) => m.delete("/".concat(t, "/delete-permanent"), { params: e })
319
+ }, c = a({
320
+ prefix: "/global-settings"
315
321
  }), et = {
316
322
  getCustomFieldList: (t) => {
317
- const e = o(t);
323
+ const e = n(t);
318
324
  return c.post("/custom-fields/list", e);
319
325
  },
320
326
  getCustomFieldOptions: (t) => c.post("/custom-fields/options", t),
@@ -331,11 +337,11 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
331
337
  getActiveCustomField: () => c.get("/custom-fields/active"),
332
338
  getAvailableCustomField: (t) => {
333
339
  const e = { name: t };
334
- return c.get("/custom-fields", { params: e });
340
+ return c.get("/custom-fields/available", { params: e });
335
341
  }
336
342
  };
337
343
  export {
338
- j as AuthServices,
344
+ k as AuthServices,
339
345
  M as ChangelogServices,
340
346
  et as CustomFieldServices,
341
347
  H as DivisionServices,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/gsts-api-services",
3
- "version": "1.1.0-alpha.3",
3
+ "version": "1.1.0-alpha.30",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Global Settings Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -8,7 +8,10 @@ interface PasswordLoginCredentials extends Credentials {
8
8
  interface OTPLoginCredentials extends Credentials {
9
9
  otp: string;
10
10
  }
11
- export type LoginCredentials = PasswordLoginCredentials | OTPLoginCredentials;
11
+ export interface TokenCredential {
12
+ jwt: string;
13
+ }
14
+ export type LoginCredentials = PasswordLoginCredentials | OTPLoginCredentials | TokenCredential;
12
15
  export interface SetPasswordBody {
13
16
  password: string;
14
17
  token: string;
@@ -5,7 +5,7 @@ export type ChangelogResponse = FetchListResponse<ChangelogType>;
5
5
  export type ChangelogOptionResponse = FetchOptionResponse<ChangelogOptionFilter>;
6
6
  type HardwareType = 'Hardware Handheld' | 'Hardware Smart Fixed Reader' | 'Tablet';
7
7
  export interface ChangelogFilterQuery extends TableParams {
8
- objects?: string[];
8
+ object?: string;
9
9
  objectName?: string[];
10
10
  field?: string[];
11
11
  action?: string[];
@@ -42,9 +42,9 @@ export interface CreateUserBody {
42
42
  email: string;
43
43
  isTemporary?: boolean;
44
44
  expiryDate?: number;
45
- phoneNumber: string;
46
45
  access: string;
47
46
  userTag?: string;
47
+ customFields?: Record<string, any>;
48
48
  }
49
49
  export interface EditUserBody extends Partial<CreateUserBody> {
50
50
  changeProfilePicture: boolean;
@@ -1,5 +1,5 @@
1
1
  import { AxiosResponse } from 'axios';
2
- import { LoginCredentials, SetPasswordBody } from '../dto/auth.dto';
2
+ import { LoginCredentials, SetPasswordBody, TokenCredential } from '../dto/auth.dto';
3
3
  interface LoginResponse {
4
4
  data: {
5
5
  token: string;
@@ -9,9 +9,7 @@ interface LoginResponse {
9
9
  }
10
10
  declare const AuthServices: {
11
11
  login: (form: LoginCredentials) => Promise<AxiosResponse<LoginResponse>>;
12
- reLogin: (body: {
13
- jwt: string;
14
- }) => Promise<AxiosResponse<LoginResponse>>;
12
+ reLogin: (body: TokenCredential) => Promise<AxiosResponse<LoginResponse>>;
15
13
  requestOTP: (email: string) => Promise<AxiosResponse<any, any>>;
16
14
  requestResetPassLink: (email: string) => Promise<AxiosResponse<any, any>>;
17
15
  setPassword: (body: SetPasswordBody) => Promise<AxiosResponse<any, any>>;
@@ -4,7 +4,7 @@ import { FetchListResponse, FetchOptionResponse, FilterQuery } from '../types/fe
4
4
  import { HardwareChangelogType, SessionType, TaggingType, UserTagType } from '../types/changelog.type';
5
5
  declare const ChangelogServices: {
6
6
  getChangelogs: (params?: FilterQuery<ChangelogFilterQuery>) => Promise<AxiosResponse<ChangelogResponse>>;
7
- getChangelogOptions: (body?: ChangelogOptionQuery) => Promise<AxiosResponse<ChangelogOptionResponse>>;
7
+ getChangelogOptions: (params?: ChangelogOptionQuery) => Promise<AxiosResponse<ChangelogOptionResponse>>;
8
8
  getSessionList: (params?: FilterQuery<SessionFilterQuery>) => Promise<AxiosResponse<FetchListResponse<SessionType>>>;
9
9
  getSessionOptions: (body?: SessionOptionQuery) => Promise<AxiosResponse<FetchOptionResponse<SessionOptionFilter>>>;
10
10
  getHardwareChangelogs: (params?: FilterQuery<HardwareChangelogFilterQuery>) => Promise<AxiosResponse<FetchListResponse<HardwareChangelogType>>>;
@@ -1,5 +1,5 @@
1
1
  import { AxiosResponse } from 'axios';
2
- import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.type';
2
+ import { FetchDetailResponse, FetchListResponse, ShortFetchListResponse } from '../types/fetchResponse.type';
3
3
  import { CustomField, CustomFieldOptions, ActiveCustomField } from '../types/iam.type';
4
4
  import { GetCustomFieldListParams, GetCustomFieldOptionsParams, CreateEditCustomFieldPayload, SetActiveCustomFieldPayload } from '../dto/iam.dto';
5
5
  declare const CustomFieldServices: {
@@ -9,7 +9,7 @@ declare const CustomFieldServices: {
9
9
  editCustomField: (id: string, payload: CreateEditCustomFieldPayload) => Promise<AxiosResponse>;
10
10
  setActiveCustomField: (ids: string[], payload: SetActiveCustomFieldPayload) => Promise<AxiosResponse>;
11
11
  deleteCustomField: (ids: string[]) => Promise<AxiosResponse>;
12
- getActiveCustomField: () => Promise<AxiosResponse<FetchListResponse<ActiveCustomField>>>;
12
+ getActiveCustomField: () => Promise<AxiosResponse<ShortFetchListResponse<ActiveCustomField>>>;
13
13
  getAvailableCustomField: (name: string) => Promise<AxiosResponse>;
14
14
  };
15
15
  export default CustomFieldServices;
@@ -9,5 +9,6 @@ declare const DivisionServices: {
9
9
  postCreateDivision: (body: CreateEditMasterDataBody) => Promise<AxiosResponse>;
10
10
  putEditDivision: (id: string, body: CreateEditMasterDataBody) => Promise<AxiosResponse>;
11
11
  deleteDivisions: (ids: string[]) => Promise<AxiosResponse>;
12
+ getAvailableDivision: (name: string) => Promise<AxiosResponse>;
12
13
  };
13
14
  export default DivisionServices;
@@ -9,5 +9,6 @@ declare const PositionServices: {
9
9
  postCreatePosition: (body: CreateEditMasterDataBody) => Promise<AxiosResponse>;
10
10
  putEditPosition: (id: string, body: CreateEditMasterDataBody) => Promise<AxiosResponse>;
11
11
  deletePositions: (ids: string[]) => Promise<AxiosResponse>;
12
+ getAvailablePosition: (name: string) => Promise<AxiosResponse>;
12
13
  };
13
14
  export default PositionServices;
@@ -18,6 +18,10 @@ export type FileManagerType = {
18
18
  view: boolean;
19
19
  };
20
20
  };
21
+ user: {
22
+ _id: string;
23
+ name: string;
24
+ };
21
25
  modifiedBy: string;
22
26
  transactionId: string;
23
27
  };
@@ -93,7 +93,8 @@ export interface UserCustomField {
93
93
  dataType: DataType;
94
94
  isRequired: boolean;
95
95
  optionValue: string[];
96
- value: string | number | string[] | Date;
96
+ value: string | number | Date;
97
+ decimalPlaces?: number;
97
98
  }
98
99
  export interface GlobalUserDetail {
99
100
  _id: string;
@@ -167,7 +168,7 @@ export interface CustomField {
167
168
  optionValue: string[];
168
169
  usedOptions: string[];
169
170
  isActive: boolean;
170
- isRequired: 'Yes' | 'No' | BaseString;
171
+ isRequired: boolean;
171
172
  createdAt: string;
172
173
  updatedAt: string;
173
174
  decimalPlaces?: number;
@@ -177,7 +178,7 @@ export interface ActiveCustomField {
177
178
  name: string;
178
179
  dataType: DataType;
179
180
  optionValue: string[];
180
- isRequired: 'Yes' | 'No' | BaseString;
181
+ isRequired: boolean;
181
182
  decimalPlaces?: number;
182
183
  }
183
184
  export interface CustomFieldList {
@@ -5,3 +5,11 @@ export interface MasterDataItem {
5
5
  createdAt: string;
6
6
  updatedAt: string;
7
7
  }
8
+ export interface CustomField {
9
+ _id: string;
10
+ name: string;
11
+ dataType: string;
12
+ decimalPlaces: number;
13
+ optionValue: string[];
14
+ isRequired: boolean;
15
+ }
@@ -1,3 +1,4 @@
1
+ import { CustomField } from './masterData.type';
1
2
  export type UserType = 'Basic' | 'Admin';
2
3
  export type User = {
3
4
  _id: string;
@@ -9,7 +10,6 @@ export type User = {
9
10
  division: string;
10
11
  email: string;
11
12
  employeeId: string;
12
- phoneNumber: string;
13
13
  modifiedBy: {
14
14
  _id: string;
15
15
  fullName: string;
@@ -40,11 +40,11 @@ export type UserDetail = {
40
40
  position?: string;
41
41
  division: string;
42
42
  employeeId?: string;
43
- phoneNumber: string;
44
43
  isTemporary: boolean;
45
44
  expiryDate: string;
46
45
  access: string[];
47
46
  isConfirmed: boolean;
47
+ customFields: CustomField[];
48
48
  name: string;
49
49
  userTag?: string;
50
50
  isSelf?: boolean;
@@ -60,7 +60,6 @@ export type UserItem = {
60
60
  position: string;
61
61
  division: string;
62
62
  employeeId: string;
63
- phoneNumber: string;
64
63
  modifiedBy: ModifiedBy;
65
64
  lastUpdate: string;
66
65
  isEmailConfirmed: boolean;