@tagsamurai/fats-api-services 1.0.0-alpha.16 → 1.0.0-alpha.17

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,6 +1,6 @@
1
1
  import v from "axios";
2
2
  const S = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_ADMIN_API: "https://dev-admin-api.tagsamurai.com", 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 = (t = "APP_API") => S["VITE_" + t], n = (t = {}, e = !1) => {
3
- const { env: r = "APP_API", prefix: a = "", headers: u = {}, ...I } = t, _ = `${P(r)}${a}`, c = JSON.parse(localStorage.getItem("user") ?? "{}"), d = c.jwt ?? c.token ?? "";
3
+ const { env: r = "APP_API", prefix: o = "", headers: u = {}, ...I } = t, _ = `${P(r)}${o}`, c = JSON.parse(localStorage.getItem("user") ?? "{}"), d = c.jwt ?? c.token ?? "";
4
4
  return v.create({
5
5
  ...I,
6
6
  baseURL: _,
@@ -25,35 +25,35 @@ const S = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
25
25
  if (!t) return;
26
26
  const e = P("APP_TAGSAMURAI_API");
27
27
  return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
28
- }, o = n({
28
+ }, a = n({
29
29
  prefix: "/settings-attribute/v2",
30
30
  env: "APP_TAGSAMURAI_API"
31
31
  }), h = {
32
32
  getGroupCategory: (t, e) => {
33
33
  const r = t === "category" ? t : "groups";
34
- return o.get(`/${r}/tree`, { params: e });
34
+ return a.get(`/${r}/tree`, { params: e });
35
35
  },
36
- getGroupCategoryList: (t, e) => {
37
- const r = t === "category" ? t : "groups";
38
- return o.get(`/${r}/${e}`);
36
+ getGroupCategoryList: (t, e, r) => {
37
+ const o = t === "category" ? t : "groups";
38
+ return a.get(`/${o}/${e}`, { params: r });
39
39
  },
40
40
  getNames: (t) => {
41
41
  const e = t === "category" ? t : "groups";
42
- return o.get(`/${e}/names`);
42
+ return a.get(`/${e}/names`);
43
43
  },
44
44
  postCreateGroupCategory: (t, e) => {
45
45
  const r = t === "category" ? t : "groups";
46
- return o.post(`/${r}`, e);
46
+ return a.post(`/${r}`, e);
47
47
  },
48
48
  putEditGroupCategory: (t, e, r) => {
49
- const a = t === "category" ? t : "groups";
50
- return o.put(`/${a}/${r}`, e);
49
+ const o = t === "category" ? t : "groups";
50
+ return a.put(`/${o}/${r}`, e);
51
51
  },
52
- putMoveGroup: (t, e) => o.put(`/groups/${e}/move-group`, t),
53
- putEditBulkGroups: async (t) => o.put("/groups/bulk", t),
52
+ putMoveGroup: (t, e) => a.put(`/groups/${e}/move-group`, t),
53
+ putEditBulkGroups: async (t) => a.put("/groups/bulk", t),
54
54
  deleteGroupCategory: (t, e, r) => {
55
- const a = t === "category" ? t : "groups";
56
- return o.delete(`/${a}/${r}`, { data: e });
55
+ const o = t === "category" ? t : "groups";
56
+ return a.delete(`/${o}/${r}`, { data: e });
57
57
  }
58
58
  }, f = n({
59
59
  prefix: "/v2",
@@ -100,13 +100,13 @@ const S = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
100
100
  prefix: "/tracking/v2/tracking"
101
101
  }), b = {
102
102
  putFoundAsset: (t, e, r) => {
103
- const a = {
103
+ const o = {
104
104
  tag: t,
105
105
  group: e,
106
106
  serialNumber: r,
107
107
  type: "Global"
108
108
  };
109
- return L.put("/found", { params: a });
109
+ return L.put("/found", { params: o });
110
110
  }
111
111
  }, s = n({
112
112
  prefix: "/settings-user-role/v2"
@@ -1 +1 @@
1
- System.register(["axios"],function(n,O){"use strict";var p;return{setters:[u=>{p=u.default}],execute:function(){const u={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_ADMIN_API:"https://dev-admin-api.tagsamurai.com",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"},l=n("getBaseURL",(t="APP_API")=>u["VITE_"+t]),o=(t={},e=!1)=>{const{env:r="APP_API",prefix:i="",headers:S={},...$}=t,L=`${l(r)}${i}`,v=JSON.parse(localStorage.getItem("user")??"{}"),y=v.jwt??v.token??"";return p.create({...$,baseURL:L,headers:e?S:{"Content-Type":"application/json",Authorization:`Bearer ${y}`,...S}})},U=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}),h=n("getImageURL",t=>{if(!t)return;const e=l("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),a=o({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),D=n("GroupCategoryServices",{getGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return a.get(`/${r}/tree`,{params:e})},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 i=t==="category"?t:"groups";return a.put(`/${i}/${r}`,e)},putMoveGroup:(t,e)=>a.put(`/groups/${e}/move-group`,t),putEditBulkGroups:async t=>a.put("/groups/bulk",t),deleteGroupCategory:(t,e,r)=>{const i=t==="category"?t:"groups";return a.delete(`/${i}/${r}`,{data:e})}}),d=o({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),N=n("NotificationApprovalServices",{getTotalApprovals:()=>d.get("/approval/count")}),g=o({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),C=n("ChangelogServices",{getActionLog:t=>g.get("/change-log",{params:t}),getActionLogOption:t=>g.get("/change-log/options",{params:t}),getSessionLogList:t=>g.get("/session-log",{params:t}),getUserDetailSystemLogList:t=>g.get("/change-log",{params:t}),getUserDetailSystemLogOption:t=>g.get("/change-log/options",{params:t})}),_=o({prefix:"/assets/v2/assets"}),R=n("AssetServices",{getScanTag:t=>_.get("/scan",{params:{tag:t}})}),f=o({prefix:"/tracking/v2/missing"}),E=n("MissingServices",{putFoundAsset:(t,e)=>{const r={ids:[t],serialNumber:e};return f.put("/found",r)}}),A=o({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),G=n("NotificationServices",{getNotifications:t=>A.get("/",{params:t}),readNotification:t=>A.put(`/${t}`)}),T=o({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),b=n("SessionLogServices",{postLogout:()=>T.post("/logout")}),P=o({prefix:"/tag/v2"}),w=n("TAGServices",{getScanQR:t=>P.get("/qr",{params:{tag:t}}),getScanRFID:t=>P.get("/rfid",{params:{tag:t}})}),m=o({prefix:"/tracking/v2/tracking"}),M=n("TrackingServices",{putFoundAsset:(t,e,r)=>{const i={tag:t,group:e,serialNumber:r,type:"Global"};return m.put("/found",{params:i})}}),s=o({prefix:"/settings-user-role/v2"}),F=n("UserServices",{reLogin:t=>s.post("/auth/login",t),changePassword:t=>s.put("/users/change-password",t),getUserDetail:t=>s.get(`/users/${t}`),putEditUser:(t,e)=>{const r={"Content-Type":"multipart/form-data"};return s.put(`/users/${t}`,e,{headers:r})},putDeleteProfilePicture:t=>s.put(`/users/${t}/delete-profile-picture`),putCancelEmailChange:(t,e)=>s.put("/auth/confirm-email-change/cancel",{user:t,companyCode:e}),getUserDetailSystemRoles:(t,e,r)=>s.get(`/user-detail/${t}/system-roles`,{params:{...r,type:e}}),getUserDetailSystemRoleList:(t,e)=>s.get(`/user-detail/${t}/system-role-list`,{params:e}),getUserDetailSystemRoleOptions:(t,e)=>s.get(`/user-detail/${t}/system-role/option`,{params:e}),getUserDetailTransactionRoleList:(t,e)=>s.get(`/user-detail/${t}/transaction-role-list`,{params:e}),getUserDetailUserLogBorrowingList:(t,e)=>s.get(`/users-log/${t}/borrowing`,{params:e}),getUserDetailUserLogAssignmentList:(t,e)=>s.get(`/users-log/${t}/assignment`,{params:e}),getUserDetailUserLogBorrowingOption:(t,e)=>s.get(`/users-log/${t}/borrowing/option`,{params:e}),getUserDetailUserLogAssignmentOption:(t,e)=>s.get(`/users-log/${t}/assignment/option`,{params:e}),getUserDetailTransactionAdminLogList:(t,e)=>s.get(`/users-log/${t}/transaction-log`,{params:e}),getUserDetailTransactionAdminLogOption:(t,e)=>s.get(`/users-log/${t}/transaction-log/option`,{params:e})}),c=o({env:"APP_ADMIN_API",prefix:"/settings-attribute/languages"}),V=n("I18nService",{getMessages:t=>c.get(`/${t}/translations`),getLanguageOptions:async()=>{const{data:t}=await c.get("/dropdown");return t.data},getLanguageOptionMeta:async t=>{const{data:e}=await c.get("/dropdown/"+t);return e.data},translateText:async(t,e)=>{const{data:r}=await c.post("/translate",{q:t,target:e});return r.data.translations[t]}}),I=o({prefix:"/dashboard/v2/dashboard"}),k=n("DashboardServices",{getLatestTask:t=>I.get("/latest-task",{params:t}),getSummary:t=>I.get("/summary",{params:t})})}}});
1
+ System.register(["axios"],function(n,O){"use strict";var p;return{setters:[u=>{p=u.default}],execute:function(){const u={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_ADMIN_API:"https://dev-admin-api.tagsamurai.com",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"},l=n("getBaseURL",(t="APP_API")=>u["VITE_"+t]),o=(t={},e=!1)=>{const{env:r="APP_API",prefix:a="",headers:S={},...$}=t,L=`${l(r)}${a}`,v=JSON.parse(localStorage.getItem("user")??"{}"),y=v.jwt??v.token??"";return p.create({...$,baseURL:L,headers:e?S:{"Content-Type":"application/json",Authorization:`Bearer ${y}`,...S}})},U=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}),h=n("getImageURL",t=>{if(!t)return;const e=l("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),i=o({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),D=n("GroupCategoryServices",{getGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return i.get(`/${r}/tree`,{params:e})},getGroupCategoryList:(t,e,r)=>{const a=t==="category"?t:"groups";return i.get(`/${a}/${e}`,{params:r})},getNames:t=>{const e=t==="category"?t:"groups";return i.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return i.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const a=t==="category"?t:"groups";return i.put(`/${a}/${r}`,e)},putMoveGroup:(t,e)=>i.put(`/groups/${e}/move-group`,t),putEditBulkGroups:async t=>i.put("/groups/bulk",t),deleteGroupCategory:(t,e,r)=>{const a=t==="category"?t:"groups";return i.delete(`/${a}/${r}`,{data:e})}}),d=o({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),N=n("NotificationApprovalServices",{getTotalApprovals:()=>d.get("/approval/count")}),g=o({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),C=n("ChangelogServices",{getActionLog:t=>g.get("/change-log",{params:t}),getActionLogOption:t=>g.get("/change-log/options",{params:t}),getSessionLogList:t=>g.get("/session-log",{params:t}),getUserDetailSystemLogList:t=>g.get("/change-log",{params:t}),getUserDetailSystemLogOption:t=>g.get("/change-log/options",{params:t})}),_=o({prefix:"/assets/v2/assets"}),R=n("AssetServices",{getScanTag:t=>_.get("/scan",{params:{tag:t}})}),f=o({prefix:"/tracking/v2/missing"}),E=n("MissingServices",{putFoundAsset:(t,e)=>{const r={ids:[t],serialNumber:e};return f.put("/found",r)}}),A=o({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),G=n("NotificationServices",{getNotifications:t=>A.get("/",{params:t}),readNotification:t=>A.put(`/${t}`)}),T=o({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),b=n("SessionLogServices",{postLogout:()=>T.post("/logout")}),P=o({prefix:"/tag/v2"}),w=n("TAGServices",{getScanQR:t=>P.get("/qr",{params:{tag:t}}),getScanRFID:t=>P.get("/rfid",{params:{tag:t}})}),m=o({prefix:"/tracking/v2/tracking"}),M=n("TrackingServices",{putFoundAsset:(t,e,r)=>{const a={tag:t,group:e,serialNumber:r,type:"Global"};return m.put("/found",{params:a})}}),s=o({prefix:"/settings-user-role/v2"}),F=n("UserServices",{reLogin:t=>s.post("/auth/login",t),changePassword:t=>s.put("/users/change-password",t),getUserDetail:t=>s.get(`/users/${t}`),putEditUser:(t,e)=>{const r={"Content-Type":"multipart/form-data"};return s.put(`/users/${t}`,e,{headers:r})},putDeleteProfilePicture:t=>s.put(`/users/${t}/delete-profile-picture`),putCancelEmailChange:(t,e)=>s.put("/auth/confirm-email-change/cancel",{user:t,companyCode:e}),getUserDetailSystemRoles:(t,e,r)=>s.get(`/user-detail/${t}/system-roles`,{params:{...r,type:e}}),getUserDetailSystemRoleList:(t,e)=>s.get(`/user-detail/${t}/system-role-list`,{params:e}),getUserDetailSystemRoleOptions:(t,e)=>s.get(`/user-detail/${t}/system-role/option`,{params:e}),getUserDetailTransactionRoleList:(t,e)=>s.get(`/user-detail/${t}/transaction-role-list`,{params:e}),getUserDetailUserLogBorrowingList:(t,e)=>s.get(`/users-log/${t}/borrowing`,{params:e}),getUserDetailUserLogAssignmentList:(t,e)=>s.get(`/users-log/${t}/assignment`,{params:e}),getUserDetailUserLogBorrowingOption:(t,e)=>s.get(`/users-log/${t}/borrowing/option`,{params:e}),getUserDetailUserLogAssignmentOption:(t,e)=>s.get(`/users-log/${t}/assignment/option`,{params:e}),getUserDetailTransactionAdminLogList:(t,e)=>s.get(`/users-log/${t}/transaction-log`,{params:e}),getUserDetailTransactionAdminLogOption:(t,e)=>s.get(`/users-log/${t}/transaction-log/option`,{params:e})}),c=o({env:"APP_ADMIN_API",prefix:"/settings-attribute/languages"}),V=n("I18nService",{getMessages:t=>c.get(`/${t}/translations`),getLanguageOptions:async()=>{const{data:t}=await c.get("/dropdown");return t.data},getLanguageOptionMeta:async t=>{const{data:e}=await c.get("/dropdown/"+t);return e.data},translateText:async(t,e)=>{const{data:r}=await c.post("/translate",{q:t,target:e});return r.data.translations[t]}}),I=o({prefix:"/dashboard/v2/dashboard"}),k=n("DashboardServices",{getLatestTask:t=>I.get("/latest-task",{params:t}),getSummary:t=>I.get("/summary",{params:t})})}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "1.0.0-alpha.16",
3
+ "version": "1.0.0-alpha.17",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Fixed Asset Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -1,9 +1,9 @@
1
1
  import { AxiosResponse } from 'axios';
2
2
  import { CreateGroupCategoryBody, DeleteGroupCategoryBody, EditGroupCategoryBody, MoveGroupBody, GroupCategoryResponse, GroupCategoryTableResponse, EditBulkDisposableGroupBody, GetGroupTreeParams } from '../dto/groupCategoryService.dto';
3
- import { FetchDetailResponse } from '../types/fetchResponse.type';
3
+ import { FetchDetailResponse, QueryParams } from '../types/fetchResponse.type';
4
4
  declare const GroupCategoryServices: {
5
5
  getGroupCategory: (type: "group" | "category", params?: GetGroupTreeParams) => Promise<AxiosResponse<GroupCategoryResponse>>;
6
- getGroupCategoryList: (type: "group" | "category", groupId: string) => Promise<AxiosResponse<GroupCategoryTableResponse>>;
6
+ getGroupCategoryList: (type: "group" | "category", groupId: string, params?: QueryParams) => Promise<AxiosResponse<GroupCategoryTableResponse>>;
7
7
  getNames: (type: "group" | "category") => Promise<AxiosResponse<FetchDetailResponse<string[]>>>;
8
8
  postCreateGroupCategory: (type: "group" | "category", body: CreateGroupCategoryBody) => Promise<AxiosResponse<GroupCategoryResponse>>;
9
9
  putEditGroupCategory: (type: "group" | "category", body: EditGroupCategoryBody, objectId?: string) => Promise<AxiosResponse<GroupCategoryResponse>>;