@tagsamurai/fats-api-services 1.0.0-alpha.27 → 1.0.0-alpha.29
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
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const { env: r = "APP_API", prefix: o = "", headers: d = {}, ...
|
|
4
|
-
return
|
|
5
|
-
...
|
|
6
|
-
baseURL:
|
|
1
|
+
import m from "axios";
|
|
2
|
+
const O = { 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" }, A = (t = "APP_API") => O["VITE_" + t], s = (t = {}, e = !1) => {
|
|
3
|
+
const { env: r = "APP_API", prefix: o = "", headers: d = {}, ...T } = t, C = `${A(r)}${o}`, I = JSON.parse(localStorage.getItem("user") ?? "{}"), L = I.jwt ?? I.token ?? "";
|
|
4
|
+
return m.create({
|
|
5
|
+
...T,
|
|
6
|
+
baseURL: C,
|
|
7
7
|
headers: e ? d : {
|
|
8
8
|
"Content-Type": "application/json",
|
|
9
|
-
Authorization: `Bearer ${
|
|
9
|
+
Authorization: `Bearer ${L}`,
|
|
10
10
|
...d
|
|
11
11
|
}
|
|
12
12
|
});
|
|
@@ -21,14 +21,14 @@ const L = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
21
21
|
[r]: t[r]
|
|
22
22
|
});
|
|
23
23
|
}), e;
|
|
24
|
-
},
|
|
24
|
+
}, R = (t) => {
|
|
25
25
|
if (!t) return;
|
|
26
26
|
const e = A("APP_TAGSAMURAI_API");
|
|
27
27
|
return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
|
|
28
28
|
}, g = s({
|
|
29
29
|
prefix: "/settings-attribute/v2",
|
|
30
30
|
env: "APP_TAGSAMURAI_API"
|
|
31
|
-
}),
|
|
31
|
+
}), x = {
|
|
32
32
|
getGroupCategory: (t, e) => {
|
|
33
33
|
const r = t === "category" ? t : "groups";
|
|
34
34
|
return g.get(`/${r}/tree`, { params: e });
|
|
@@ -55,42 +55,42 @@ const L = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
55
55
|
const o = t === "category" ? t : "groups";
|
|
56
56
|
return g.delete(`/${o}/${r}`, { data: e });
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, c = s({
|
|
59
59
|
prefix: "/settings-attribute-go/v2"
|
|
60
|
-
}),
|
|
60
|
+
}), F = {
|
|
61
61
|
getGroupCategory: (t, e) => {
|
|
62
62
|
const r = t === "category" ? t : "groups";
|
|
63
|
-
return
|
|
63
|
+
return c.get(`/${r}/tree`, { params: e });
|
|
64
64
|
},
|
|
65
65
|
getGroupCategoryList: (t, e) => {
|
|
66
66
|
const r = t === "category" ? t : "groups";
|
|
67
|
-
return
|
|
67
|
+
return c.get(`/${r}/${e}`);
|
|
68
68
|
},
|
|
69
69
|
getNames: (t) => {
|
|
70
70
|
const e = t === "category" ? t : "groups";
|
|
71
|
-
return
|
|
71
|
+
return c.get(`/${e}/names`);
|
|
72
72
|
},
|
|
73
73
|
postCreateGroupCategory: (t, e) => {
|
|
74
74
|
const r = t === "category" ? t : "groups";
|
|
75
|
-
return
|
|
75
|
+
return c.post(`/${r}`, e);
|
|
76
76
|
},
|
|
77
77
|
putEditGroupCategory: (t, e, r) => {
|
|
78
78
|
const o = t === "category" ? t : "groups";
|
|
79
|
-
return
|
|
79
|
+
return c.put(`/${o}/${r}`, e);
|
|
80
80
|
},
|
|
81
81
|
deleteGroupCategory: (t, e, r) => {
|
|
82
82
|
const o = t === "category" ? t : "groups";
|
|
83
|
-
return
|
|
83
|
+
return c.delete(`/${o}/${r}`, { data: e });
|
|
84
84
|
}
|
|
85
|
-
},
|
|
85
|
+
}, U = s({
|
|
86
86
|
prefix: "/v2",
|
|
87
87
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
88
|
-
}),
|
|
89
|
-
getTotalApprovals: () =>
|
|
88
|
+
}), k = {
|
|
89
|
+
getTotalApprovals: () => U.get("/approval/count")
|
|
90
90
|
}, p = s({
|
|
91
91
|
prefix: "/v2",
|
|
92
92
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
93
|
-
}),
|
|
93
|
+
}), w = {
|
|
94
94
|
getActionLog: (t) => p.get("/change-log", { params: t }),
|
|
95
95
|
getActionLogOption: (t) => p.get("/change-log/options", { params: t }),
|
|
96
96
|
getSessionLogList: (t) => p.get("/session-log", { params: t }),
|
|
@@ -98,7 +98,7 @@ const L = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
98
98
|
getUserDetailSystemLogOption: (t) => p.get("/change-log/options", { params: t })
|
|
99
99
|
}, a = s({
|
|
100
100
|
prefix: "/assets/v2/assets"
|
|
101
|
-
}),
|
|
101
|
+
}), M = {
|
|
102
102
|
getScanTag: (t) => a.get("/scan", { params: { tag: t } }),
|
|
103
103
|
getAllAssets: (t) => a.get("/", { params: t }),
|
|
104
104
|
getAvailableAssets: (t) => a.get("/available", { params: t }),
|
|
@@ -115,33 +115,38 @@ const L = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
115
115
|
};
|
|
116
116
|
return a.get("/by-id", { params: r });
|
|
117
117
|
}
|
|
118
|
-
},
|
|
118
|
+
}, h = s({
|
|
119
119
|
prefix: "/tracking/v2/missing"
|
|
120
|
-
}),
|
|
120
|
+
}), B = {
|
|
121
121
|
putFoundAsset: (t, e) => {
|
|
122
122
|
const r = { ids: [t], serialNumber: e };
|
|
123
|
-
return
|
|
123
|
+
return h.put("/found", r);
|
|
124
124
|
}
|
|
125
125
|
}, S = s({
|
|
126
126
|
prefix: "/v2/notification",
|
|
127
127
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
128
|
-
}),
|
|
128
|
+
}), V = {
|
|
129
129
|
getNotifications: (t) => S.get("/", { params: t }),
|
|
130
130
|
readNotification: (t) => S.put(`/${t}`)
|
|
131
|
-
},
|
|
131
|
+
}, f = s({
|
|
132
|
+
prefix: "/utility/v2/notification"
|
|
133
|
+
}), j = {
|
|
134
|
+
getNotifications: (t) => f.get("/", { params: t }),
|
|
135
|
+
readNotification: (t) => f.put(`/${t}`)
|
|
136
|
+
}, G = s({
|
|
132
137
|
prefix: "/v2/session-log",
|
|
133
138
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
134
|
-
}),
|
|
135
|
-
postLogout: () =>
|
|
139
|
+
}), Y = {
|
|
140
|
+
postLogout: () => G.post("/logout")
|
|
136
141
|
}, v = s({
|
|
137
142
|
prefix: "/tag/v2"
|
|
138
|
-
}),
|
|
143
|
+
}), J = {
|
|
139
144
|
getScanQR: (t) => v.get("/qr", { params: { tag: t } }),
|
|
140
145
|
getScanRFID: (t) => v.get("/rfid", { params: { tag: t } }),
|
|
141
146
|
getRFIDQRTAG: (t) => v.get("/rfid-qr/scan", { params: t })
|
|
142
|
-
},
|
|
147
|
+
}, N = s({
|
|
143
148
|
prefix: "/tracking/v2/tracking"
|
|
144
|
-
}),
|
|
149
|
+
}), q = {
|
|
145
150
|
putFoundAsset: (t, e, r) => {
|
|
146
151
|
const o = {
|
|
147
152
|
tag: t,
|
|
@@ -149,11 +154,11 @@ const L = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
149
154
|
serialNumber: r,
|
|
150
155
|
type: "Global"
|
|
151
156
|
};
|
|
152
|
-
return
|
|
157
|
+
return N.put("/found", { params: o });
|
|
153
158
|
}
|
|
154
159
|
}, n = s({
|
|
155
160
|
prefix: "/settings-user-role/v2"
|
|
156
|
-
}),
|
|
161
|
+
}), K = {
|
|
157
162
|
reLogin: (t) => n.post("/auth/login", t),
|
|
158
163
|
changePassword: (t) => n.put("/users/change-password", t),
|
|
159
164
|
getUserDetail: (t) => n.get(`/users/${t}`),
|
|
@@ -191,7 +196,7 @@ const L = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
191
196
|
}, l = s({
|
|
192
197
|
env: "APP_ADMIN_API",
|
|
193
198
|
prefix: "/settings-attribute/languages"
|
|
194
|
-
}),
|
|
199
|
+
}), W = {
|
|
195
200
|
/**
|
|
196
201
|
* Fetch all translation messages for a specific locale.
|
|
197
202
|
* @param locale The locale code (e.g., 'en', 'id').
|
|
@@ -234,34 +239,34 @@ const L = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
234
239
|
});
|
|
235
240
|
return r.data.translations[t];
|
|
236
241
|
}
|
|
237
|
-
},
|
|
242
|
+
}, y = s({
|
|
238
243
|
prefix: "/dashboard/v2/dashboard"
|
|
239
|
-
}),
|
|
240
|
-
getLatestTask: (t) =>
|
|
241
|
-
getSummary: (t) =>
|
|
244
|
+
}), z = {
|
|
245
|
+
getLatestTask: (t) => y.get("/latest-task", { params: t }),
|
|
246
|
+
getSummary: (t) => y.get("/summary", { params: t })
|
|
242
247
|
}, P = s({
|
|
243
248
|
prefix: "/alias-code/api/alias-code"
|
|
244
|
-
}),
|
|
249
|
+
}), Q = {
|
|
245
250
|
getAliasCode: () => P.get("/"),
|
|
246
251
|
postAliasCode: (t) => P.post("/", t),
|
|
247
252
|
getAliasCodeList: (t) => P.get(`/${t.object}/code-list`, { params: t })
|
|
248
|
-
},
|
|
253
|
+
}, _ = s({
|
|
249
254
|
prefix: "/settings-attribute/v2/general-settings"
|
|
250
|
-
}),
|
|
251
|
-
getGeneralSettings: () =>
|
|
252
|
-
putUpdateGeneralSettings: (t) =>
|
|
253
|
-
},
|
|
255
|
+
}), Z = {
|
|
256
|
+
getGeneralSettings: () => _.get("/"),
|
|
257
|
+
putUpdateGeneralSettings: (t) => _.put("/", t)
|
|
258
|
+
}, u = s({
|
|
254
259
|
prefix: "/settings-attribute/v2/custom-field"
|
|
255
|
-
}),
|
|
256
|
-
getCustomField: async (t) =>
|
|
257
|
-
getOptions: async (t) =>
|
|
258
|
-
postCreateCustomField: async (t, e) =>
|
|
259
|
-
putEditCustomField: async (t, e, r) =>
|
|
260
|
-
putChangeStatus: async (t, e) =>
|
|
261
|
-
deleteCustomField: async (t) =>
|
|
262
|
-
},
|
|
260
|
+
}), H = {
|
|
261
|
+
getCustomField: async (t) => u.get("/", { params: t }),
|
|
262
|
+
getOptions: async (t) => u.get("/options", { params: t }),
|
|
263
|
+
postCreateCustomField: async (t, e) => u.post("/", e, { params: t }),
|
|
264
|
+
putEditCustomField: async (t, e, r) => u.put(`/${r}`, e, { params: t }),
|
|
265
|
+
putChangeStatus: async (t, e) => u.put("/bulk", e, { params: t }),
|
|
266
|
+
deleteCustomField: async (t) => u.delete("/bulk", { data: t })
|
|
267
|
+
}, $ = ({ headers: t = {}, params: e = {} } = {}) => {
|
|
263
268
|
const r = A("APP_COUNTRY_STATE_API"), o = A("APP_COUNTRY_STATE_API_KEY");
|
|
264
|
-
return
|
|
269
|
+
return m.create({
|
|
265
270
|
baseURL: `${r}/v1`,
|
|
266
271
|
headers: {
|
|
267
272
|
"Content-type": "application/json",
|
|
@@ -270,13 +275,13 @@ const L = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
270
275
|
},
|
|
271
276
|
params: e
|
|
272
277
|
});
|
|
273
|
-
},
|
|
274
|
-
getCountry: () =>
|
|
275
|
-
getState: (t) =>
|
|
276
|
-
getCity: (t, e) =>
|
|
278
|
+
}, X = {
|
|
279
|
+
getCountry: () => $().get("/countries"),
|
|
280
|
+
getState: (t) => $().get(`/countries/${t}/states`),
|
|
281
|
+
getCity: (t, e) => $().get(`/countries/${t}/states/${e}/cities`)
|
|
277
282
|
}, i = s({
|
|
278
283
|
prefix: "/routine/v2"
|
|
279
|
-
}),
|
|
284
|
+
}), tt = {
|
|
280
285
|
getList: (t) => i.get("/service-center", { params: t }),
|
|
281
286
|
postList: (t) => i.post("/service-center", t),
|
|
282
287
|
putList: (t, e) => i.put(`/service-center/${t}`, e),
|
|
@@ -291,30 +296,31 @@ const L = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
291
296
|
getActivityLog: (t) => i.get(`/service-activities/${t}/activity-log`)
|
|
292
297
|
}, b = s({
|
|
293
298
|
prefix: "/settings-attribute/v2/brands"
|
|
294
|
-
}),
|
|
299
|
+
}), et = {
|
|
295
300
|
getDropdown: (t) => b.get("/dropdown", { params: t })
|
|
296
301
|
};
|
|
297
302
|
export {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
Y as
|
|
315
|
-
|
|
316
|
-
|
|
303
|
+
Q as AliasCodeServices,
|
|
304
|
+
M as AssetServices,
|
|
305
|
+
et as BrandServices,
|
|
306
|
+
w as ChangelogServices,
|
|
307
|
+
X as CountryStateServices,
|
|
308
|
+
H as CustomFieldServices,
|
|
309
|
+
z as DashboardServices,
|
|
310
|
+
Z as GeneralSettingsServices,
|
|
311
|
+
x as GroupCategoryServices,
|
|
312
|
+
F as GroupCategoryServicesGo,
|
|
313
|
+
W as I18nService,
|
|
314
|
+
B as MissingServices,
|
|
315
|
+
k as NotificationApprovalServices,
|
|
316
|
+
V as NotificationServices,
|
|
317
|
+
j as NotificationServicesGo,
|
|
318
|
+
tt as ServiceCenterServices,
|
|
319
|
+
Y as SessionLogServices,
|
|
320
|
+
J as TAGServices,
|
|
321
|
+
q as TrackingServices,
|
|
322
|
+
K as UserServices,
|
|
317
323
|
A as getBaseURL,
|
|
318
|
-
|
|
324
|
+
R as getImageURL,
|
|
319
325
|
E as queryParamsStringfy
|
|
320
326
|
};
|
package/api-services.system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["axios"],function(s,E){"use strict";var d;return{setters:[S=>{d=S.default}],execute:function(){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"},A=s("getBaseURL",(t="APP_API")=>S["VITE_"+t]),n=(t={},e=!1)=>{const{env:r="APP_API",prefix:o="",headers:
|
|
1
|
+
System.register(["axios"],function(s,E){"use strict";var d;return{setters:[S=>{d=S.default}],execute:function(){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"},A=s("getBaseURL",(t="APP_API")=>S["VITE_"+t]),n=(t={},e=!1)=>{const{env:r="APP_API",prefix:o="",headers:f={},...N}=t,b=`${A(r)}${o}`,T=JSON.parse(localStorage.getItem("user")??"{}"),D=T.jwt??T.token??"";return d.create({...N,baseURL:b,headers:e?f:{"Content-Type":"application/json",Authorization:`Bearer ${D}`,...f}})},R=s("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}),F=s("getImageURL",t=>{if(!t)return;const e=A("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),c=n({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),k=s("GroupCategoryServices",{getGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return c.get(`/${r}/tree`,{params:e})},getGroupCategoryList:(t,e,r)=>{const o=t==="category"?t:"groups";return c.get(`/${o}/${e}`,{params:r})},getNames:t=>{const e=t==="category"?t:"groups";return c.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return c.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return c.put(`/${o}/${r}`,e)},putMoveGroup:(t,e)=>c.put(`/groups/${e}/move-group`,t),putEditBulkGroups:async t=>c.put("/groups/bulk",t),deleteGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return c.delete(`/${o}/${r}`,{data:e})}}),u=n({prefix:"/settings-attribute-go/v2"}),w=s("GroupCategoryServicesGo",{getGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return u.get(`/${r}/tree`,{params:e})},getGroupCategoryList:(t,e)=>{const r=t==="category"?t:"groups";return u.get(`/${r}/${e}`)},getNames:t=>{const e=t==="category"?t:"groups";return u.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return u.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return u.put(`/${o}/${r}`,e)},deleteGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return u.delete(`/${o}/${r}`,{data:e})}}),L=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),B=s("NotificationApprovalServices",{getTotalApprovals:()=>L.get("/approval/count")}),l=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),M=s("ChangelogServices",{getActionLog:t=>l.get("/change-log",{params:t}),getActionLogOption:t=>l.get("/change-log/options",{params:t}),getSessionLogList:t=>l.get("/session-log",{params:t}),getUserDetailSystemLogList:t=>l.get("/change-log",{params:t}),getUserDetailSystemLogOption:t=>l.get("/change-log/options",{params:t})}),g=n({prefix:"/assets/v2/assets"}),V=s("AssetServices",{getScanTag:t=>g.get("/scan",{params:{tag:t}}),getAllAssets:t=>g.get("/",{params:t}),getAvailableAssets:t=>g.get("/available",{params:t}),scanAsset:t=>g.get("",{params:{tag:t}}),getAssetsById:(t,e)=>g.get("/by-id",{params:{_id:t,...e}}),getOptions:(t,e)=>g.get(t?`/${t}/options`:"/options",{params:e}),getUnlinkedAssets:t=>g.get("/unlinked",{params:t}),getAssetDetail:(t,e)=>g.get(`/${t}`,{params:e}),getLinkedAssetFamily:t=>g.get("/family",{params:{id:t}}),matchAssetWithTag:(t,e)=>{const r={_id:JSON.stringify([t]),tag:e};return g.get("/by-id",{params:r})}}),O=n({prefix:"/tracking/v2/missing"}),j=s("MissingServices",{putFoundAsset:(t,e)=>{const r={ids:[t],serialNumber:e};return O.put("/found",r)}}),y=n({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),Y=s("NotificationServices",{getNotifications:t=>y.get("/",{params:t}),readNotification:t=>y.put(`/${t}`)}),_=n({prefix:"/utility/v2/notification"}),q=s("NotificationServicesGo",{getNotifications:t=>_.get("/",{params:t}),readNotification:t=>_.put(`/${t}`)}),U=n({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),J=s("SessionLogServices",{postLogout:()=>U.post("/logout")}),P=n({prefix:"/tag/v2"}),K=s("TAGServices",{getScanQR:t=>P.get("/qr",{params:{tag:t}}),getScanRFID:t=>P.get("/rfid",{params:{tag:t}}),getRFIDQRTAG:t=>P.get("/rfid-qr/scan",{params:t})}),h=n({prefix:"/tracking/v2/tracking"}),x=s("TrackingServices",{putFoundAsset:(t,e,r)=>{const o={tag:t,group:e,serialNumber:r,type:"Global"};return h.put("/found",{params:o})}}),i=n({prefix:"/settings-user-role/v2"}),W=s("UserServices",{reLogin:t=>i.post("/auth/login",t),changePassword:t=>i.put("/users/change-password",t),getUserDetail:t=>i.get(`/users/${t}`),putEditUser:(t,e)=>{const r={"Content-Type":"multipart/form-data"};return i.put(`/users/${t}`,e,{headers:r})},putDeleteProfilePicture:t=>i.put(`/users/${t}/delete-profile-picture`),putCancelEmailChange:(t,e)=>i.put("/auth/confirm-email-change/cancel",{user:t,companyCode:e}),getUserDetailSystemRoles:(t,e,r)=>i.get(`/user-detail/${t}/system-roles`,{params:{...r,type:e}}),getUserDetailSystemRoleList:(t,e)=>i.get(`/user-detail/${t}/system-role-list`,{params:e}),getUserDetailSystemRoleOptions:(t,e)=>i.get(`/user-detail/${t}/system-role/option`,{params:e}),getUserDetailTransactionRoleList:(t,e)=>i.get(`/user-detail/${t}/transaction-role-list`,{params:e}),getUserDetailUserLogBorrowingList:(t,e)=>i.get(`/users-log/${t}/borrowing`,{params:e}),getUserDetailUserLogAssignmentList:(t,e)=>i.get(`/users-log/${t}/assignment`,{params:e}),getUserDetailUserLogBorrowingOption:(t,e)=>i.get(`/users-log/${t}/borrowing/option`,{params:e}),getUserDetailUserLogAssignmentOption:(t,e)=>i.get(`/users-log/${t}/assignment/option`,{params:e}),getUserDetailTransactionAdminLogList:(t,e)=>i.get(`/users-log/${t}/transaction-log`,{params:e}),getUserDetailTransactionAdminLogOption:(t,e)=>i.get(`/users-log/${t}/transaction-log/option`,{params:e})}),v=n({env:"APP_ADMIN_API",prefix:"/settings-attribute/languages"}),z=s("I18nService",{getMessages:t=>v.get(`/${t}/translations`),getLanguageOptions:async()=>{const{data:t}=await v.get("/dropdown");return t.data},getLanguageOptionMeta:async t=>{const{data:e}=await v.get("/dropdown/"+t);return e.data},translateText:async(t,e)=>{const{data:r}=await v.post("/translate",{q:t,target:e});return r.data.translations[t]}}),m=n({prefix:"/dashboard/v2/dashboard"}),Q=s("DashboardServices",{getLatestTask:t=>m.get("/latest-task",{params:t}),getSummary:t=>m.get("/summary",{params:t})}),I=n({prefix:"/alias-code/api/alias-code"}),Z=s("AliasCodeServices",{getAliasCode:()=>I.get("/"),postAliasCode:t=>I.post("/",t),getAliasCodeList:t=>I.get(`/${t.object}/code-list`,{params:t})}),C=n({prefix:"/settings-attribute/v2/general-settings"}),H=s("GeneralSettingsServices",{getGeneralSettings:()=>C.get("/"),putUpdateGeneralSettings:t=>C.put("/",t)}),p=n({prefix:"/settings-attribute/v2/custom-field"}),X=s("CustomFieldServices",{getCustomField:async t=>p.get("/",{params:t}),getOptions:async t=>p.get("/options",{params:t}),postCreateCustomField:async(t,e)=>p.post("/",e,{params:t}),putEditCustomField:async(t,e,r)=>p.put(`/${r}`,e,{params:t}),putChangeStatus:async(t,e)=>p.put("/bulk",e,{params:t}),deleteCustomField:async t=>p.delete("/bulk",{data:t})}),$=({headers:t={},params:e={}}={})=>{const r=A("APP_COUNTRY_STATE_API"),o=A("APP_COUNTRY_STATE_API_KEY");return d.create({baseURL:`${r}/v1`,headers:{"Content-type":"application/json","X-CSCAPI-KEY":o,...t},params:e})},tt=s("CountryStateServices",{getCountry:()=>$().get("/countries"),getState:t=>$().get(`/countries/${t}/states`),getCity:(t,e)=>$().get(`/countries/${t}/states/${e}/cities`)}),a=n({prefix:"/routine/v2"}),et=s("ServiceCenterServices",{getList:t=>a.get("/service-center",{params:t}),postList:t=>a.post("/service-center",t),putList:(t,e)=>a.put(`/service-center/${t}`,e),putActivate:t=>a.put("/service-center/bulk",t),getDetailList:t=>a.get(`/service-center/${t}`),getListOptions:t=>a.get("/service-center/options",{params:t}),deleteList:t=>a.delete("/service-center",{params:t}),getActivities:t=>a.get("/service-activities",{params:t}),getActivityOptions:t=>a.get("/service-activities/options",{params:t}),getActivityDetail:t=>a.get(`/service-activities/${t}`),getActivityLog:t=>a.get(`/service-activities/${t}/activity-log`)}),G=n({prefix:"/settings-attribute/v2/brands"}),rt=s("BrandServices",{getDropdown:t=>G.get("/dropdown",{params:t})})}}});
|
package/main.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { default as ChangelogServices } from './src/services/oldLog.service';
|
|
|
6
6
|
export { default as AssetServices } from './src/services/oldAsset.service';
|
|
7
7
|
export { default as MissingServices } from './src/services/oldMissing.service';
|
|
8
8
|
export { default as NotificationServices } from './src/services/oldNotification.service';
|
|
9
|
+
export { default as NotificationServicesGo } from './src/services/notification.service';
|
|
9
10
|
export { default as SessionLogServices } from './src/services/oldSessionLog.service';
|
|
10
11
|
export { default as TAGServices } from './src/services/oldTag.service';
|
|
11
12
|
export { default as TrackingServices } from './src/services/oldTracking.service';
|
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { GetNotificationParam } from '../dto/notification.dto';
|
|
3
|
+
import { NotificationItemType } from '../types/notification.type';
|
|
4
|
+
import { FetchListResponse } from '../types/fetchResponse.type';
|
|
5
|
+
declare const NotificationServices: {
|
|
6
|
+
getNotifications: (params: GetNotificationParam) => Promise<AxiosResponse<FetchListResponse<NotificationItemType>>>;
|
|
7
|
+
readNotification: (id: string) => Promise<AxiosResponse>;
|
|
8
|
+
};
|
|
9
|
+
export default NotificationServices;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type NotificationItemType = {
|
|
2
|
+
_id: string;
|
|
3
|
+
user: string;
|
|
4
|
+
title: string;
|
|
5
|
+
detail: string;
|
|
6
|
+
isManager?: boolean;
|
|
7
|
+
isRead: boolean;
|
|
8
|
+
isReadOnly: boolean;
|
|
9
|
+
module: 'Borrow' | 'Assignment' | 'Transfer' | 'Disposal' | 'Audit' | 'Maintenance Routine' | 'Repair Ticketing' | 'Tracking' | 'TAG' | 'General Asset';
|
|
10
|
+
severity: string;
|
|
11
|
+
type: string;
|
|
12
|
+
data: {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
};
|