@tagsamurai/gsts-api-services 1.1.0-alpha.33 → 1.1.0-alpha.35

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.
@@ -4,9 +4,9 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
4
4
  env: r = "APP_TAGSAMURAI_API",
5
5
  prefix: o = "",
6
6
  headers: i = {},
7
- ...b
7
+ ...m
8
8
  } = t, w = "".concat(T(r)).concat(o), v = L.create({
9
- ...b,
9
+ ...m,
10
10
  baseURL: w,
11
11
  headers: e ? i : {
12
12
  "Content-Type": "application/json",
@@ -14,8 +14,8 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
14
14
  }
15
15
  });
16
16
  return v.interceptors.request.use((y) => {
17
- var S, P, h;
18
- const $ = JSON.parse((S = localStorage.getItem("user")) != null ? S : "{}"), R = (h = (P = $.jwt) != null ? P : $.token) != null ? h : "";
17
+ var $, P, h;
18
+ const S = JSON.parse(($ = localStorage.getItem("user")) != null ? $ : "{}"), R = (h = (P = S.jwt) != null ? P : S.token) != null ? h : "";
19
19
  return y.headers.Authorization = "Bearer ".concat(R), y;
20
20
  }), v;
21
21
  }, l = a({
@@ -23,7 +23,7 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
23
23
  }), E = (t) => {
24
24
  var e, r, o, i;
25
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 = {
26
+ }, B = {
27
27
  login: (t) => {
28
28
  const e = { ...t, isMobile: !1 };
29
29
  return l.post("/login", e);
@@ -53,8 +53,8 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
53
53
  const o = new URL(T("APP_TAGSAMURAI_API") || "").origin;
54
54
  let i = t.startsWith("http") ? t : "".concat(o, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
55
55
  if (e || r) {
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());
56
+ const m = new URLSearchParams();
57
+ e && (m.set("width", e.toString()), m.set("height", (r == null ? void 0 : r.toString()) || e.toString())), i += "?".concat(m.toString());
58
58
  }
59
59
  return i;
60
60
  }, x = () => {
@@ -80,11 +80,11 @@ 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, o) => {
83
+ }, J = async (t, e, r, o) => {
84
84
  if (!t) return;
85
85
  const i = U(t, e, r);
86
86
  return o ? i : _(i);
87
- }, J = (t) => {
87
+ }, M = (t) => {
88
88
  if (!t || typeof t == "string")
89
89
  return;
90
90
  const e = {};
@@ -115,7 +115,7 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
115
115
  }), e;
116
116
  }, p = a({
117
117
  prefix: "/global-settings"
118
- }), M = {
118
+ }), H = {
119
119
  getChangelogs: (t) => p.get("/change-log", { params: t }),
120
120
  getChangelogOptions: (t) => p.get("/change-log/options", { params: t }),
121
121
  getSessionList: (t) => {
@@ -140,7 +140,7 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
140
140
  getUserTagOptions: (t) => p.post("/reader-user-tag-log/options", t)
141
141
  }, d = a({
142
142
  prefix: "/global-settings/division"
143
- }), H = {
143
+ }), q = {
144
144
  getDivisions: (t) => d.get("", { params: t }),
145
145
  getDivisionDetail: (t) => d.get("/".concat(t)),
146
146
  postCreateDivision: (t) => d.post("/", t),
@@ -155,7 +155,7 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
155
155
  }
156
156
  }, g = a({
157
157
  prefix: "/global-settings"
158
- }), q = {
158
+ }), V = {
159
159
  getAllTAG: (t) => {
160
160
  const e = n(t);
161
161
  return g.post("/all-tag/list", e);
@@ -188,7 +188,7 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
188
188
  getScanTag: (t) => g.get("/scan-tag", { params: { tag: t } })
189
189
  }, s = a({
190
190
  prefix: "/global-settings"
191
- }), V = {
191
+ }), Y = {
192
192
  getHandheldReader: (t) => {
193
193
  const e = n(t);
194
194
  return s.post("/handheld-reader/list", e);
@@ -228,16 +228,16 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
228
228
  getExistingAliasNames: () => s.get("/reader/alias-names")
229
229
  }, F = a({
230
230
  prefix: "/fam/utility/v2"
231
- }), Y = {
231
+ }), z = {
232
232
  getSessionLogList: (t) => F.get("/session-log", { params: t })
233
233
  }, I = a({
234
234
  prefix: "/global-settings/option"
235
- }), z = {
235
+ }), W = {
236
236
  getPositions: () => I.get("/position"),
237
237
  getDivisions: () => I.get("/division")
238
238
  }, f = a({
239
239
  prefix: "/global-settings/position"
240
- }), W = {
240
+ }), K = {
241
241
  getPositions: (t) => f.get("", { params: t }),
242
242
  getPositionDetail: (t) => f.get("/".concat(t)),
243
243
  postCreatePosition: (t) => f.post("/", t),
@@ -252,23 +252,23 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
252
252
  }
253
253
  }, N = a({
254
254
  prefix: "/fam/tag/v2"
255
- }), K = {
255
+ }), Q = {
256
256
  getTagInfo: (t) => N.get("/rfid-qr/scan", { params: t })
257
- }, A = a({
257
+ }, b = a({
258
258
  prefix: "/global-settings/change-log"
259
- }), Q = {
259
+ }), X = {
260
260
  getTAGEventlog: (t) => {
261
261
  const e = n(t);
262
- return A.post("/tag-event-log/list", e);
262
+ return b.post("/tag-event-log/list", e);
263
263
  },
264
264
  getTAGEventlogOptions: (t) => {
265
265
  const e = n(t);
266
- return A.post("/tag-event-log/options", e);
266
+ return b.post("/tag-event-log/options", e);
267
267
  },
268
- getDetailTAGEventlog: (t) => A.get("/tag-event-log/".concat(t))
268
+ getDetailTAGEventlog: (t) => b.get("/tag-event-log/".concat(t))
269
269
  }, u = a({
270
270
  prefix: "/global-settings/user"
271
- }), X = {
271
+ }), Z = {
272
272
  getUsers: (t) => u.get("", { params: t }),
273
273
  getUserDetail: (t) => u.get("/".concat(t)),
274
274
  getUserSystemLogs: (t, e) => u.get("/".concat(t, "/system-logs"), { params: e }),
@@ -295,27 +295,27 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
295
295
  putChangePassword: (t, e) => u.put("/change-password/".concat(t), e)
296
296
  }, O = a({
297
297
  prefix: "/global-settings/v2/general-settings"
298
- }), Z = {
298
+ }), tt = {
299
299
  get: () => O.get("/"),
300
300
  update: (t) => O.put("/", t)
301
- }, m = a({
301
+ }, A = a({
302
302
  prefix: "/fam/utility/v2/file-manager"
303
- }), tt = {
304
- getStorageInformation: () => m.get("/files/storage"),
303
+ }), et = {
304
+ getStorageInformation: () => A.get("/files/storage"),
305
305
  postFileManager: (t, e) => {
306
306
  const r = n(e);
307
- return m.post("/".concat(t, "/list"), r);
307
+ return A.post("/".concat(t, "/list"), r);
308
308
  },
309
309
  postFileManagerOption: (t, e) => {
310
310
  const r = n(e);
311
- return m.post("/".concat(t, "/options"), r);
311
+ return A.post("/".concat(t, "/options"), r);
312
312
  },
313
- recoverFiles: (t, e) => m.put("/".concat(t, "/recover"), e),
314
- deleteFiles: (t, e) => m.delete("/".concat(t), { params: e }),
315
- deletePermanently: (t, e) => m.delete("/".concat(t, "/delete-permanent"), { params: e })
313
+ recoverFiles: (t, e) => A.put("/".concat(t, "/recover"), e),
314
+ deleteFiles: (t, e) => A.delete("/".concat(t), { params: e }),
315
+ deletePermanently: (t, e) => A.delete("/".concat(t, "/delete-permanent"), { params: e })
316
316
  }, c = a({
317
317
  prefix: "/global-settings"
318
- }), et = {
318
+ }), rt = {
319
319
  getCustomFieldList: (t) => {
320
320
  const e = n(t);
321
321
  return c.post("/custom-fields/list", e);
@@ -336,23 +336,28 @@ const C = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
336
336
  const e = { name: t };
337
337
  return c.get("/custom-fields/available", { params: e });
338
338
  }
339
+ }, j = a({
340
+ prefix: "/global-settings"
341
+ }), st = {
342
+ getApplicationSetting: () => j.get("/application-setting")
339
343
  };
340
344
  export {
341
- k as AuthServices,
342
- M as ChangelogServices,
343
- et as CustomFieldServices,
344
- H as DivisionServices,
345
- tt as FileManagerServices,
346
- Z as GeneralSettingServices,
347
- q as GlobalTagServices,
348
- V as HardwareServices,
349
- Y as LogServices,
350
- z as OptionServices,
351
- W as PositionServices,
352
- Q as TagEventlogServices,
353
- K as TagServices,
354
- X as UserServices,
345
+ st as ApplicationSettingServices,
346
+ B as AuthServices,
347
+ H as ChangelogServices,
348
+ rt as CustomFieldServices,
349
+ q as DivisionServices,
350
+ et as FileManagerServices,
351
+ tt as GeneralSettingServices,
352
+ V as GlobalTagServices,
353
+ Y as HardwareServices,
354
+ z as LogServices,
355
+ W as OptionServices,
356
+ K as PositionServices,
357
+ X as TagEventlogServices,
358
+ Q as TagServices,
359
+ Z as UserServices,
355
360
  T as getBaseURL,
356
- B as getImageURL,
357
- J as queryParamsStringfy
361
+ J as getImageURL,
362
+ M as queryParamsStringfy
358
363
  };
package/main.d.ts CHANGED
@@ -12,4 +12,5 @@ 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
14
  export { default as CustomFieldServices } from './src/services/customField.service';
15
+ export { default as ApplicationSettingServices } from './src/services/applicationSetting.service';
15
16
  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.33",
3
+ "version": "1.1.0-alpha.35",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Global Settings Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -0,0 +1,6 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { ApplicationSettingResponse } from '../types/applicationSetting.type';
3
+ declare const ApplicationSettingServices: {
4
+ getApplicationSetting: () => Promise<AxiosResponse<ApplicationSettingResponse>>;
5
+ };
6
+ export default ApplicationSettingServices;
@@ -4,7 +4,9 @@ import { DeleteFileManagerDto } from '../dto/fileManager.dto';
4
4
  declare const FileManagerServices: {
5
5
  getStorageInformation: () => Promise<AxiosResponse>;
6
6
  postFileManager: (type: FileType, params?: FileManagerFilterParams) => Promise<AxiosResponse>;
7
- postFileManagerOption: (type: FileType, params?: FileManagerOptionBoolean) => Promise<AxiosResponse>;
7
+ postFileManagerOption: (type: FileType, params?: FileManagerOptionBoolean & {
8
+ isDeleted: boolean;
9
+ }) => Promise<AxiosResponse>;
8
10
  recoverFiles: (type: FileType, body: object) => Promise<AxiosResponse>;
9
11
  deleteFiles: (type: FileType, params: DeleteFileManagerDto) => Promise<AxiosResponse>;
10
12
  deletePermanently: (type: FileType, params: DeleteFileManagerDto) => Promise<AxiosResponse>;
@@ -0,0 +1,9 @@
1
+ type ApplicationSetting = {
2
+ _id: string;
3
+ maxAssetCustomField: number;
4
+ };
5
+ type ApplicationSettingResponse = {
6
+ message: string;
7
+ data: ApplicationSetting;
8
+ };
9
+ export type { ApplicationSettingResponse };