@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.
@@ -1,12 +1,12 @@
1
- import f from "axios";
2
- const L = { 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") => L["VITE_" + t], s = (t = {}, e = !1) => {
3
- const { env: r = "APP_API", prefix: o = "", headers: d = {}, ...m } = t, T = `${A(r)}${o}`, $ = JSON.parse(localStorage.getItem("user") ?? "{}"), C = $.jwt ?? $.token ?? "";
4
- return f.create({
5
- ...m,
6
- baseURL: T,
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 ${C}`,
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
- }, N = (t) => {
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
- }), R = {
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
- }, u = s({
58
+ }, c = s({
59
59
  prefix: "/settings-attribute-go/v2"
60
- }), x = {
60
+ }), F = {
61
61
  getGroupCategory: (t, e) => {
62
62
  const r = t === "category" ? t : "groups";
63
- return u.get(`/${r}/tree`, { params: e });
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 u.get(`/${r}/${e}`);
67
+ return c.get(`/${r}/${e}`);
68
68
  },
69
69
  getNames: (t) => {
70
70
  const e = t === "category" ? t : "groups";
71
- return u.get(`/${e}/names`);
71
+ return c.get(`/${e}/names`);
72
72
  },
73
73
  postCreateGroupCategory: (t, e) => {
74
74
  const r = t === "category" ? t : "groups";
75
- return u.post(`/${r}`, e);
75
+ return c.post(`/${r}`, e);
76
76
  },
77
77
  putEditGroupCategory: (t, e, r) => {
78
78
  const o = t === "category" ? t : "groups";
79
- return u.put(`/${o}/${r}`, e);
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 u.delete(`/${o}/${r}`, { data: e });
83
+ return c.delete(`/${o}/${r}`, { data: e });
84
84
  }
85
- }, O = s({
85
+ }, U = s({
86
86
  prefix: "/v2",
87
87
  env: "APP_LOGS_NOTIFICATION_API"
88
- }), F = {
89
- getTotalApprovals: () => O.get("/approval/count")
88
+ }), k = {
89
+ getTotalApprovals: () => U.get("/approval/count")
90
90
  }, p = s({
91
91
  prefix: "/v2",
92
92
  env: "APP_LOGS_NOTIFICATION_API"
93
- }), k = {
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
- }), w = {
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
- }, U = s({
118
+ }, h = s({
119
119
  prefix: "/tracking/v2/missing"
120
- }), M = {
120
+ }), B = {
121
121
  putFoundAsset: (t, e) => {
122
122
  const r = { ids: [t], serialNumber: e };
123
- return U.put("/found", r);
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
- }), B = {
128
+ }), V = {
129
129
  getNotifications: (t) => S.get("/", { params: t }),
130
130
  readNotification: (t) => S.put(`/${t}`)
131
- }, h = s({
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
- }), V = {
135
- postLogout: () => h.post("/logout")
139
+ }), Y = {
140
+ postLogout: () => G.post("/logout")
136
141
  }, v = s({
137
142
  prefix: "/tag/v2"
138
- }), Y = {
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
- }, G = s({
147
+ }, N = s({
143
148
  prefix: "/tracking/v2/tracking"
144
- }), j = {
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 G.put("/found", { params: o });
157
+ return N.put("/found", { params: o });
153
158
  }
154
159
  }, n = s({
155
160
  prefix: "/settings-user-role/v2"
156
- }), J = {
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
- }), q = {
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
- }, _ = s({
242
+ }, y = s({
238
243
  prefix: "/dashboard/v2/dashboard"
239
- }), K = {
240
- getLatestTask: (t) => _.get("/latest-task", { params: t }),
241
- getSummary: (t) => _.get("/summary", { params: 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
- }), W = {
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
- }, y = s({
253
+ }, _ = s({
249
254
  prefix: "/settings-attribute/v2/general-settings"
250
- }), z = {
251
- getGeneralSettings: () => y.get("/"),
252
- putUpdateGeneralSettings: (t) => y.put("/", t)
253
- }, c = s({
255
+ }), Z = {
256
+ getGeneralSettings: () => _.get("/"),
257
+ putUpdateGeneralSettings: (t) => _.put("/", t)
258
+ }, u = s({
254
259
  prefix: "/settings-attribute/v2/custom-field"
255
- }), Q = {
256
- getCustomField: async (t) => c.get("/", { params: t }),
257
- getOptions: async (t) => c.get("/options", { params: t }),
258
- postCreateCustomField: async (t, e) => c.post("/", e, { params: t }),
259
- putEditCustomField: async (t, e, r) => c.put(`/${r}`, e, { params: t }),
260
- putChangeStatus: async (t, e) => c.put("/bulk", e, { params: t }),
261
- deleteCustomField: async (t) => c.delete("/bulk", { data: t })
262
- }, I = ({ headers: t = {}, params: e = {} } = {}) => {
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 f.create({
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
- }, Z = {
274
- getCountry: () => I().get("/countries"),
275
- getState: (t) => I().get(`/countries/${t}/states`),
276
- getCity: (t, e) => I().get(`/countries/${t}/states/${e}/cities`)
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
- }), H = {
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
- }), X = {
299
+ }), et = {
295
300
  getDropdown: (t) => b.get("/dropdown", { params: t })
296
301
  };
297
302
  export {
298
- W as AliasCodeServices,
299
- w as AssetServices,
300
- X as BrandServices,
301
- k as ChangelogServices,
302
- Z as CountryStateServices,
303
- Q as CustomFieldServices,
304
- K as DashboardServices,
305
- z as GeneralSettingsServices,
306
- R as GroupCategoryServices,
307
- x as GroupCategoryServicesGo,
308
- q as I18nService,
309
- M as MissingServices,
310
- F as NotificationApprovalServices,
311
- B as NotificationServices,
312
- H as ServiceCenterServices,
313
- V as SessionLogServices,
314
- Y as TAGServices,
315
- j as TrackingServices,
316
- J as UserServices,
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
- N as getImageURL,
324
+ R as getImageURL,
319
325
  E as queryParamsStringfy
320
326
  };
@@ -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:y={},...G}=t,b=`${A(r)}${o}`,C=JSON.parse(localStorage.getItem("user")??"{}"),D=C.jwt??C.token??"";return d.create({...G,baseURL:b,headers:e?y:{"Content-Type":"application/json",Authorization:`Bearer ${D}`,...y}})},N=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}),R=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"}),F=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"}),k=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})}}),T=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),w=s("NotificationApprovalServices",{getTotalApprovals:()=>T.get("/approval/count")}),l=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),B=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"}),M=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})}}),L=n({prefix:"/tracking/v2/missing"}),V=s("MissingServices",{putFoundAsset:(t,e)=>{const r={ids:[t],serialNumber:e};return L.put("/found",r)}}),_=n({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),Y=s("NotificationServices",{getNotifications:t=>_.get("/",{params:t}),readNotification:t=>_.put(`/${t}`)}),O=n({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),j=s("SessionLogServices",{postLogout:()=>O.post("/logout")}),P=n({prefix:"/tag/v2"}),q=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})}),U=n({prefix:"/tracking/v2/tracking"}),J=s("TrackingServices",{putFoundAsset:(t,e,r)=>{const o={tag:t,group:e,serialNumber:r,type:"Global"};return U.put("/found",{params:o})}}),i=n({prefix:"/settings-user-role/v2"}),K=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"}),x=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]}}),f=n({prefix:"/dashboard/v2/dashboard"}),W=s("DashboardServices",{getLatestTask:t=>f.get("/latest-task",{params:t}),getSummary:t=>f.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})}),m=n({prefix:"/settings-attribute/v2/general-settings"}),Q=s("GeneralSettingsServices",{getGeneralSettings:()=>m.get("/"),putUpdateGeneralSettings:t=>m.put("/",t)}),p=n({prefix:"/settings-attribute/v2/custom-field"}),Z=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})},H=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"}),X=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`)}),h=n({prefix:"/settings-attribute/v2/brands"}),tt=s("BrandServices",{getDropdown:t=>h.get("/dropdown",{params:t})})}}});
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "1.0.0-alpha.27",
3
+ "version": "1.0.0-alpha.29",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Fixed Asset Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -4,4 +4,5 @@ export type GetNotificationParam = {
4
4
  sortOrder?: number;
5
5
  limit?: number;
6
6
  page?: number;
7
+ module?: string;
7
8
  };
@@ -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
+ };