@tagsamurai/gsts-api-services 2.0.1-alpha.44 → 2.0.1-alpha.46

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,10 +2,10 @@ import R from "axios";
2
2
  const E = { 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" }, O = (t = "APP_TAGSAMURAI_API") => E["VITE_" + t], u = (t = {}, e = !1) => {
3
3
  const {
4
4
  env: r = "APP_GLOBAL_SETTINGS_API",
5
- prefix: i = "",
5
+ prefix: n = "",
6
6
  headers: p = {},
7
7
  ...f
8
- } = t, U = "".concat(O(r)).concat(i), P = R.create({
8
+ } = t, U = "".concat(O(r)).concat(n), P = R.create({
9
9
  ...f,
10
10
  baseURL: U,
11
11
  headers: e ? p : {
@@ -14,53 +14,53 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
14
14
  }
15
15
  });
16
16
  return P.interceptors.request.use((y) => {
17
- var T, $, D;
18
- const S = JSON.parse((T = localStorage.getItem("user")) != null ? T : "{}"), L = (D = ($ = S.jwt) != null ? $ : S.token) != null ? D : "";
17
+ var $, T, D;
18
+ const S = JSON.parse(($ = localStorage.getItem("user")) != null ? $ : "{}"), L = (D = (T = S.jwt) != null ? T : S.token) != null ? D : "";
19
19
  return y.headers.Authorization = "Bearer ".concat(L), y;
20
20
  }), P;
21
- }, l = u({
21
+ }, d = u({
22
22
  prefix: "/v1/global-settings/auth"
23
- }), _ = (t) => {
24
- var e, r, i, p;
25
- return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((p = (i = t.response) == null ? void 0 : i.data) == null ? void 0 : p.message) === "jwt malformed" ? (window.onblur = null, window.onfocus = null, window.sessionExpired = !0, window.dispatchEvent(new CustomEvent("user:expired"))) : Promise.reject(t);
23
+ }), C = (t) => {
24
+ var e, r, n, p;
25
+ return ((e = t.response) == null ? void 0 : e.status) === 401 || ((r = t.response) == null ? void 0 : r.status) === 500 || ((p = (n = t.response) == null ? void 0 : n.data) == null ? void 0 : p.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
- return l.post("/login", e);
29
+ return d.post("/login", e);
30
30
  },
31
- reLogin: (t) => (l.interceptors.response.use((e) => e, _), l.post("/login", t)),
31
+ reLogin: (t) => (d.interceptors.response.use((e) => e, C), d.post("/login", t)),
32
32
  requestOTP: (t) => {
33
33
  const e = { email: t };
34
- return l.post("/request-otp", e);
34
+ return d.post("/request-otp", e);
35
35
  },
36
36
  requestResetPassLink: (t) => {
37
37
  const e = { email: t };
38
- return l.post("/request-reset-link", e);
38
+ return d.post("/request-reset-link", e);
39
39
  },
40
- setPassword: (t) => l.post("/set-password", t),
41
- verifyToken: (t) => l.get("/verify-token/".concat(t)),
40
+ setPassword: (t) => d.post("/set-password", t),
41
+ verifyToken: (t) => d.get("/verify-token/".concat(t)),
42
42
  confirmEmailChange: (t) => {
43
43
  const e = { token: t };
44
- return l.put("/confirm-email-change/confirm", e);
44
+ return d.put("/confirm-email-change/confirm", e);
45
45
  },
46
- postLogout: () => l.post("/logout"),
46
+ postLogout: () => d.post("/logout"),
47
47
  /**
48
48
  *
49
49
  * @deprecated use postLogout instead
50
50
  */
51
- logout: () => l.post("/logout")
52
- }, C = (t, e, r) => {
53
- const i = new URL(O("APP_TAGSAMURAI_API") || "").origin;
54
- let p = t.startsWith("http") ? t : "".concat(i, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
51
+ logout: () => d.post("/logout")
52
+ }, _ = (t, e, r) => {
53
+ const n = new URL(O("APP_TAGSAMURAI_API") || "").origin;
54
+ let p = t.startsWith("http") ? t : "".concat(n, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
55
55
  if (e || r) {
56
56
  const f = new URLSearchParams();
57
57
  e && (f.set("width", e.toString()), f.set("height", (r == null ? void 0 : r.toString()) || e.toString())), p += "?".concat(f.toString());
58
58
  }
59
59
  return p;
60
60
  }, F = () => {
61
- var e, r, i;
61
+ var e, r, n;
62
62
  const t = JSON.parse((e = localStorage.getItem("user")) != null ? e : "{}");
63
- return (i = (r = t.jwt) != null ? r : t.token) != null ? i : "";
63
+ return (n = (r = t.jwt) != null ? r : t.token) != null ? n : "";
64
64
  }, x = async (t, e) => {
65
65
  const r = await fetch(t, {
66
66
  headers: {
@@ -69,8 +69,8 @@ const E = { 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 i = await r.arrayBuffer();
73
- return new Blob([i], {
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
  }, G = async (t) => {
@@ -80,10 +80,10 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
80
80
  } catch (e) {
81
81
  return;
82
82
  }
83
- }, j = async (t, e, r, i) => {
83
+ }, j = async (t, e, r, n) => {
84
84
  if (!t) return;
85
- const p = C(t, e, r);
86
- return i ? p : G(p);
85
+ const p = _(t, e, r);
86
+ return n ? p : G(p);
87
87
  }, B = (t) => {
88
88
  if (!t || typeof t == "string")
89
89
  return;
@@ -104,39 +104,39 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
104
104
  } catch (r) {
105
105
  return !1;
106
106
  }
107
- }, n = (t) => {
107
+ }, i = (t) => {
108
108
  if (!t)
109
109
  return {};
110
110
  const e = {};
111
111
  return Object.keys(t).forEach((r) => {
112
- const i = t[r];
113
- e[r] = N(i) ? JSON.parse(i.trim()) : i;
112
+ const n = t[r];
113
+ e[r] = N(n) ? JSON.parse(n.trim()) : n;
114
114
  }), e;
115
115
  }, c = u({
116
116
  prefix: "/v2/analytics-reporting"
117
117
  }), q = {
118
118
  getChangelogs: (t) => {
119
- const e = n(t);
119
+ const e = i(t);
120
120
  return c.post("/change-log/list", e);
121
121
  },
122
122
  getChangelogOptions: (t) => c.post("/change-log/options", t),
123
123
  getSessionList: (t) => {
124
- const e = n(t);
124
+ const e = i(t);
125
125
  return c.post("/session-log/list", e);
126
126
  },
127
127
  getSessionOptions: (t) => c.post("/session-log/options", t),
128
128
  getHardwareChangelogs: (t) => {
129
- const e = n(t);
129
+ const e = i(t);
130
130
  return c.post("/hardware-change-log/list", e);
131
131
  },
132
132
  getHardwareOptions: (t) => c.post("/hardware-change-log/options", t),
133
133
  getTaggingList: (t) => {
134
- const e = n(t);
134
+ const e = i(t);
135
135
  return c.post("/reader-tagging-log/list", e);
136
136
  },
137
137
  getTaggingOptions: (t) => c.post("/reader-tagging-log/options", t),
138
138
  getUserTagList: (t) => {
139
- const e = n(t);
139
+ const e = i(t);
140
140
  return c.post("/reader-user-tag-log/list", e);
141
141
  },
142
142
  getUserTagOptions: (t) => c.post("/reader-user-tag-log/options", t)
@@ -155,20 +155,20 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
155
155
  prefix: "/v2/hardware-tagging"
156
156
  }), Y = {
157
157
  getAllTAG: (t) => {
158
- const e = n(t);
158
+ const e = i(t);
159
159
  return g.post("/all-tag/list", e);
160
160
  },
161
161
  getAllTAGOptions: (t) => {
162
- const e = n(t);
162
+ const e = i(t);
163
163
  return g.post("all-tag/options", e);
164
164
  },
165
165
  getNotPairedYetCounts: () => g.get("/not-paired-yet/tag-count"),
166
166
  getNotPairedYetList: (t) => {
167
- const e = n(t);
167
+ const e = i(t);
168
168
  return g.post("/not-paired-yet/list", e);
169
169
  },
170
170
  getNotPairedYetOptions: (t) => {
171
- const e = n(t);
171
+ const e = i(t);
172
172
  return g.post("/not-paired-yet/options", e);
173
173
  },
174
174
  getAuditTAGDetail: (t) => g.post("/audit/detail", t),
@@ -176,11 +176,11 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
176
176
  submitCombineTAG: (t) => g.post("/combine-tag/combine", t),
177
177
  submitSeparateTAG: (t) => g.post("/combine-tag/separate", t),
178
178
  getPairedList: (t) => {
179
- const e = n(t);
179
+ const e = i(t);
180
180
  return g.post("/paired/list", e);
181
181
  },
182
182
  getPairedOptions: (t) => {
183
- const e = n(t);
183
+ const e = i(t);
184
184
  return g.post("/paired/options", e);
185
185
  },
186
186
  getScanTag: (t) => g.get("/scan-tag", { params: { tag: t } })
@@ -188,7 +188,7 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
188
188
  prefix: "/v2/hardware-tagging"
189
189
  }), z = {
190
190
  getHandheldReader: (t) => {
191
- const e = n(t);
191
+ const e = i(t);
192
192
  return o.post("/handheld-reader/list", e);
193
193
  },
194
194
  getHandheldReaderDetail: (t) => o.get("/handheld-reader/".concat(t)),
@@ -206,7 +206,7 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
206
206
  }),
207
207
  putAntennaPower: (t, e) => o.put("/iot-reader/".concat(e, "/set-antenna-power"), t),
208
208
  getIotReader: (t) => {
209
- const e = n({ ...t });
209
+ const e = i({ ...t });
210
210
  return o.post("/iot-reader", e);
211
211
  },
212
212
  getIotReaderDetail: (t) => o.get("/iot-reader/".concat(t)),
@@ -254,44 +254,44 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
254
254
  prefix: "/v2/hardware-tagging"
255
255
  }), Z = {
256
256
  getTAGEventlog: (t) => {
257
- const e = n(t);
257
+ const e = i(t);
258
258
  return A.post("/tag-event-log/list", e);
259
259
  },
260
260
  getTAGEventlogOptions: (t) => {
261
- const e = n(t);
261
+ const e = i(t);
262
262
  return A.post("/tag-event-log/options", e);
263
263
  },
264
264
  getDetailTAGEventlog: (t) => A.get("/tag-event-log/".concat(t))
265
- }, d = u({
265
+ }, l = u({
266
266
  prefix: "/v1/global-settings/user"
267
267
  }), tt = {
268
- getUsers: (t) => d.get("", { params: t }),
269
- getUserDetail: (t) => d.get("/".concat(t)),
270
- getUserSystemLogs: (t, e) => d.get("/".concat(t, "/system-logs"), { params: e }),
268
+ getUsers: (t) => l.get("", { params: t }),
269
+ getUserDetail: (t) => l.get("/".concat(t)),
270
+ getUserSystemLogs: (t, e) => l.get("/".concat(t, "/system-logs"), { params: e }),
271
271
  getUserSystemLogOptions: (t, e) => {
272
272
  const r = {};
273
- return r[e] = !0, d.get("/".concat(t, "/system-logs/options"), { params: r });
273
+ return r[e] = !0, l.get("/".concat(t, "/system-logs/options"), { params: r });
274
274
  },
275
275
  postCreateUser: (t) => {
276
276
  const e = { "Content-Type": "multipart/form-data" };
277
- return d.post("", t, { headers: e });
277
+ return l.post("", t, { headers: e });
278
278
  },
279
279
  putEditUser: (t, e) => {
280
280
  const r = { "Content-Type": "multipart/form-data" };
281
- return d.put("/".concat(t), e, { headers: r });
281
+ return l.put("/".concat(t), e, { headers: r });
282
282
  },
283
283
  deleteUsers: (t) => {
284
284
  const e = { id: JSON.stringify(t) };
285
- return d.delete("", { params: e });
285
+ return l.delete("", { params: e });
286
286
  },
287
- putToggleStatusUsers: (t) => d.put("/active-status", t),
287
+ putToggleStatusUsers: (t) => l.put("/active-status", t),
288
288
  getUserOptions: (t) => {
289
289
  const e = {};
290
- return e[t] = !0, d.get("/options", { params: e });
290
+ return e[t] = !0, l.get("/options", { params: e });
291
291
  },
292
- deleteCancelEmailChange: (t) => d.delete("/cancel-email-change/".concat(t)),
293
- postResendEmail: (t) => d.post("/resend-email", t),
294
- putChangePassword: (t, e) => d.put("/change-password/".concat(t), e)
292
+ deleteCancelEmailChange: (t) => l.delete("/cancel-email-change/".concat(t)),
293
+ postResendEmail: (t) => l.post("/resend-email", t),
294
+ putChangePassword: (t, e) => l.put("/change-password/".concat(t), e)
295
295
  }, h = u({
296
296
  prefix: "/v2/hardware-tagging"
297
297
  }), et = {
@@ -312,7 +312,7 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
312
312
  confirmEmailChange: (t) => s.post("/auth/confirm-email-change", { token: t }),
313
313
  cancelEmailChange: (t) => s.delete("/auth/cancel-email-change/".concat(t)),
314
314
  getPositionList: (t) => {
315
- const e = n(t);
315
+ const e = i(t);
316
316
  return s.post("/position/list", e);
317
317
  },
318
318
  getPositionDetail: (t) => s.get("/position/".concat(t)),
@@ -323,7 +323,7 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
323
323
  return s.delete("/position", { params: e });
324
324
  },
325
325
  getDivisionList: (t) => {
326
- const e = n(t);
326
+ const e = i(t);
327
327
  return s.post("/division/list", e);
328
328
  },
329
329
  getDivisionDetail: (t) => s.get("/division/".concat(t)),
@@ -335,18 +335,18 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
335
335
  },
336
336
  createUsers: (t) => {
337
337
  const e = new FormData();
338
- return Object.entries(t).forEach(([r, i]) => {
339
- i != null && e.append(r, i);
338
+ return Object.entries(t).forEach(([r, n]) => {
339
+ n != null && e.append(r, n);
340
340
  }), s.post("/users", e, {
341
341
  headers: { "Content-Type": "multipart/form-data" }
342
342
  });
343
343
  },
344
344
  getGlobalUserList: (t) => {
345
- const e = n(t);
345
+ const e = i(t);
346
346
  return s.post("/users/list", e);
347
347
  },
348
348
  getGlobalUserOptions: (t) => {
349
- const e = n(t);
349
+ const e = i(t);
350
350
  return s.post("/users/options", e);
351
351
  },
352
352
  getGlobalUserDetail: (t) => s.get("/users/".concat(t)),
@@ -356,8 +356,8 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
356
356
  },
357
357
  editUsers: (t, e) => {
358
358
  const r = new FormData();
359
- return Object.entries(e).forEach(([i, p]) => {
360
- p != null && r.append(i, p);
359
+ return Object.entries(e).forEach(([n, p]) => {
360
+ p != null && r.append(n, p);
361
361
  }), s.patch("/users/".concat(t), r, {
362
362
  headers: { "Content-Type": "multipart/form-data" }
363
363
  });
@@ -385,19 +385,24 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
385
385
  exportDivisionTable: () => s.post("/division/list/export", {}, { responseType: "blob" }),
386
386
  exportUserTable: () => s.post("/users/list/export", {}, { responseType: "blob" }),
387
387
  getCustomFieldList: (t) => {
388
- const e = n(t);
389
- return s.post("/custom-field/list", e);
388
+ const e = i(t);
389
+ return s.post("/custom-fields/list", e);
390
390
  },
391
- getCustomFieldOptions: (t) => s.post("/custom-field/options", t),
392
- createCustomField: (t) => s.post("/custom-field", t),
393
- editCustomField: (t, e) => s.patch("/custom-field/".concat(t), e),
391
+ getCustomFieldOptions: (t) => s.post("/custom-fields/options", t),
392
+ createCustomField: (t) => s.post("/custom-fields", t),
393
+ editCustomField: (t, e) => s.patch("/custom-fields/".concat(t), e),
394
394
  setActiveCustomField: (t, e) => {
395
395
  const r = { ids: JSON.stringify(t) };
396
- return s.patch("/custom-field/set-active", e, { params: r });
396
+ return s.patch("/custom-fields/set-active", e, { params: r });
397
397
  },
398
398
  deleteCustomField: (t) => {
399
399
  const e = { ids: JSON.stringify(t) };
400
- return s.delete("/custom-field", { params: e });
400
+ return s.delete("/custom-fields", { params: e });
401
+ },
402
+ getActiveCustomField: () => s.get("/custom-fields/active"),
403
+ getAvailableCustomField: (t) => {
404
+ const e = { name: t };
405
+ return s.get("/custom-fields", { params: e });
401
406
  }
402
407
  }, a = u({
403
408
  prefix: "/v2/import"
@@ -453,30 +458,20 @@ const E = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
453
458
  get: () => w.get("/"),
454
459
  update: (t) => w.put("/", t)
455
460
  }, m = u({
456
- prefix: "/v2/general-settings"
461
+ prefix: "/utility/v2/file-manager"
457
462
  }), nt = {
458
463
  getStorageInformation: () => m.get("/files/storage"),
459
- getFileManager: (t) => {
460
- const e = n(t);
461
- return m.get("/user", e);
462
- },
463
- postFileManager: (t) => {
464
- const e = n(t);
465
- return m.post("/user/list", e);
466
- },
467
- postFileManagerOption: (t) => {
468
- const e = n(t);
469
- return m.post("/user/options", e);
470
- },
471
- recoverFiles: (t) => m.put("/user/recover", t),
472
- deleteFiles: (t) => {
473
- const e = n(t);
474
- return m.delete("/user", e);
475
- },
476
- deletePermanently: (t) => {
477
- const e = n(t);
478
- return m.delete("/user/delete-permanent", e);
479
- }
464
+ postFileManager: (t, e) => {
465
+ const r = i(e);
466
+ return m.post("/".concat(t, "/list"), r);
467
+ },
468
+ postFileManagerOption: (t, e) => {
469
+ const r = i(e);
470
+ return m.post("/".concat(t, "/options"), r);
471
+ },
472
+ recoverFiles: (t, e) => m.put("/".concat(t, "/recover"), e),
473
+ deleteFiles: (t, e) => m.delete("/".concat(t), { params: e }),
474
+ deletePermanently: (t, e) => m.delete("/".concat(t, "/delete-permanent"), { params: e })
480
475
  };
481
476
  export {
482
477
  J as AuthServices,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/gsts-api-services",
3
- "version": "2.0.1-alpha.44",
3
+ "version": "2.0.1-alpha.46",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Global Settings Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -1,3 +1,3 @@
1
1
  export type DeleteFileManagerDto = {
2
- id?: string;
2
+ ids?: string;
3
3
  };
@@ -74,6 +74,7 @@ export interface GetCustomFieldListParams extends TableParams {
74
74
  isActive?: boolean[];
75
75
  dataType?: DataType[];
76
76
  isRequired?: boolean[];
77
+ updatedAt?: number[];
77
78
  }
78
79
  export type GetCustomFieldOptionsParams = Partial<{
79
80
  dataTypeOptions: boolean;
@@ -82,7 +83,8 @@ export interface CreateEditCustomFieldPayload {
82
83
  isRequired: boolean;
83
84
  name: string;
84
85
  dataType: DataType;
85
- optionValue: string[];
86
+ optionValue?: string[];
87
+ decimalPlaces?: number;
86
88
  }
87
89
  export interface SetActiveCustomFieldPayload {
88
90
  isActive: boolean;
@@ -1,14 +1,12 @@
1
1
  import { AxiosResponse } from 'axios';
2
- import { FileManagerFilterParams, FileManagerOptionBoolean } from '../types/fileManager.type';
3
- import { FetchOptionResponse } from '../types/fetchResponse.type';
2
+ import { FileManagerFilterParams, FileManagerOptionBoolean, FileType } from '../types/fileManager.type';
4
3
  import { DeleteFileManagerDto } from '../dto/fileManager.dto';
5
4
  declare const FileManagerServices: {
6
5
  getStorageInformation: () => Promise<AxiosResponse>;
7
- getFileManager: (params?: FileManagerFilterParams) => Promise<AxiosResponse>;
8
- postFileManager: (params?: FileManagerFilterParams) => Promise<AxiosResponse>;
9
- postFileManagerOption: (params?: FileManagerOptionBoolean) => Promise<AxiosResponse<FetchOptionResponse<FileManagerOptionBoolean>>>;
10
- recoverFiles: (body: object) => Promise<AxiosResponse>;
11
- deleteFiles: (params: DeleteFileManagerDto) => Promise<AxiosResponse>;
12
- deletePermanently: (params: DeleteFileManagerDto) => Promise<AxiosResponse>;
6
+ postFileManager: (type: FileType, params?: FileManagerFilterParams) => Promise<AxiosResponse>;
7
+ postFileManagerOption: (type: FileType, params?: FileManagerOptionBoolean) => Promise<AxiosResponse>;
8
+ recoverFiles: (type: FileType, body: object) => Promise<AxiosResponse>;
9
+ deleteFiles: (type: FileType, params: DeleteFileManagerDto) => Promise<AxiosResponse>;
10
+ deletePermanently: (type: FileType, params: DeleteFileManagerDto) => Promise<AxiosResponse>;
13
11
  };
14
12
  export default FileManagerServices;
@@ -1,6 +1,6 @@
1
1
  import { AxiosResponse } from 'axios';
2
2
  import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.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';
3
+ import { Division, CustomField, CustomFieldOptions, PositionList, LoginResponse, RequestOtpResponse, RequestResetLinkResponse, DivisionList, DivisionListDetail, GlobalUserList, GlobalUserOptions, GlobalUserDetail, LoginModuleResponse, ConcurrentUserList, VerifyTokenResponse, PositionDetail, ChangePasswordResponse, Position, ActiveCustomField } from '../types/iam.type';
4
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>>>;
@@ -46,5 +46,7 @@ declare const IamServices: {
46
46
  editCustomField: (id: string, payload: CreateEditCustomFieldPayload) => Promise<AxiosResponse>;
47
47
  setActiveCustomField: (ids: string[], payload: SetActiveCustomFieldPayload) => Promise<AxiosResponse>;
48
48
  deleteCustomField: (ids: string[]) => Promise<AxiosResponse>;
49
+ getActiveCustomField: () => Promise<AxiosResponse<FetchListResponse<ActiveCustomField>>>;
50
+ getAvailableCustomField: (name: string) => Promise<AxiosResponse>;
49
51
  };
50
52
  export default IamServices;
@@ -1,40 +1,44 @@
1
- import { Option } from '../../node_modules/@fewangsit/wangsvue-gsts/dropdown';
2
- export type FileType = 'attachment' | 'custom-field' | 'damage' | 'disposal' | 'maintenance-routine' | 'repair-ticketing' | 'recycle-bin';
1
+ import { MultiSelectOption } from './options.type';
2
+ export type FileType = 'attachment' | 'custom-field' | 'damage' | 'disposal' | 'maintenance-routine' | 'repair-ticketing' | 'planning-strategy' | 'recycle-bin' | 'user';
3
3
  export type FileManagerType = {
4
4
  _id: string;
5
- transactionId?: string;
6
- assetName?: string;
7
- fileName: string;
5
+ assetName: string;
6
+ countdown: number;
7
+ createdAt: string;
8
8
  fileFormat: string;
9
+ fileName: string;
10
+ filePath: string;
9
11
  fileSize: string;
10
- filePath?: string;
11
- fileType?: FileType;
12
- group?: string;
13
- user?: string;
14
- countdown?: number;
15
- modifiedBy?: string;
16
- createdAt: Date;
12
+ fileType: string;
13
+ group: string;
17
14
  hasSystemRole: {
18
15
  documentDeletion: {
16
+ create: boolean;
19
17
  delete: boolean;
18
+ update: boolean;
20
19
  view: boolean;
21
20
  };
22
21
  };
22
+ modifiedBy: string;
23
+ transactionId: string;
23
24
  };
24
25
  export type FileManagerParams = {
25
26
  isDeleted?: boolean;
26
27
  createdAt?: number[];
27
- modifiedBy?: number[];
28
+ group?: string[];
29
+ modifiedBy?: string[];
28
30
  fileFormat?: string[];
31
+ fileType?: string[];
29
32
  assetName?: string[];
30
33
  };
31
34
  export type FileManagerFilterParams = Partial<Record<keyof FileManagerParams, string | boolean>>;
32
35
  export type FileManagerOptionFilter = {
33
- modifiedByOptions?: Option[];
34
- fileFormatOptions?: Option[];
36
+ modifiedByOptions?: MultiSelectOption[];
37
+ fileFormatOptions?: MultiSelectOption[];
38
+ assetNameOptions?: MultiSelectOption[];
35
39
  };
36
40
  export type FileManagerOptionBoolean = {
37
41
  modifiedByOptions?: boolean;
38
42
  fileFormatOptions?: boolean;
39
- isDeleted?: boolean;
43
+ assetNameOptions?: boolean;
40
44
  };
@@ -170,6 +170,15 @@ export interface CustomField {
170
170
  isRequired: 'Yes' | 'No' | BaseString;
171
171
  createdAt: string;
172
172
  updatedAt: string;
173
+ decimalPlaces?: number;
174
+ }
175
+ export interface ActiveCustomField {
176
+ _id: string;
177
+ name: string;
178
+ dataType: DataType;
179
+ optionValue: string[];
180
+ isRequired: 'Yes' | 'No' | BaseString;
181
+ decimalPlaces?: number;
173
182
  }
174
183
  export interface CustomFieldList {
175
184
  totalRecords: number;