@tagsamurai/fats-api-services 1.0.0-alpha.14 → 1.0.0-alpha.16
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.
- package/api-services.es.js +46 -40
- package/api-services.system.js +1 -1
- package/main.d.ts +1 -0
- package/package.json +1 -1
package/api-services.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const { env: r = "APP_API", prefix: a = "", headers: u = {}, ...
|
|
4
|
-
return
|
|
5
|
-
...
|
|
6
|
-
baseURL:
|
|
1
|
+
import v from "axios";
|
|
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 ?? "";
|
|
4
|
+
return v.create({
|
|
5
|
+
...I,
|
|
6
|
+
baseURL: _,
|
|
7
7
|
headers: e ? u : {
|
|
8
8
|
"Content-Type": "application/json",
|
|
9
|
-
Authorization: `Bearer ${
|
|
9
|
+
Authorization: `Bearer ${d}`,
|
|
10
10
|
...u
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
},
|
|
13
|
+
}, y = (t) => {
|
|
14
14
|
if (!t || typeof t == "string")
|
|
15
15
|
return;
|
|
16
16
|
const e = {};
|
|
@@ -23,12 +23,12 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
23
23
|
}), e;
|
|
24
24
|
}, U = (t) => {
|
|
25
25
|
if (!t) return;
|
|
26
|
-
const e =
|
|
26
|
+
const e = P("APP_TAGSAMURAI_API");
|
|
27
27
|
return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
|
|
28
28
|
}, o = 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
34
|
return o.get(`/${r}/tree`, { params: e });
|
|
@@ -50,55 +50,55 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
50
50
|
return o.put(`/${a}/${r}`, e);
|
|
51
51
|
},
|
|
52
52
|
putMoveGroup: (t, e) => o.put(`/groups/${e}/move-group`, t),
|
|
53
|
-
putEditBulkGroups: async (t) => o.put("/bulk", t),
|
|
53
|
+
putEditBulkGroups: async (t) => o.put("/groups/bulk", t),
|
|
54
54
|
deleteGroupCategory: (t, e, r) => {
|
|
55
55
|
const a = t === "category" ? t : "groups";
|
|
56
56
|
return o.delete(`/${a}/${r}`, { data: e });
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, f = n({
|
|
59
59
|
prefix: "/v2",
|
|
60
60
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
61
|
-
}),
|
|
62
|
-
getTotalApprovals: () =>
|
|
61
|
+
}), D = {
|
|
62
|
+
getTotalApprovals: () => f.get("/approval/count")
|
|
63
63
|
}, i = n({
|
|
64
64
|
prefix: "/v2",
|
|
65
65
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
66
|
-
}),
|
|
66
|
+
}), N = {
|
|
67
67
|
getActionLog: (t) => i.get("/change-log", { params: t }),
|
|
68
68
|
getActionLogOption: (t) => i.get("/change-log/options", { params: t }),
|
|
69
69
|
getSessionLogList: (t) => i.get("/session-log", { params: t }),
|
|
70
70
|
getUserDetailSystemLogList: (t) => i.get("/change-log", { params: t }),
|
|
71
71
|
getUserDetailSystemLogOption: (t) => i.get("/change-log/options", { params: t })
|
|
72
|
-
}, S = n({
|
|
73
|
-
prefix: "/assets/v2/assets"
|
|
74
|
-
}), N = {
|
|
75
|
-
getScanTag: (t) => S.get("/scan", { params: { tag: t } })
|
|
76
72
|
}, T = n({
|
|
77
|
-
prefix: "/
|
|
73
|
+
prefix: "/assets/v2/assets"
|
|
78
74
|
}), C = {
|
|
75
|
+
getScanTag: (t) => T.get("/scan", { params: { tag: t } })
|
|
76
|
+
}, $ = n({
|
|
77
|
+
prefix: "/tracking/v2/missing"
|
|
78
|
+
}), E = {
|
|
79
79
|
putFoundAsset: (t, e) => {
|
|
80
80
|
const r = { ids: [t], serialNumber: e };
|
|
81
|
-
return
|
|
81
|
+
return $.put("/found", r);
|
|
82
82
|
}
|
|
83
83
|
}, p = n({
|
|
84
84
|
prefix: "/v2/notification",
|
|
85
85
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
86
|
-
}),
|
|
86
|
+
}), R = {
|
|
87
87
|
getNotifications: (t) => p.get("/", { params: t }),
|
|
88
88
|
readNotification: (t) => p.put(`/${t}`)
|
|
89
|
-
},
|
|
89
|
+
}, m = n({
|
|
90
90
|
prefix: "/v2/session-log",
|
|
91
91
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
92
|
-
}),
|
|
93
|
-
postLogout: () =>
|
|
92
|
+
}), G = {
|
|
93
|
+
postLogout: () => m.post("/logout")
|
|
94
94
|
}, l = n({
|
|
95
95
|
prefix: "/tag/v2"
|
|
96
|
-
}),
|
|
96
|
+
}), x = {
|
|
97
97
|
getScanQR: (t) => l.get("/qr", { params: { tag: t } }),
|
|
98
98
|
getScanRFID: (t) => l.get("/rfid", { params: { tag: t } })
|
|
99
|
-
},
|
|
99
|
+
}, L = n({
|
|
100
100
|
prefix: "/tracking/v2/tracking"
|
|
101
|
-
}),
|
|
101
|
+
}), b = {
|
|
102
102
|
putFoundAsset: (t, e, r) => {
|
|
103
103
|
const a = {
|
|
104
104
|
tag: t,
|
|
@@ -106,7 +106,7 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
106
106
|
serialNumber: r,
|
|
107
107
|
type: "Global"
|
|
108
108
|
};
|
|
109
|
-
return
|
|
109
|
+
return L.put("/found", { params: a });
|
|
110
110
|
}
|
|
111
111
|
}, s = n({
|
|
112
112
|
prefix: "/settings-user-role/v2"
|
|
@@ -191,20 +191,26 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
191
191
|
});
|
|
192
192
|
return r.data.translations[t];
|
|
193
193
|
}
|
|
194
|
+
}, A = n({
|
|
195
|
+
prefix: "/dashboard/v2/dashboard"
|
|
196
|
+
}), F = {
|
|
197
|
+
getLatestTask: (t) => A.get("/latest-task", { params: t }),
|
|
198
|
+
getSummary: (t) => A.get("/summary", { params: t })
|
|
194
199
|
};
|
|
195
200
|
export {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
201
|
+
C as AssetServices,
|
|
202
|
+
N as ChangelogServices,
|
|
203
|
+
F as DashboardServices,
|
|
204
|
+
h as GroupCategoryServices,
|
|
199
205
|
M as I18nService,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
+
E as MissingServices,
|
|
207
|
+
D as NotificationApprovalServices,
|
|
208
|
+
R as NotificationServices,
|
|
209
|
+
G as SessionLogServices,
|
|
210
|
+
x as TAGServices,
|
|
211
|
+
b as TrackingServices,
|
|
206
212
|
w as UserServices,
|
|
207
|
-
|
|
213
|
+
P as getBaseURL,
|
|
208
214
|
U as getImageURL,
|
|
209
|
-
|
|
215
|
+
y as queryParamsStringfy
|
|
210
216
|
};
|
package/api-services.system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["axios"],function(n,
|
|
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})})}}});
|
package/main.d.ts
CHANGED
|
@@ -10,3 +10,4 @@ export { default as TAGServices } from './src/services/oldTag.service';
|
|
|
10
10
|
export { default as TrackingServices } from './src/services/oldTracking.service';
|
|
11
11
|
export { default as UserServices } from './src/services/oldUser.service';
|
|
12
12
|
export { default as I18nService } from './src/services/i18n.service';
|
|
13
|
+
export { default as DashboardServices } from './src/services/oldDashboard.service';
|
package/package.json
CHANGED