@tagsamurai/gsts-api-services 1.0.1-alpha.5 → 1.0.1-alpha.6

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,11 +1,11 @@
1
1
  import I from "axios";
2
- const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_GLOBAL_SETTINGS_API: "https://dev-api.global-settings.tagsamurai.com", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, l = (t = "APP_TAGSAMURAI_API") => f["VITE_" + t], n = (t = {}, e = !1) => {
2
+ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_GLOBAL_SETTINGS_API: "https://dev-api.global-settings.tagsamurai.com", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, u = (t = "APP_TAGSAMURAI_API") => f["VITE_" + t], n = (t = {}, e = !1) => {
3
3
  const {
4
4
  env: s = "APP_GLOBAL_SETTINGS_API",
5
- prefix: u = "",
5
+ prefix: l = "",
6
6
  headers: g = {},
7
7
  ...A
8
- } = t, P = `${l(s)}${u}`, a = JSON.parse(localStorage.getItem("user") ?? "{}"), v = a.jwt ?? a.token ?? "";
8
+ } = t, P = `${u(s)}${l}`, a = JSON.parse(localStorage.getItem("user") ?? "{}"), v = a.jwt ?? a.token ?? "";
9
9
  return I.create({
10
10
  ...A,
11
11
  baseURL: P,
@@ -17,10 +17,8 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
17
17
  });
18
18
  }, h = (t) => {
19
19
  if (!t) return;
20
- const e = l("APP_TAGSAMURAI_API");
21
- console.log("🚀 ~ name:", t), console.log("🚀 ~ name.startsWith('http'):", t.startsWith("http"));
22
- const s = t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
23
- return console.log("🚀 ~ filePath:", s), s;
20
+ const e = u("APP_TAGSAMURAI_API");
21
+ return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
24
22
  }, m = (t) => {
25
23
  if (!t || typeof t == "string")
26
24
  return;
@@ -37,16 +35,16 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
37
35
  }), O = {
38
36
  getChangelogs: (t) => c.get("", { params: t }),
39
37
  getChangelogOptions: (t) => c.get("/options", { params: t })
40
- }, o = n({
38
+ }, i = n({
41
39
  prefix: "/v1/global-settings/division"
42
40
  }), T = {
43
- getDivisions: (t) => o.get("", { params: t }),
44
- getDivisionDetail: (t) => o.get(`/${t}`),
45
- postCreateDivision: (t) => o.post("/", t),
46
- putEditDivision: (t, e) => o.put(`/${t}`, e),
41
+ getDivisions: (t) => i.get("", { params: t }),
42
+ getDivisionDetail: (t) => i.get(`/${t}`),
43
+ postCreateDivision: (t) => i.post("/", t),
44
+ putEditDivision: (t, e) => i.put(`/${t}`, e),
47
45
  deleteDivisions: (t) => {
48
46
  const e = { id: JSON.stringify(t) };
49
- return o.delete("", { params: e });
47
+ return i.delete("", { params: e });
50
48
  }
51
49
  }, S = n({
52
50
  env: "APP_LOGS_NOTIFICATION_API",
@@ -58,16 +56,16 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
58
56
  }), U = {
59
57
  getPositions: () => p.get("/position"),
60
58
  getDivisions: () => p.get("/division")
61
- }, i = n({
59
+ }, o = n({
62
60
  prefix: "/v1/global-settings/position"
63
61
  }), y = {
64
- getPositions: (t) => i.get("", { params: t }),
65
- getPositionDetail: (t) => i.get(`/${t}`),
66
- postCreatePosition: (t) => i.post("/", t),
67
- putEditPosition: (t, e) => i.put(`/${t}`, e),
62
+ getPositions: (t) => o.get("", { params: t }),
63
+ getPositionDetail: (t) => o.get(`/${t}`),
64
+ postCreatePosition: (t) => o.post("/", t),
65
+ putEditPosition: (t, e) => o.put(`/${t}`, e),
68
66
  deletePositions: (t) => {
69
67
  const e = { id: JSON.stringify(t) };
70
- return i.delete("", { params: e });
68
+ return o.delete("", { params: e });
71
69
  }
72
70
  }, _ = n({
73
71
  env: "APP_TAGSAMURAI_API",
@@ -113,7 +111,7 @@ export {
113
111
  y as PositionServices,
114
112
  E as TagServices,
115
113
  L as UserServices,
116
- l as getBaseURL,
114
+ u as getBaseURL,
117
115
  h as getImageURL,
118
116
  m as queryParamsStringfy
119
117
  };
@@ -1 +1 @@
1
- System.register(["axios"],function(n,h){"use strict";var c;return{setters:[a=>{c=a.default}],execute:function(){const a={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_GLOBAL_SETTINGS_API:"https://dev-api.global-settings.tagsamurai.com",VITE_APP_LOGS_NOTIFICATION_API:"https://dev-api-logs-notification.tagsamurai.com",VITE_APP_TAGSAMURAI_API:"https://dev-api.tagsamurai.com"},u=n("getBaseURL",(e="APP_TAGSAMURAI_API")=>a["VITE_"+e]),i=(e={},t=!1)=>{const{env:s="APP_GLOBAL_SETTINGS_API",prefix:f="",headers:A={},...I}=e,_=`${u(s)}${f}`,P=JSON.parse(localStorage.getItem("user")??"{}"),d=P.jwt??P.token??"";return c.create({...I,baseURL:_,headers:t?A:{"Content-Type":"application/json",Authorization:`Bearer ${d}`,...A}})},m=n("getImageURL",e=>{if(!e)return;const t=u("APP_TAGSAMURAI_API");console.log("🚀 ~ name:",e),console.log("🚀 ~ name.startsWith('http'):",e.startsWith("http"));const s=e.startsWith("http")?e:`${t}/file-manager/v2/files/${e}`;return console.log("🚀 ~ filePath:",s),s}),O=n("queryParamsStringfy",e=>{if(!e||typeof e=="string")return;const t={};return Object.keys(e).forEach(s=>{Array.isArray(e[s])?e[s].length>0&&Object.assign(t,{[s]:JSON.stringify(e[s])}):e[s]!==void 0&&Object.assign(t,{[s]:e[s]})}),t}),l=i({prefix:"/v1/global-settings/change-log"}),T=n("ChangelogServices",{getChangelogs:e=>l.get("",{params:e}),getChangelogOptions:e=>l.get("/options",{params:e})}),o=i({prefix:"/v1/global-settings/division"}),U=n("DivisionServices",{getDivisions:e=>o.get("",{params:e}),getDivisionDetail:e=>o.get(`/${e}`),postCreateDivision:e=>o.post("/",e),putEditDivision:(e,t)=>o.put(`/${e}`,t),deleteDivisions:e=>{const t={id:JSON.stringify(e)};return o.delete("",{params:t})}}),v=i({env:"APP_LOGS_NOTIFICATION_API",prefix:"/v2"}),$=n("LogServices",{getSessionLogList:e=>v.get("/session-log",{params:e})}),p=i({prefix:"/v1/global-settings/option"}),y=n("OptionServices",{getPositions:()=>p.get("/position"),getDivisions:()=>p.get("/division")}),g=i({prefix:"/v1/global-settings/position"}),L=n("PositionServices",{getPositions:e=>g.get("",{params:e}),getPositionDetail:e=>g.get(`/${e}`),postCreatePosition:e=>g.post("/",e),putEditPosition:(e,t)=>g.put(`/${e}`,t),deletePositions:e=>{const t={id:JSON.stringify(e)};return g.delete("",{params:t})}}),S=i({env:"APP_TAGSAMURAI_API",prefix:"/tag/v2"}),C=n("TagServices",{getTagInfo:e=>S.get("/rfid-qr/scan",{params:e})}),r=i({prefix:"/v1/global-settings/user"}),E=n("UserServices",{getUsers:e=>r.get("",{params:e}),getUserDetail:e=>r.get(`/${e}`),getUserSystemLogs:(e,t)=>r.get(`/${e}/system-logs`,{params:t}),getUserSystemLogOptions:(e,t)=>{const s={};return s[t]=!0,r.get(`/${e}/system-logs/options`,{params:s})},postCreateUser:e=>{const t={"Content-Type":"multipart/form-data"};return r.post("",e,{headers:t})},putEditUser:(e,t)=>{const s={"Content-Type":"multipart/form-data"};return r.put(`/${e}`,t,{headers:s})},deleteUsers:e=>{const t={id:JSON.stringify(e)};return r.delete("",{params:t})},putToggleStatusUsers:e=>r.put("/active-status",e),getUserOptions:e=>{const t={};return t[e]=!0,r.get("/options",{params:t})},deleteCancelEmailChange:e=>r.delete(`/cancel-email-change/${e}`),postResendEmail:e=>r.post("/resend-email",e),putChangePassword:(e,t)=>r.put(`/change-password/${e}`,t)})}}});
1
+ System.register(["axios"],function(n,m){"use strict";var c;return{setters:[a=>{c=a.default}],execute:function(){const a={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_GLOBAL_SETTINGS_API:"https://dev-api.global-settings.tagsamurai.com",VITE_APP_LOGS_NOTIFICATION_API:"https://dev-api-logs-notification.tagsamurai.com",VITE_APP_TAGSAMURAI_API:"https://dev-api.tagsamurai.com"},u=n("getBaseURL",(e="APP_TAGSAMURAI_API")=>a["VITE_"+e]),i=(e={},t=!1)=>{const{env:s="APP_GLOBAL_SETTINGS_API",prefix:f="",headers:A={},...I}=e,_=`${u(s)}${f}`,P=JSON.parse(localStorage.getItem("user")??"{}"),d=P.jwt??P.token??"";return c.create({...I,baseURL:_,headers:t?A:{"Content-Type":"application/json",Authorization:`Bearer ${d}`,...A}})},h=n("getImageURL",e=>{if(!e)return;const t=u("APP_TAGSAMURAI_API");return e.startsWith("http")?e:`${t}/file-manager/v2/files/${e}`}),O=n("queryParamsStringfy",e=>{if(!e||typeof e=="string")return;const t={};return Object.keys(e).forEach(s=>{Array.isArray(e[s])?e[s].length>0&&Object.assign(t,{[s]:JSON.stringify(e[s])}):e[s]!==void 0&&Object.assign(t,{[s]:e[s]})}),t}),l=i({prefix:"/v1/global-settings/change-log"}),T=n("ChangelogServices",{getChangelogs:e=>l.get("",{params:e}),getChangelogOptions:e=>l.get("/options",{params:e})}),o=i({prefix:"/v1/global-settings/division"}),U=n("DivisionServices",{getDivisions:e=>o.get("",{params:e}),getDivisionDetail:e=>o.get(`/${e}`),postCreateDivision:e=>o.post("/",e),putEditDivision:(e,t)=>o.put(`/${e}`,t),deleteDivisions:e=>{const t={id:JSON.stringify(e)};return o.delete("",{params:t})}}),v=i({env:"APP_LOGS_NOTIFICATION_API",prefix:"/v2"}),$=n("LogServices",{getSessionLogList:e=>v.get("/session-log",{params:e})}),p=i({prefix:"/v1/global-settings/option"}),y=n("OptionServices",{getPositions:()=>p.get("/position"),getDivisions:()=>p.get("/division")}),g=i({prefix:"/v1/global-settings/position"}),L=n("PositionServices",{getPositions:e=>g.get("",{params:e}),getPositionDetail:e=>g.get(`/${e}`),postCreatePosition:e=>g.post("/",e),putEditPosition:(e,t)=>g.put(`/${e}`,t),deletePositions:e=>{const t={id:JSON.stringify(e)};return g.delete("",{params:t})}}),S=i({env:"APP_TAGSAMURAI_API",prefix:"/tag/v2"}),C=n("TagServices",{getTagInfo:e=>S.get("/rfid-qr/scan",{params:e})}),r=i({prefix:"/v1/global-settings/user"}),E=n("UserServices",{getUsers:e=>r.get("",{params:e}),getUserDetail:e=>r.get(`/${e}`),getUserSystemLogs:(e,t)=>r.get(`/${e}/system-logs`,{params:t}),getUserSystemLogOptions:(e,t)=>{const s={};return s[t]=!0,r.get(`/${e}/system-logs/options`,{params:s})},postCreateUser:e=>{const t={"Content-Type":"multipart/form-data"};return r.post("",e,{headers:t})},putEditUser:(e,t)=>{const s={"Content-Type":"multipart/form-data"};return r.put(`/${e}`,t,{headers:s})},deleteUsers:e=>{const t={id:JSON.stringify(e)};return r.delete("",{params:t})},putToggleStatusUsers:e=>r.put("/active-status",e),getUserOptions:e=>{const t={};return t[e]=!0,r.get("/options",{params:t})},deleteCancelEmailChange:e=>r.delete(`/cancel-email-change/${e}`),postResendEmail:e=>r.post("/resend-email",e),putChangePassword:(e,t)=>r.put(`/change-password/${e}`,t)})}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/gsts-api-services",
3
- "version": "1.0.1-alpha.5",
3
+ "version": "1.0.1-alpha.6",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Global Settings Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",