@tagsamurai/fats-api-services 1.0.0-alpha.23 → 1.0.0-alpha.24
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 +61 -48
- package/api-services.system.js +1 -1
- package/main.d.ts +2 -0
- package/package.json +1 -1
- package/src/dto/aliasCode.dto.d.ts +4 -0
- package/src/services/oldAliasCode.service.d.ts +10 -0
- package/src/services/oldGeneralSettings.service.d.ts +6 -0
- package/src/types/aliasCode.type.d.ts +16 -0
package/api-services.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const { env: r = "APP_API", prefix: a = "", headers:
|
|
4
|
-
return
|
|
5
|
-
...
|
|
6
|
-
baseURL:
|
|
7
|
-
headers: e ?
|
|
1
|
+
import $ from "axios";
|
|
2
|
+
const m = { 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" }, _ = (t = "APP_API") => m["VITE_" + t], n = (t = {}, e = !1) => {
|
|
3
|
+
const { env: r = "APP_API", prefix: a = "", headers: l = {}, ...S } = t, v = `${_(r)}${a}`, A = JSON.parse(localStorage.getItem("user") ?? "{}"), f = A.jwt ?? A.token ?? "";
|
|
4
|
+
return $.create({
|
|
5
|
+
...S,
|
|
6
|
+
baseURL: v,
|
|
7
|
+
headers: e ? l : {
|
|
8
8
|
"Content-Type": "application/json",
|
|
9
9
|
Authorization: `Bearer ${f}`,
|
|
10
|
-
...
|
|
10
|
+
...l
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
},
|
|
13
|
+
}, h = (t) => {
|
|
14
14
|
if (!t || typeof t == "string")
|
|
15
15
|
return;
|
|
16
16
|
const e = {};
|
|
@@ -21,14 +21,14 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
21
21
|
[r]: t[r]
|
|
22
22
|
});
|
|
23
23
|
}), e;
|
|
24
|
-
},
|
|
24
|
+
}, D = (t) => {
|
|
25
25
|
if (!t) return;
|
|
26
|
-
const e =
|
|
26
|
+
const e = _("APP_TAGSAMURAI_API");
|
|
27
27
|
return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
|
|
28
28
|
}, i = n({
|
|
29
29
|
prefix: "/settings-attribute/v2",
|
|
30
30
|
env: "APP_TAGSAMURAI_API"
|
|
31
|
-
}),
|
|
31
|
+
}), C = {
|
|
32
32
|
getGroupCategory: (t, e) => {
|
|
33
33
|
const r = t === "category" ? t : "groups";
|
|
34
34
|
return i.get(`/${r}/tree`, { params: e });
|
|
@@ -55,15 +55,15 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
55
55
|
const a = t === "category" ? t : "groups";
|
|
56
56
|
return i.delete(`/${a}/${r}`, { data: e });
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, T = n({
|
|
59
59
|
prefix: "/v2",
|
|
60
60
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
61
|
-
}),
|
|
62
|
-
getTotalApprovals: () =>
|
|
61
|
+
}), N = {
|
|
62
|
+
getTotalApprovals: () => T.get("/approval/count")
|
|
63
63
|
}, g = n({
|
|
64
64
|
prefix: "/v2",
|
|
65
65
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
66
|
-
}),
|
|
66
|
+
}), G = {
|
|
67
67
|
getActionLog: (t) => g.get("/change-log", { params: t }),
|
|
68
68
|
getActionLogOption: (t) => g.get("/change-log/options", { params: t }),
|
|
69
69
|
getSessionLogList: (t) => g.get("/session-log", { params: t }),
|
|
@@ -88,33 +88,33 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
88
88
|
};
|
|
89
89
|
return o.get("/by-id", { params: r });
|
|
90
90
|
}
|
|
91
|
-
},
|
|
91
|
+
}, y = n({
|
|
92
92
|
prefix: "/tracking/v2/missing"
|
|
93
|
-
}),
|
|
93
|
+
}), b = {
|
|
94
94
|
putFoundAsset: (t, e) => {
|
|
95
95
|
const r = { ids: [t], serialNumber: e };
|
|
96
|
-
return
|
|
96
|
+
return y.put("/found", r);
|
|
97
97
|
}
|
|
98
|
-
},
|
|
98
|
+
}, P = n({
|
|
99
99
|
prefix: "/v2/notification",
|
|
100
100
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
101
101
|
}), E = {
|
|
102
|
-
getNotifications: (t) =>
|
|
103
|
-
readNotification: (t) =>
|
|
104
|
-
},
|
|
102
|
+
getNotifications: (t) => P.get("/", { params: t }),
|
|
103
|
+
readNotification: (t) => P.put(`/${t}`)
|
|
104
|
+
}, L = n({
|
|
105
105
|
prefix: "/v2/session-log",
|
|
106
106
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
107
|
-
}),
|
|
108
|
-
postLogout: () =>
|
|
107
|
+
}), x = {
|
|
108
|
+
postLogout: () => L.post("/logout")
|
|
109
109
|
}, c = n({
|
|
110
110
|
prefix: "/tag/v2"
|
|
111
|
-
}),
|
|
111
|
+
}), w = {
|
|
112
112
|
getScanQR: (t) => c.get("/qr", { params: { tag: t } }),
|
|
113
113
|
getScanRFID: (t) => c.get("/rfid", { params: { tag: t } }),
|
|
114
114
|
getRFIDQRTAG: (t) => c.get("/rfid-qr/scan", { params: t })
|
|
115
|
-
},
|
|
115
|
+
}, O = n({
|
|
116
116
|
prefix: "/tracking/v2/tracking"
|
|
117
|
-
}),
|
|
117
|
+
}), k = {
|
|
118
118
|
putFoundAsset: (t, e, r) => {
|
|
119
119
|
const a = {
|
|
120
120
|
tag: t,
|
|
@@ -122,11 +122,11 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
122
122
|
serialNumber: r,
|
|
123
123
|
type: "Global"
|
|
124
124
|
};
|
|
125
|
-
return
|
|
125
|
+
return O.put("/found", { params: a });
|
|
126
126
|
}
|
|
127
127
|
}, s = n({
|
|
128
128
|
prefix: "/settings-user-role/v2"
|
|
129
|
-
}),
|
|
129
|
+
}), F = {
|
|
130
130
|
reLogin: (t) => s.post("/auth/login", t),
|
|
131
131
|
changePassword: (t) => s.put("/users/change-password", t),
|
|
132
132
|
getUserDetail: (t) => s.get(`/users/${t}`),
|
|
@@ -164,7 +164,7 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
164
164
|
}, u = n({
|
|
165
165
|
env: "APP_ADMIN_API",
|
|
166
166
|
prefix: "/settings-attribute/languages"
|
|
167
|
-
}),
|
|
167
|
+
}), M = {
|
|
168
168
|
/**
|
|
169
169
|
* Fetch all translation messages for a specific locale.
|
|
170
170
|
* @param locale The locale code (e.g., 'en', 'id').
|
|
@@ -207,26 +207,39 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
207
207
|
});
|
|
208
208
|
return r.data.translations[t];
|
|
209
209
|
}
|
|
210
|
-
},
|
|
210
|
+
}, d = n({
|
|
211
211
|
prefix: "/dashboard/v2/dashboard"
|
|
212
|
-
}),
|
|
213
|
-
getLatestTask: (t) =>
|
|
214
|
-
getSummary: (t) =>
|
|
212
|
+
}), V = {
|
|
213
|
+
getLatestTask: (t) => d.get("/latest-task", { params: t }),
|
|
214
|
+
getSummary: (t) => d.get("/summary", { params: t })
|
|
215
|
+
}, p = n({
|
|
216
|
+
prefix: "/alias-code/api/alias-code"
|
|
217
|
+
}), B = {
|
|
218
|
+
getAliasCode: () => p.get("/"),
|
|
219
|
+
postAliasCode: (t) => p.post("/", t),
|
|
220
|
+
getAliasCodeList: (t) => p.get(`/${t.object}/code-list`, { params: t })
|
|
221
|
+
}, I = n({
|
|
222
|
+
prefix: "/settings-attribute/v2/general-settings"
|
|
223
|
+
}), j = {
|
|
224
|
+
getGeneralSettings: () => I.get("/"),
|
|
225
|
+
putUpdateGeneralSettings: (t) => I.put("/", t)
|
|
215
226
|
};
|
|
216
227
|
export {
|
|
228
|
+
B as AliasCodeServices,
|
|
217
229
|
R as AssetServices,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
230
|
+
G as ChangelogServices,
|
|
231
|
+
V as DashboardServices,
|
|
232
|
+
j as GeneralSettingsServices,
|
|
233
|
+
C as GroupCategoryServices,
|
|
234
|
+
M as I18nService,
|
|
235
|
+
b as MissingServices,
|
|
236
|
+
N as NotificationApprovalServices,
|
|
224
237
|
E as NotificationServices,
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
238
|
+
x as SessionLogServices,
|
|
239
|
+
w as TAGServices,
|
|
240
|
+
k as TrackingServices,
|
|
241
|
+
F as UserServices,
|
|
242
|
+
_ as getBaseURL,
|
|
243
|
+
D as getImageURL,
|
|
244
|
+
h as queryParamsStringfy
|
|
232
245
|
};
|
package/api-services.system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["axios"],function(
|
|
1
|
+
System.register(["axios"],function(r,h){"use strict";var d;return{setters:[l=>{d=l.default}],execute:function(){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"},P=r("getBaseURL",(e="APP_API")=>l["VITE_"+e]),o=(e={},t=!1)=>{const{env:s="APP_API",prefix:a="",headers:f={},...L}=e,O=`${P(s)}${a}`,_=JSON.parse(localStorage.getItem("user")??"{}"),U=_.jwt??_.token??"";return d.create({...L,baseURL:O,headers:t?f:{"Content-Type":"application/json",Authorization:`Bearer ${U}`,...f}})},C=r("queryParamsStringfy",e=>{if(!e||typeof e=="string")return;const t={};return Object.keys(e).forEach(s=>{Array.isArray(e[s])?e[s].length>0&&Object.assign(t,{[s]:JSON.stringify(e[s])}):e[s]!==void 0&&Object.assign(t,{[s]:e[s]})}),t}),D=r("getImageURL",e=>{if(!e)return;const t=P("APP_TAGSAMURAI_API");return e.startsWith("http")?e:`${t}/file-manager/v2/files/${e}`}),g=o({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),G=r("GroupCategoryServices",{getGroupCategory:(e,t)=>{const s=e==="category"?e:"groups";return g.get(`/${s}/tree`,{params:t})},getGroupCategoryList:(e,t,s)=>{const a=e==="category"?e:"groups";return g.get(`/${a}/${t}`,{params:s})},getNames:e=>{const t=e==="category"?e:"groups";return g.get(`/${t}/names`)},postCreateGroupCategory:(e,t)=>{const s=e==="category"?e:"groups";return g.post(`/${s}`,t)},putEditGroupCategory:(e,t,s)=>{const a=e==="category"?e:"groups";return g.put(`/${a}/${s}`,t)},putMoveGroup:(e,t)=>g.put(`/groups/${t}/move-group`,e),putEditBulkGroups:async e=>g.put("/groups/bulk",e),deleteGroupCategory:(e,t,s)=>{const a=e==="category"?e:"groups";return g.delete(`/${a}/${s}`,{data:t})}}),m=o({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),N=r("NotificationApprovalServices",{getTotalApprovals:()=>m.get("/approval/count")}),u=o({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),R=r("ChangelogServices",{getActionLog:e=>u.get("/change-log",{params:e}),getActionLogOption:e=>u.get("/change-log/options",{params:e}),getSessionLogList:e=>u.get("/session-log",{params:e}),getUserDetailSystemLogList:e=>u.get("/change-log",{params:e}),getUserDetailSystemLogOption:e=>u.get("/change-log/options",{params:e})}),i=o({prefix:"/assets/v2/assets"}),b=r("AssetServices",{getScanTag:e=>i.get("/scan",{params:{tag:e}}),getAllAssets:e=>i.get("/",{params:e}),getAvailableAssets:e=>i.get("/available",{params:e}),scanAsset:e=>i.get("",{params:{tag:e}}),getAssetsById:(e,t)=>i.get("/by-id",{params:{_id:e,...t}}),getOptions:(e,t)=>i.get(e?`/${e}/options`:"/options",{params:t}),getUnlinkedAssets:e=>i.get("/unlinked",{params:e}),getAssetDetail:(e,t)=>i.get(`/${e}`,{params:t}),getLinkedAssetFamily:e=>i.get("/family",{params:{id:e}}),matchAssetWithTag:(e,t)=>{const s={_id:JSON.stringify([e]),tag:t};return i.get("/by-id",{params:s})}}),$=o({prefix:"/tracking/v2/missing"}),E=r("MissingServices",{putFoundAsset:(e,t)=>{const s={ids:[e],serialNumber:t};return $.put("/found",s)}}),S=o({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),w=r("NotificationServices",{getNotifications:e=>S.get("/",{params:e}),readNotification:e=>S.put(`/${e}`)}),T=o({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),k=r("SessionLogServices",{postLogout:()=>T.post("/logout")}),p=o({prefix:"/tag/v2"}),F=r("TAGServices",{getScanQR:e=>p.get("/qr",{params:{tag:e}}),getScanRFID:e=>p.get("/rfid",{params:{tag:e}}),getRFIDQRTAG:e=>p.get("/rfid-qr/scan",{params:e})}),y=o({prefix:"/tracking/v2/tracking"}),M=r("TrackingServices",{putFoundAsset:(e,t,s)=>{const a={tag:e,group:t,serialNumber:s,type:"Global"};return y.put("/found",{params:a})}}),n=o({prefix:"/settings-user-role/v2"}),V=r("UserServices",{reLogin:e=>n.post("/auth/login",e),changePassword:e=>n.put("/users/change-password",e),getUserDetail:e=>n.get(`/users/${e}`),putEditUser:(e,t)=>{const s={"Content-Type":"multipart/form-data"};return n.put(`/users/${e}`,t,{headers:s})},putDeleteProfilePicture:e=>n.put(`/users/${e}/delete-profile-picture`),putCancelEmailChange:(e,t)=>n.put("/auth/confirm-email-change/cancel",{user:e,companyCode:t}),getUserDetailSystemRoles:(e,t,s)=>n.get(`/user-detail/${e}/system-roles`,{params:{...s,type:t}}),getUserDetailSystemRoleList:(e,t)=>n.get(`/user-detail/${e}/system-role-list`,{params:t}),getUserDetailSystemRoleOptions:(e,t)=>n.get(`/user-detail/${e}/system-role/option`,{params:t}),getUserDetailTransactionRoleList:(e,t)=>n.get(`/user-detail/${e}/transaction-role-list`,{params:t}),getUserDetailUserLogBorrowingList:(e,t)=>n.get(`/users-log/${e}/borrowing`,{params:t}),getUserDetailUserLogAssignmentList:(e,t)=>n.get(`/users-log/${e}/assignment`,{params:t}),getUserDetailUserLogBorrowingOption:(e,t)=>n.get(`/users-log/${e}/borrowing/option`,{params:t}),getUserDetailUserLogAssignmentOption:(e,t)=>n.get(`/users-log/${e}/assignment/option`,{params:t}),getUserDetailTransactionAdminLogList:(e,t)=>n.get(`/users-log/${e}/transaction-log`,{params:t}),getUserDetailTransactionAdminLogOption:(e,t)=>n.get(`/users-log/${e}/transaction-log/option`,{params:t})}),c=o({env:"APP_ADMIN_API",prefix:"/settings-attribute/languages"}),B=r("I18nService",{getMessages:e=>c.get(`/${e}/translations`),getLanguageOptions:async()=>{const{data:e}=await c.get("/dropdown");return e.data},getLanguageOptionMeta:async e=>{const{data:t}=await c.get("/dropdown/"+e);return t.data},translateText:async(e,t)=>{const{data:s}=await c.post("/translate",{q:e,target:t});return s.data.translations[e]}}),I=o({prefix:"/dashboard/v2/dashboard"}),j=r("DashboardServices",{getLatestTask:e=>I.get("/latest-task",{params:e}),getSummary:e=>I.get("/summary",{params:e})}),A=o({prefix:"/alias-code/api/alias-code"}),q=r("AliasCodeServices",{getAliasCode:()=>A.get("/"),postAliasCode:e=>A.post("/",e),getAliasCodeList:e=>A.get(`/${e.object}/code-list`,{params:e})}),v=o({prefix:"/settings-attribute/v2/general-settings"}),J=r("GeneralSettingsServices",{getGeneralSettings:()=>v.get("/"),putUpdateGeneralSettings:e=>v.put("/",e)})}}});
|
package/main.d.ts
CHANGED
|
@@ -11,3 +11,5 @@ 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
13
|
export { default as DashboardServices } from './src/services/oldDashboard.service';
|
|
14
|
+
export { default as AliasCodeServices } from './src/services/oldAliasCode.service';
|
|
15
|
+
export { default as GeneralSettingsServices } from './src/services/oldGeneralSettings.service';
|
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { FetchDetailResponse, FetchListResponse } from '../types/fetchResponse.type';
|
|
3
|
+
import { AliasCodeData, AliasCodeListDatum } from '../types/aliasCode.type';
|
|
4
|
+
import { AliasCodeParams } from '../dto/aliasCode.dto';
|
|
5
|
+
declare const AliasCodeServices: {
|
|
6
|
+
getAliasCode: () => Promise<AxiosResponse<FetchDetailResponse<AliasCodeData>>>;
|
|
7
|
+
postAliasCode: (data: AliasCodeData) => Promise<AxiosResponse>;
|
|
8
|
+
getAliasCodeList: (params: AliasCodeParams) => Promise<AxiosResponse<FetchListResponse<AliasCodeListDatum>>>;
|
|
9
|
+
};
|
|
10
|
+
export default AliasCodeServices;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AliasCodeData {
|
|
2
|
+
isActive: boolean;
|
|
3
|
+
companyInitial: string;
|
|
4
|
+
separator: string;
|
|
5
|
+
data: AliasCodeDatum[];
|
|
6
|
+
}
|
|
7
|
+
export interface AliasCodeDatum {
|
|
8
|
+
name: string;
|
|
9
|
+
isChecked: boolean;
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AliasCodeListDatum {
|
|
13
|
+
_id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
code?: string;
|
|
16
|
+
}
|