@tagsamurai/fats-api-services 1.0.0-alpha.3 → 1.0.0-alpha.5

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,13 +1,13 @@
1
- import _ from "axios";
2
- const I = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_API: "https://dev-api.tagsamurai.com", VITE_APP_COUNTRY_STATE_API: "https://api.countrystatecity.in", VITE_APP_COUNTRY_STATE_API_KEY: "ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, i = (t = "APP_API") => I["VITE_" + t], c = (t = {}, e = !1) => {
3
- const { env: r = "APP_API", prefix: o = "", headers: a = {}, ...g } = t, A = `${i(r)}${o}`, u = JSON.parse(localStorage.getItem("user") ?? "{}"), P = u.jwt ?? u.token ?? "";
4
- return _.create({
5
- ...g,
6
- baseURL: A,
7
- headers: e ? a : {
1
+ import P from "axios";
2
+ const _ = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_API: "https://dev-api.tagsamurai.com", VITE_APP_COUNTRY_STATE_API: "https://api.countrystatecity.in", VITE_APP_COUNTRY_STATE_API_KEY: "ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, i = (t = "APP_API") => _["VITE_" + t], c = (t = {}, e = !1) => {
3
+ const { env: r = "APP_API", prefix: n = "", headers: s = {}, ...a } = t, u = `${i(r)}${n}`, g = JSON.parse(localStorage.getItem("user") ?? "{}"), A = g.jwt ?? g.token ?? "";
4
+ return P.create({
5
+ ...a,
6
+ baseURL: u,
7
+ headers: e ? s : {
8
8
  "Content-Type": "application/json",
9
- Authorization: `Bearer ${P}`,
10
- ...a
9
+ Authorization: `Bearer ${A}`,
10
+ ...s
11
11
  }
12
12
  });
13
13
  }, f = (t) => {
@@ -21,94 +21,66 @@ const I = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
21
21
  [r]: t[r]
22
22
  });
23
23
  }), e;
24
- }, S = (t, e, r) => {
24
+ }, T = (t, e, r) => {
25
25
  if (!t) return;
26
- const o = i("APP_API"), a = t.startsWith("http") ? t : `${o}/utility/v2/files/${t.replace(/^\/+/, "")}`;
26
+ const n = i("APP_API"), s = t.startsWith("http") ? t : `${n}/utility/v2/files/${t.replace(/^\/+/, "")}`;
27
27
  if (e || r) {
28
- const g = new URLSearchParams();
29
- return e && (g.set("width", e.toString()), g.set("height", r ? r == null ? void 0 : r.toString() : e.toString())), `${a}?${g.toString()}`;
28
+ const a = new URLSearchParams();
29
+ return e && (a.set("width", e.toString()), a.set("height", r ? r == null ? void 0 : r.toString() : e.toString())), `${s}?${a.toString()}`;
30
30
  }
31
- return a;
32
- }, T = (t) => {
31
+ return s;
32
+ }, S = (t) => {
33
33
  if (!t) return;
34
34
  const e = i("APP_TAGSAMURAI_API");
35
35
  return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
36
- }, n = c({
37
- prefix: "/settings-attribute/v2"
38
- }), y = {
39
- getGroupCategory: (t) => {
40
- const e = t === "category" ? t : "groups";
41
- return n.get(`/${e}/tree`);
42
- },
43
- getGroupCategoryList: (t, e) => {
44
- const r = t === "category" ? t : "groups";
45
- return n.get(`/${r}/${e}`);
46
- },
47
- getNames: (t) => {
48
- const e = t === "category" ? t : "groups";
49
- return n.get(`/${e}/names`);
50
- },
51
- postCreateGroupCategory: (t, e) => {
52
- const r = t === "category" ? t : "groups";
53
- return n.post(`/${r}`, e);
54
- },
55
- putEditGroupCategory: (t, e, r) => {
56
- const o = t === "category" ? t : "groups";
57
- return n.put(`/${o}/${r}`, e);
58
- },
59
- deleteGroupCategory: (t, e, r) => {
60
- const o = t === "category" ? t : "groups";
61
- return n.delete(`/${o}/${r}`, { data: e });
62
- }
63
- }, s = c({
36
+ }, o = c({
64
37
  prefix: "/settings-attribute/v2",
65
- baseURL: "APP_TAGSAMURAI_API"
38
+ env: "APP_TAGSAMURAI_API"
66
39
  }), v = {
67
40
  getGroupCategory: (t) => {
68
41
  const e = t === "category" ? t : "groups";
69
- return s.get(`/${e}/tree`);
42
+ return o.get(`/${e}/tree`);
70
43
  },
71
44
  getGroupCategoryList: (t, e) => {
72
45
  const r = t === "category" ? t : "groups";
73
- return s.get(`/${r}/${e}`);
46
+ return o.get(`/${r}/${e}`);
74
47
  },
75
48
  getNames: (t) => {
76
49
  const e = t === "category" ? t : "groups";
77
- return s.get(`/${e}/names`);
50
+ return o.get(`/${e}/names`);
78
51
  },
79
52
  postCreateGroupCategory: (t, e) => {
80
53
  const r = t === "category" ? t : "groups";
81
- return s.post(`/${r}`, e);
54
+ return o.post(`/${r}`, e);
82
55
  },
83
56
  putEditGroupCategory: (t, e, r) => {
84
- const o = t === "category" ? t : "groups";
85
- return s.put(`/${o}/${r}`, e);
57
+ const n = t === "category" ? t : "groups";
58
+ return o.put(`/${n}/${r}`, e);
86
59
  },
87
- putMoveGroup: (t, e) => s.put(`/groups/${e}/move-group`, t),
88
- putEditBulkGroups: async (t) => s.put("/bulk", t),
60
+ putMoveGroup: (t, e) => o.put(`/groups/${e}/move-group`, t),
61
+ putEditBulkGroups: async (t) => o.put("/bulk", t),
89
62
  deleteGroupCategory: (t, e, r) => {
90
- const o = t === "category" ? t : "groups";
91
- return s.delete(`/${o}/${r}`, { data: e });
63
+ const n = t === "category" ? t : "groups";
64
+ return o.delete(`/${n}/${r}`, { data: e });
92
65
  }
93
- }, l = c({
66
+ }, I = c({
94
67
  prefix: "/v2",
95
- baseURL: "APP_LOGS_NOTIFICATION_API"
96
- }), C = {
97
- getTotalApprovals: () => l.get("/approval/count")
68
+ env: "APP_LOGS_NOTIFICATION_API"
69
+ }), $ = {
70
+ getTotalApprovals: () => I.get("/approval/count")
98
71
  }, p = c({
99
72
  prefix: "/v2",
100
- baseURL: "APP_LOGS_NOTIFICATION_API"
101
- }), G = {
73
+ env: "APP_LOGS_NOTIFICATION_API"
74
+ }), O = {
102
75
  getActionLog: (t) => p.get("/change-log", { params: t }),
103
76
  getActionLogOption: (t) => p.get("/change-log/options", { params: t })
104
77
  };
105
78
  export {
106
- G as ChangelogServices,
107
- y as GroupCategoryServices,
108
- C as NotificationApprovalServices,
109
- v as OldGroupCategoryServices,
79
+ O as ChangelogServices,
80
+ v as GroupCategoryServices,
81
+ $ as NotificationApprovalServices,
110
82
  i as getBaseURL,
111
- S as getImageURL,
112
- T as oldGetImageURL,
83
+ T as getImageURL,
84
+ S as oldGetImageURL,
113
85
  f as queryParamsStringfy
114
86
  };
@@ -1 +1 @@
1
- System.register(["axios"],function(n,S){"use strict";var A;return{setters:[u=>{A=u.default}],execute:function(){const u={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_API:"https://dev-api.tagsamurai.com",VITE_APP_COUNTRY_STATE_API:"https://api.countrystatecity.in",VITE_APP_COUNTRY_STATE_API_KEY:"ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==",VITE_APP_LOGS_NOTIFICATION_API:"https://dev-api-logs-notification.tagsamurai.com",VITE_APP_TAGSAMURAI_API:"https://dev-api.tagsamurai.com"},p=n("getBaseURL",(t="APP_API")=>u["VITE_"+t]),c=(t={},e=!1)=>{const{env:r="APP_API",prefix:o="",headers:g={},...i}=t,l=`${p(r)}${o}`,_=JSON.parse(localStorage.getItem("user")??"{}"),f=_.jwt??_.token??"";return A.create({...i,baseURL:l,headers:e?g:{"Content-Type":"application/json",Authorization:`Bearer ${f}`,...g}})},$=n("queryParamsStringfy",t=>{if(!t||typeof t=="string")return;const e={};return Object.keys(t).forEach(r=>{Array.isArray(t[r])?t[r].length>0&&Object.assign(e,{[r]:JSON.stringify(t[r])}):t[r]!==void 0&&Object.assign(e,{[r]:t[r]})}),e}),y=n("getImageURL",(t,e,r)=>{if(!t)return;const o=p("APP_API"),g=t.startsWith("http")?t:`${o}/utility/v2/files/${t.replace(/^\/+/,"")}`;if(e||r){const i=new URLSearchParams;return e&&(i.set("width",e.toString()),i.set("height",r?r==null?void 0:r.toString():e.toString())),`${g}?${i.toString()}`}return g}),T=n("oldGetImageURL",t=>{if(!t)return;const e=p("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),a=c({prefix:"/settings-attribute/v2"}),v=n("GroupCategoryServices",{getGroupCategory:t=>{const e=t==="category"?t:"groups";return a.get(`/${e}/tree`)},getGroupCategoryList:(t,e)=>{const r=t==="category"?t:"groups";return a.get(`/${r}/${e}`)},getNames:t=>{const e=t==="category"?t:"groups";return a.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return a.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return a.put(`/${o}/${r}`,e)},deleteGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return a.delete(`/${o}/${r}`,{data:e})}}),s=c({prefix:"/settings-attribute/v2",baseURL:"APP_TAGSAMURAI_API"}),C=n("OldGroupCategoryServices",{getGroupCategory:t=>{const e=t==="category"?t:"groups";return s.get(`/${e}/tree`)},getGroupCategoryList:(t,e)=>{const r=t==="category"?t:"groups";return s.get(`/${r}/${e}`)},getNames:t=>{const e=t==="category"?t:"groups";return s.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return s.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return s.put(`/${o}/${r}`,e)},putMoveGroup:(t,e)=>s.put(`/groups/${e}/move-group`,t),putEditBulkGroups:async t=>s.put("/bulk",t),deleteGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return s.delete(`/${o}/${r}`,{data:e})}}),I=c({prefix:"/v2",baseURL:"APP_LOGS_NOTIFICATION_API"}),d=n("NotificationApprovalServices",{getTotalApprovals:()=>I.get("/approval/count")}),P=c({prefix:"/v2",baseURL:"APP_LOGS_NOTIFICATION_API"}),G=n("ChangelogServices",{getActionLog:t=>P.get("/change-log",{params:t}),getActionLogOption:t=>P.get("/change-log/options",{params:t})})}}});
1
+ System.register(["axios"],function(n,f){"use strict";var A;return{setters:[c=>{A=c.default}],execute:function(){const c={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_API:"https://dev-api.tagsamurai.com",VITE_APP_COUNTRY_STATE_API:"https://api.countrystatecity.in",VITE_APP_COUNTRY_STATE_API_KEY:"ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==",VITE_APP_LOGS_NOTIFICATION_API:"https://dev-api-logs-notification.tagsamurai.com",VITE_APP_TAGSAMURAI_API:"https://dev-api.tagsamurai.com"},g=n("getBaseURL",(t="APP_API")=>c["VITE_"+t]),u=(t={},e=!1)=>{const{env:r="APP_API",prefix:s="",headers:a={},...i}=t,I=`${g(r)}${s}`,P=JSON.parse(localStorage.getItem("user")??"{}"),l=P.jwt??P.token??"";return A.create({...i,baseURL:I,headers:e?a:{"Content-Type":"application/json",Authorization:`Bearer ${l}`,...a}})},S=n("queryParamsStringfy",t=>{if(!t||typeof t=="string")return;const e={};return Object.keys(t).forEach(r=>{Array.isArray(t[r])?t[r].length>0&&Object.assign(e,{[r]:JSON.stringify(t[r])}):t[r]!==void 0&&Object.assign(e,{[r]:t[r]})}),e}),T=n("getImageURL",(t,e,r)=>{if(!t)return;const s=g("APP_API"),a=t.startsWith("http")?t:`${s}/utility/v2/files/${t.replace(/^\/+/,"")}`;if(e||r){const i=new URLSearchParams;return e&&(i.set("width",e.toString()),i.set("height",r?r==null?void 0:r.toString():e.toString())),`${a}?${i.toString()}`}return a}),v=n("oldGetImageURL",t=>{if(!t)return;const e=g("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),o=u({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),y=n("GroupCategoryServices",{getGroupCategory:t=>{const e=t==="category"?t:"groups";return o.get(`/${e}/tree`)},getGroupCategoryList:(t,e)=>{const r=t==="category"?t:"groups";return o.get(`/${r}/${e}`)},getNames:t=>{const e=t==="category"?t:"groups";return o.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return o.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const s=t==="category"?t:"groups";return o.put(`/${s}/${r}`,e)},putMoveGroup:(t,e)=>o.put(`/groups/${e}/move-group`,t),putEditBulkGroups:async t=>o.put("/bulk",t),deleteGroupCategory:(t,e,r)=>{const s=t==="category"?t:"groups";return o.delete(`/${s}/${r}`,{data:e})}}),_=u({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),$=n("NotificationApprovalServices",{getTotalApprovals:()=>_.get("/approval/count")}),p=u({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),O=n("ChangelogServices",{getActionLog:t=>p.get("/change-log",{params:t}),getActionLogOption:t=>p.get("/change-log/options",{params:t})})}}});
package/main.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- export { default as GroupCategoryServices } from './src/services/groupCategory.service';
2
- export { default as OldGroupCategoryServices } from './src/services/oldGroupCategory.service';
1
+ export { default as GroupCategoryServices } from './src/services/oldGroupCategory.service';
3
2
  export { default as NotificationApprovalServices } from './src/services/oldNotificationApproval.service';
4
3
  export { default as ChangelogServices } from './src/services/oldChangelog.service';
5
4
  export { getImageURL, oldGetImageURL, getBaseURL, queryParamsStringfy, } from './src/utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0-alpha.5",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Fixed Asset Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",