@tagsamurai/gsts-api-services 1.1.0-alpha.2 → 1.1.0-alpha.21

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,34 +1,34 @@
1
- import R from "axios";
2
- const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.local" }, T = (t = "APP_TAGSAMURAI_API") => E["VITE_" + t], i = (t = {}, e = !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], a = (t = {}, e = !1) => {
3
3
  const {
4
4
  env: r = "APP_TAGSAMURAI_API",
5
5
  prefix: o = "",
6
- headers: u = {},
7
- ...d
8
- } = t, O = "".concat(T(r)).concat(o), y = R.create({
9
- ...d,
10
- baseURL: O,
11
- headers: e ? u : {
6
+ headers: i = {},
7
+ ...f
8
+ } = t, w = "".concat(T(r)).concat(o), b = L.create({
9
+ ...f,
10
+ baseURL: w,
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) => {
17
- var m, S, P;
18
- const $ = JSON.parse((m = localStorage.getItem("user")) != null ? m : "{}"), w = (P = (S = $.jwt) != null ? S : $.token) != null ? P : "";
19
- return A.headers.Authorization = "Bearer ".concat(w), A;
20
- }), y;
21
- }, l = i({
22
- prefix: "/global-settings/v1/global-settings/auth"
23
- }), L = (t) => {
24
- var e, r, o, u;
25
- return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((u = (o = t.response) == null ? void 0 : o.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);
16
+ return b.interceptors.request.use((v) => {
17
+ var S, P, h;
18
+ const $ = JSON.parse((S = localStorage.getItem("user")) != null ? S : "{}"), R = (h = (P = $.jwt) != null ? P : $.token) != null ? h : "";
19
+ return v.headers.Authorization = "Bearer ".concat(R), v;
20
+ }), b;
21
+ }, l = a({
22
+ prefix: "/global-settings/auth"
23
+ }), E = (t) => {
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
26
  }, j = {
27
27
  login: (t) => {
28
28
  const e = { ...t, isMobile: !1 };
29
29
  return l.post("/login", e);
30
30
  },
31
- reLogin: (t) => (l.interceptors.response.use((e) => e, L), l.post("/login", t)),
31
+ reLogin: (t) => (l.interceptors.response.use((e) => e, E), l.post("/login", t)),
32
32
  requestOTP: (t) => {
33
33
  const e = { email: t };
34
34
  return l.post("/request-otp", e);
@@ -51,12 +51,12 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
51
51
  logout: () => l.post("/logout")
52
52
  }, U = (t, e, r) => {
53
53
  const o = new URL(T("APP_TAGSAMURAI_API") || "").origin;
54
- let u = t.startsWith("http") ? t : "".concat(o, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
54
+ let i = t.startsWith("http") ? t : "".concat(o, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
55
55
  if (e || r) {
56
- const d = new URLSearchParams();
57
- e && (d.set("width", e.toString()), d.set("height", (r == null ? void 0 : r.toString()) || e.toString())), u += "?".concat(d.toString());
56
+ const f = new URLSearchParams();
57
+ e && (f.set("width", e.toString()), f.set("height", (r == null ? void 0 : r.toString()) || e.toString())), i += "?".concat(f.toString());
58
58
  }
59
- return u;
59
+ return i;
60
60
  }, x = () => {
61
61
  var e, r, o;
62
62
  const t = JSON.parse((e = localStorage.getItem("user")) != null ? e : "{}");
@@ -73,7 +73,7 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
73
73
  return new Blob([o], {
74
74
  type: r.headers.get("Content-Type") || "image/webp"
75
75
  });
76
- }, C = async (t) => {
76
+ }, _ = async (t) => {
77
77
  try {
78
78
  const e = x(), r = await D(t, e);
79
79
  return URL.createObjectURL(r);
@@ -82,9 +82,9 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
82
82
  }
83
83
  }, B = async (t, e, r, o) => {
84
84
  if (!t) return;
85
- const u = U(t, e, r);
86
- return o ? u : C(u);
87
- }, M = (t) => {
85
+ const i = U(t, e, r);
86
+ return o ? i : _(i);
87
+ }, J = (t) => {
88
88
  if (!t || typeof t == "string")
89
89
  return;
90
90
  const e = {};
@@ -95,7 +95,7 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
95
95
  [r]: t[r]
96
96
  });
97
97
  }), e;
98
- }, _ = (t) => {
98
+ }, G = (t) => {
99
99
  if (typeof t != "string") return !1;
100
100
  const e = t.trim();
101
101
  if (!e) return !1;
@@ -109,17 +109,14 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
109
109
  return {};
110
110
  const e = {};
111
111
  return Object.keys(t).forEach((r) => {
112
- const o = t[r];
113
- e[r] = _(o) ? JSON.parse(o.trim()) : o;
112
+ const o = t[r], i = G(o) ? JSON.parse(o.trim()) : o;
113
+ e[r] = Array.isArray(i) && i.length === 0 ? void 0 : i;
114
114
  }), e;
115
- }, p = i({
116
- prefix: "/global-settings/v1/global-settings/change-log"
117
- }), H = {
118
- getChangelogs: (t) => {
119
- const e = n(t);
120
- return p.post("/change-log/list", e);
121
- },
122
- getChangelogOptions: (t) => p.post("/change-log/options", t),
115
+ }, p = a({
116
+ prefix: "/global-settings"
117
+ }), M = {
118
+ getChangelogs: (t) => p.get("/change-log", { params: t }),
119
+ getChangelogOptions: (t) => p.get("/change-log/options", { params: t }),
123
120
  getSessionList: (t) => {
124
121
  const e = n(t);
125
122
  return p.post("/session-log/list", e);
@@ -140,53 +137,53 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
140
137
  return p.post("/reader-user-tag-log/list", e);
141
138
  },
142
139
  getUserTagOptions: (t) => p.post("/reader-user-tag-log/options", t)
143
- }, b = i({
144
- prefix: "/global-settings/v1/global-settings/division"
145
- }), J = {
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),
140
+ }, m = a({
141
+ prefix: "/global-settings/division"
142
+ }), H = {
143
+ getDivisions: (t) => m.get("", { params: t }),
144
+ getDivisionDetail: (t) => m.get("/".concat(t)),
145
+ postCreateDivision: (t) => m.post("/", t),
146
+ putEditDivision: (t, e) => m.put("/".concat(t), e),
150
147
  deleteDivisions: (t) => {
151
148
  const e = { id: JSON.stringify(t) };
152
- return b.delete("", { params: e });
149
+ return m.delete("", { params: e });
153
150
  }
154
- }, a = i({
155
- prefix: "/global-settings/v1/global-settings"
156
- }), F = {
151
+ }, g = a({
152
+ prefix: "/global-settings"
153
+ }), q = {
157
154
  getAllTAG: (t) => {
158
155
  const e = n(t);
159
- return a.post("/all-tag/list", e);
156
+ return g.post("/all-tag/list", e);
160
157
  },
161
158
  getAllTAGOptions: (t) => {
162
159
  const e = n(t);
163
- return a.post("all-tag/options", e);
160
+ return g.post("all-tag/options", e);
164
161
  },
165
- getNotPairedYetCounts: () => a.get("/not-paired-yet/tag-count"),
162
+ getNotPairedYetCounts: () => g.get("/not-paired-yet/tag-count"),
166
163
  getNotPairedYetList: (t) => {
167
164
  const e = n(t);
168
- return a.post("/not-paired-yet/list", e);
165
+ return g.post("/not-paired-yet/list", e);
169
166
  },
170
167
  getNotPairedYetOptions: (t) => {
171
168
  const e = n(t);
172
- return a.post("/not-paired-yet/options", e);
169
+ return g.post("/not-paired-yet/options", e);
173
170
  },
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),
171
+ getAuditTAGDetail: (t) => g.post("/audit/detail", t),
172
+ submitAuditTAG: (t) => g.post("/audit/submit", t),
173
+ submitCombineTAG: (t) => g.post("/combine-tag/combine", t),
174
+ submitSeparateTAG: (t) => g.post("/combine-tag/separate", t),
178
175
  getPairedList: (t) => {
179
176
  const e = n(t);
180
- return a.post("/paired/list", e);
177
+ return g.post("/paired/list", e);
181
178
  },
182
179
  getPairedOptions: (t) => {
183
180
  const e = n(t);
184
- return a.post("/paired/options", e);
181
+ return g.post("/paired/options", e);
185
182
  },
186
- getScanTag: (t) => a.get("/scan-tag", { params: { tag: t } })
187
- }, s = i({
188
- prefix: "/global-settings/v1/global-settings"
189
- }), q = {
183
+ getScanTag: (t) => g.get("/scan-tag", { params: { tag: t } })
184
+ }, s = a({
185
+ prefix: "/global-settings"
186
+ }), V = {
190
187
  getHandheldReader: (t) => {
191
188
  const e = n(t);
192
189
  return s.post("/handheld-reader/list", e);
@@ -224,108 +221,132 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
224
221
  getDetailActivityLog: (t) => s.get("/activity-log", { params: t }),
225
222
  getDetailActivityLogOptions: (t) => s.get("/activity-log/options", { params: t }),
226
223
  getExistingAliasNames: () => s.get("/reader/alias-names")
227
- }, G = i({
224
+ }, F = a({
228
225
  prefix: "/fam/utility/v2"
229
- }), V = {
230
- getSessionLogList: (t) => G.get("/session-log", { params: t })
231
- }, h = i({
232
- prefix: "/global-settings/v1/global-settings/option"
233
226
  }), Y = {
234
- getPositions: () => h.get("/position"),
235
- getDivisions: () => h.get("/division")
236
- }, f = i({
237
- prefix: "/global-settings/v1/global-settings/position"
227
+ getSessionLogList: (t) => F.get("/session-log", { params: t })
228
+ }, I = a({
229
+ prefix: "/global-settings/option"
238
230
  }), z = {
239
- getPositions: (t) => f.get("", { params: t }),
240
- getPositionDetail: (t) => f.get("/".concat(t)),
241
- postCreatePosition: (t) => f.post("/", t),
242
- putEditPosition: (t, e) => f.put("/".concat(t), e),
231
+ getPositions: () => I.get("/position"),
232
+ getDivisions: () => I.get("/division")
233
+ }, A = a({
234
+ prefix: "/global-settings/position"
235
+ }), W = {
236
+ getPositions: (t) => A.get("", { params: t }),
237
+ getPositionDetail: (t) => A.get("/".concat(t)),
238
+ postCreatePosition: (t) => A.post("/", t),
239
+ putEditPosition: (t, e) => A.put("/".concat(t), e),
243
240
  deletePositions: (t) => {
244
241
  const e = { id: JSON.stringify(t) };
245
- return f.delete("", { params: e });
242
+ return A.delete("", { params: e });
246
243
  }
247
- }, N = i({
244
+ }, N = a({
248
245
  prefix: "/fam/tag/v2"
249
- }), W = {
250
- getTagInfo: (t) => N.get("/rfid-qr/scan", { params: t })
251
- }, v = i({
252
- prefix: "/global-settings/v1/global-settings/change-log"
253
246
  }), K = {
247
+ getTagInfo: (t) => N.get("/rfid-qr/scan", { params: t })
248
+ }, y = a({
249
+ prefix: "/global-settings/change-log"
250
+ }), Q = {
254
251
  getTAGEventlog: (t) => {
255
252
  const e = n(t);
256
- return v.post("/tag-event-log/list", e);
253
+ return y.post("/tag-event-log/list", e);
257
254
  },
258
255
  getTAGEventlogOptions: (t) => {
259
256
  const e = n(t);
260
- return v.post("/tag-event-log/options", e);
257
+ return y.post("/tag-event-log/options", e);
261
258
  },
262
- getDetailTAGEventlog: (t) => v.get("/tag-event-log/".concat(t))
263
- }, g = i({
264
- prefix: "/global-settings/v1/global-settings/user"
265
- }), Q = {
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 }),
259
+ getDetailTAGEventlog: (t) => y.get("/tag-event-log/".concat(t))
260
+ }, u = a({
261
+ prefix: "/global-settings/user"
262
+ }), X = {
263
+ getUsers: (t) => u.get("", { params: t }),
264
+ getUserDetail: (t) => u.get("/".concat(t)),
265
+ getUserSystemLogs: (t, e) => u.get("/".concat(t, "/system-logs"), { params: e }),
269
266
  getUserSystemLogOptions: (t, e) => {
270
267
  const r = {};
271
- return r[e] = !0, g.get("/".concat(t, "/system-logs/options"), { params: r });
268
+ return r[e] = !0, u.get("/".concat(t, "/system-logs/options"), { params: r });
272
269
  },
273
270
  postCreateUser: (t) => {
274
271
  const e = { "Content-Type": "multipart/form-data" };
275
- return g.post("", t, { headers: e });
272
+ return u.post("", t, { headers: e });
276
273
  },
277
274
  putEditUser: (t, e) => {
278
275
  const r = { "Content-Type": "multipart/form-data" };
279
- return g.put("/".concat(t), e, { headers: r });
276
+ return u.put("/".concat(t), e, { headers: r });
280
277
  },
281
278
  deleteUsers: (t) => {
282
279
  const e = { id: JSON.stringify(t) };
283
- return g.delete("", { params: e });
280
+ return u.delete("", { params: e });
284
281
  },
285
- putToggleStatusUsers: (t) => g.put("/active-status", t),
282
+ putToggleStatusUsers: (t) => u.put("/active-status", t),
286
283
  getUserOptions: (t) => {
287
284
  const e = {};
288
- return e[t] = !0, g.get("/options", { params: e });
285
+ return e[t] = !0, u.get("/options", { params: e });
289
286
  },
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
- }, I = i({
294
- prefix: "/v2/general-settings"
295
- }), X = {
296
- get: () => I.get("/"),
297
- update: (t) => I.put("/", t)
298
- }, c = i({
299
- prefix: "/fam/utility/v2/file-manager"
287
+ deleteCancelEmailChange: (t) => u.delete("/cancel-email-change/".concat(t)),
288
+ postResendEmail: (t) => u.post("/resend-email", t),
289
+ putChangePassword: (t, e) => u.put("/change-password/".concat(t), e)
290
+ }, O = a({
291
+ prefix: "/global-settings/v2/general-settings"
300
292
  }), Z = {
301
- getStorageInformation: () => c.get("/files/storage"),
293
+ get: () => O.get("/"),
294
+ update: (t) => O.put("/", t)
295
+ }, d = a({
296
+ prefix: "/fam/utility/v2/file-manager"
297
+ }), tt = {
298
+ getStorageInformation: () => d.get("/files/storage"),
302
299
  postFileManager: (t, e) => {
303
300
  const r = n(e);
304
- return c.post("/".concat(t, "/list"), r);
301
+ return d.post("/".concat(t, "/list"), r);
305
302
  },
306
303
  postFileManagerOption: (t, e) => {
307
304
  const r = n(e);
308
- return c.post("/".concat(t, "/options"), r);
305
+ return d.post("/".concat(t, "/options"), r);
309
306
  },
310
- recoverFiles: (t, e) => c.put("/".concat(t, "/recover"), e),
311
- deleteFiles: (t, e) => c.delete("/".concat(t), { params: e }),
312
- deletePermanently: (t, e) => c.delete("/".concat(t, "/delete-permanent"), { params: e })
307
+ recoverFiles: (t, e) => d.put("/".concat(t, "/recover"), e),
308
+ deleteFiles: (t, e) => d.delete("/".concat(t), { params: e }),
309
+ deletePermanently: (t, e) => d.delete("/".concat(t, "/delete-permanent"), { params: e })
310
+ }, c = a({
311
+ prefix: "/global-settings"
312
+ }), et = {
313
+ getCustomFieldList: (t) => {
314
+ const e = n(t);
315
+ return c.post("/custom-fields/list", e);
316
+ },
317
+ getCustomFieldOptions: (t) => c.post("/custom-fields/options", t),
318
+ createCustomField: (t) => c.post("/custom-fields", t),
319
+ editCustomField: (t, e) => c.patch("/custom-fields/".concat(t), e),
320
+ setActiveCustomField: (t, e) => {
321
+ const r = { ids: JSON.stringify(t) };
322
+ return c.patch("/custom-fields/set-active", e, { params: r });
323
+ },
324
+ deleteCustomField: (t) => {
325
+ const e = { ids: JSON.stringify(t) };
326
+ return c.delete("/custom-fields", { params: e });
327
+ },
328
+ getActiveCustomField: () => c.get("/custom-fields/active"),
329
+ getAvailableCustomField: (t) => {
330
+ const e = { name: t };
331
+ return c.get("/custom-fields/available", { params: e });
332
+ }
313
333
  };
314
334
  export {
315
335
  j as AuthServices,
316
- H as ChangelogServices,
317
- J as DivisionServices,
318
- Z as FileManagerServices,
319
- X as GeneralSettingServices,
320
- F as GlobalTagServices,
321
- q as HardwareServices,
322
- V as LogServices,
323
- Y as OptionServices,
324
- z as PositionServices,
325
- K as TagEventlogServices,
326
- W as TagServices,
327
- Q as UserServices,
336
+ M as ChangelogServices,
337
+ et as CustomFieldServices,
338
+ H as DivisionServices,
339
+ tt as FileManagerServices,
340
+ Z as GeneralSettingServices,
341
+ q as GlobalTagServices,
342
+ V as HardwareServices,
343
+ Y as LogServices,
344
+ z as OptionServices,
345
+ W as PositionServices,
346
+ Q as TagEventlogServices,
347
+ K as TagServices,
348
+ X as UserServices,
328
349
  T as getBaseURL,
329
350
  B as getImageURL,
330
- M as queryParamsStringfy
351
+ J as queryParamsStringfy
331
352
  };
package/main.d.ts CHANGED
@@ -11,4 +11,5 @@ export { default as TagEventlogServices } from './src/services/tagEventlog.servi
11
11
  export { default as UserServices } from './src/services/user.service';
12
12
  export { default as GeneralSettingServices } from './src/services/generalSetting.service';
13
13
  export { default as FileManagerServices } from './src/services/fileManager.service';
14
+ export { default as CustomFieldServices } from './src/services/customField.service';
14
15
  export { getBaseURL, getImageURL, queryParamsStringfy } from './src/utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/gsts-api-services",
3
- "version": "1.1.0-alpha.2",
3
+ "version": "1.1.0-alpha.21",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Global Settings Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -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;
@@ -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>>>;
@@ -0,0 +1,15 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { FetchDetailResponse, FetchListResponse, ShortFetchListResponse } from '../types/fetchResponse.type';
3
+ import { CustomField, CustomFieldOptions, ActiveCustomField } from '../types/iam.type';
4
+ import { GetCustomFieldListParams, GetCustomFieldOptionsParams, CreateEditCustomFieldPayload, SetActiveCustomFieldPayload } from '../dto/iam.dto';
5
+ declare const CustomFieldServices: {
6
+ getCustomFieldList: (params: GetCustomFieldListParams) => Promise<AxiosResponse<FetchListResponse<CustomField>>>;
7
+ getCustomFieldOptions: (params: GetCustomFieldOptionsParams) => Promise<AxiosResponse<FetchDetailResponse<CustomFieldOptions>>>;
8
+ createCustomField: (payload: CreateEditCustomFieldPayload) => Promise<AxiosResponse>;
9
+ editCustomField: (id: string, payload: CreateEditCustomFieldPayload) => Promise<AxiosResponse>;
10
+ setActiveCustomField: (ids: string[], payload: SetActiveCustomFieldPayload) => Promise<AxiosResponse>;
11
+ deleteCustomField: (ids: string[]) => Promise<AxiosResponse>;
12
+ getActiveCustomField: () => Promise<AxiosResponse<ShortFetchListResponse<ActiveCustomField>>>;
13
+ getAvailableCustomField: (name: string) => Promise<AxiosResponse>;
14
+ };
15
+ export default CustomFieldServices;
@@ -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
  };
@@ -167,7 +167,7 @@ export interface CustomField {
167
167
  optionValue: string[];
168
168
  usedOptions: string[];
169
169
  isActive: boolean;
170
- isRequired: 'Yes' | 'No' | BaseString;
170
+ isRequired: boolean;
171
171
  createdAt: string;
172
172
  updatedAt: string;
173
173
  decimalPlaces?: number;
@@ -177,7 +177,7 @@ export interface ActiveCustomField {
177
177
  name: string;
178
178
  dataType: DataType;
179
179
  optionValue: string[];
180
- isRequired: 'Yes' | 'No' | BaseString;
180
+ isRequired: boolean;
181
181
  decimalPlaces?: number;
182
182
  }
183
183
  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;