@tagsamurai/fats-api-services 1.0.0-alpha.23 → 1.0.0-alpha.25
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 +127 -104
- package/api-services.system.js +1 -1
- package/main.d.ts +3 -0
- package/package.json +1 -1
- package/src/dto/aliasCode.dto.d.ts +4 -0
- package/src/dto/customField.dto.d.ts +16 -0
- package/src/services/oldAliasCode.service.d.ts +10 -0
- package/src/services/oldCustomField.service.d.ts +16 -0
- package/src/services/oldGeneralSettings.service.d.ts +6 -0
- package/src/types/aliasCode.type.d.ts +16 -0
- package/src/types/customField.type.d.ts +43 -0
package/api-services.es.js
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const { env:
|
|
4
|
-
return
|
|
5
|
-
...
|
|
1
|
+
import $ from "axios";
|
|
2
|
+
const T = { 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" }, m = (t = "APP_API") => T["VITE_" + t], n = (t = {}, e = !1) => {
|
|
3
|
+
const { env: s = "APP_API", prefix: a = "", headers: A = {}, ...v } = t, _ = `${m(s)}${a}`, d = JSON.parse(localStorage.getItem("user") ?? "{}"), f = d.jwt ?? d.token ?? "";
|
|
4
|
+
return $.create({
|
|
5
|
+
...v,
|
|
6
6
|
baseURL: _,
|
|
7
|
-
headers: e ?
|
|
7
|
+
headers: e ? A : {
|
|
8
8
|
"Content-Type": "application/json",
|
|
9
9
|
Authorization: `Bearer ${f}`,
|
|
10
|
-
...
|
|
10
|
+
...A
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
},
|
|
13
|
+
}, C = (t) => {
|
|
14
14
|
if (!t || typeof t == "string")
|
|
15
15
|
return;
|
|
16
16
|
const e = {};
|
|
17
|
-
return Object.keys(t).forEach((
|
|
18
|
-
Array.isArray(t[
|
|
19
|
-
[
|
|
20
|
-
}) : t[
|
|
21
|
-
[
|
|
17
|
+
return Object.keys(t).forEach((s) => {
|
|
18
|
+
Array.isArray(t[s]) ? t[s].length > 0 && Object.assign(e, {
|
|
19
|
+
[s]: JSON.stringify(t[s])
|
|
20
|
+
}) : t[s] !== void 0 && Object.assign(e, {
|
|
21
|
+
[s]: t[s]
|
|
22
22
|
});
|
|
23
23
|
}), e;
|
|
24
|
-
},
|
|
24
|
+
}, D = (t) => {
|
|
25
25
|
if (!t) return;
|
|
26
|
-
const e =
|
|
26
|
+
const e = m("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
|
+
}), b = {
|
|
32
32
|
getGroupCategory: (t, e) => {
|
|
33
|
-
const
|
|
34
|
-
return i.get(`/${
|
|
33
|
+
const s = t === "category" ? t : "groups";
|
|
34
|
+
return i.get(`/${s}/tree`, { params: e });
|
|
35
35
|
},
|
|
36
|
-
getGroupCategoryList: (t, e,
|
|
36
|
+
getGroupCategoryList: (t, e, s) => {
|
|
37
37
|
const a = t === "category" ? t : "groups";
|
|
38
|
-
return i.get(`/${a}/${e}`, { params:
|
|
38
|
+
return i.get(`/${a}/${e}`, { params: s });
|
|
39
39
|
},
|
|
40
40
|
getNames: (t) => {
|
|
41
41
|
const e = t === "category" ? t : "groups";
|
|
42
42
|
return i.get(`/${e}/names`);
|
|
43
43
|
},
|
|
44
44
|
postCreateGroupCategory: (t, e) => {
|
|
45
|
-
const
|
|
46
|
-
return i.post(`/${
|
|
45
|
+
const s = t === "category" ? t : "groups";
|
|
46
|
+
return i.post(`/${s}`, e);
|
|
47
47
|
},
|
|
48
|
-
putEditGroupCategory: (t, e,
|
|
48
|
+
putEditGroupCategory: (t, e, s) => {
|
|
49
49
|
const a = t === "category" ? t : "groups";
|
|
50
|
-
return i.put(`/${a}/${
|
|
50
|
+
return i.put(`/${a}/${s}`, e);
|
|
51
51
|
},
|
|
52
52
|
putMoveGroup: (t, e) => i.put(`/groups/${e}/move-group`, t),
|
|
53
53
|
putEditBulkGroups: async (t) => i.put("/groups/bulk", t),
|
|
54
|
-
deleteGroupCategory: (t, e,
|
|
54
|
+
deleteGroupCategory: (t, e, s) => {
|
|
55
55
|
const a = t === "category" ? t : "groups";
|
|
56
|
-
return i.delete(`/${a}/${
|
|
56
|
+
return i.delete(`/${a}/${s}`, { data: e });
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, y = n({
|
|
59
59
|
prefix: "/v2",
|
|
60
60
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
61
|
-
}),
|
|
62
|
-
getTotalApprovals: () =>
|
|
63
|
-
},
|
|
61
|
+
}), N = {
|
|
62
|
+
getTotalApprovals: () => y.get("/approval/count")
|
|
63
|
+
}, u = n({
|
|
64
64
|
prefix: "/v2",
|
|
65
65
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
66
|
-
}),
|
|
67
|
-
getActionLog: (t) =>
|
|
68
|
-
getActionLogOption: (t) =>
|
|
69
|
-
getSessionLogList: (t) =>
|
|
70
|
-
getUserDetailSystemLogList: (t) =>
|
|
71
|
-
getUserDetailSystemLogOption: (t) =>
|
|
66
|
+
}), G = {
|
|
67
|
+
getActionLog: (t) => u.get("/change-log", { params: t }),
|
|
68
|
+
getActionLogOption: (t) => u.get("/change-log/options", { params: t }),
|
|
69
|
+
getSessionLogList: (t) => u.get("/session-log", { params: t }),
|
|
70
|
+
getUserDetailSystemLogList: (t) => u.get("/change-log", { params: t }),
|
|
71
|
+
getUserDetailSystemLogOption: (t) => u.get("/change-log/options", { params: t })
|
|
72
72
|
}, o = n({
|
|
73
73
|
prefix: "/assets/v2/assets"
|
|
74
74
|
}), R = {
|
|
@@ -82,60 +82,60 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
82
82
|
getAssetDetail: (t, e) => o.get(`/${t}`, { params: e }),
|
|
83
83
|
getLinkedAssetFamily: (t) => o.get("/family", { params: { id: t } }),
|
|
84
84
|
matchAssetWithTag: (t, e) => {
|
|
85
|
-
const
|
|
85
|
+
const s = {
|
|
86
86
|
_id: JSON.stringify([t]),
|
|
87
87
|
tag: e
|
|
88
88
|
};
|
|
89
|
-
return o.get("/by-id", { params:
|
|
89
|
+
return o.get("/by-id", { params: s });
|
|
90
90
|
}
|
|
91
|
-
},
|
|
91
|
+
}, L = n({
|
|
92
92
|
prefix: "/tracking/v2/missing"
|
|
93
|
-
}),
|
|
93
|
+
}), E = {
|
|
94
94
|
putFoundAsset: (t, e) => {
|
|
95
|
-
const
|
|
96
|
-
return
|
|
95
|
+
const s = { ids: [t], serialNumber: e };
|
|
96
|
+
return L.put("/found", s);
|
|
97
97
|
}
|
|
98
|
-
},
|
|
98
|
+
}, P = n({
|
|
99
99
|
prefix: "/v2/notification",
|
|
100
100
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
101
|
-
}),
|
|
102
|
-
getNotifications: (t) =>
|
|
103
|
-
readNotification: (t) =>
|
|
104
|
-
},
|
|
101
|
+
}), x = {
|
|
102
|
+
getNotifications: (t) => P.get("/", { params: t }),
|
|
103
|
+
readNotification: (t) => P.put(`/${t}`)
|
|
104
|
+
}, O = n({
|
|
105
105
|
prefix: "/v2/session-log",
|
|
106
106
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
107
|
-
}),
|
|
108
|
-
postLogout: () =>
|
|
109
|
-
},
|
|
107
|
+
}), F = {
|
|
108
|
+
postLogout: () => O.post("/logout")
|
|
109
|
+
}, p = n({
|
|
110
110
|
prefix: "/tag/v2"
|
|
111
|
-
}),
|
|
112
|
-
getScanQR: (t) =>
|
|
113
|
-
getScanRFID: (t) =>
|
|
114
|
-
getRFIDQRTAG: (t) =>
|
|
115
|
-
},
|
|
111
|
+
}), k = {
|
|
112
|
+
getScanQR: (t) => p.get("/qr", { params: { tag: t } }),
|
|
113
|
+
getScanRFID: (t) => p.get("/rfid", { params: { tag: t } }),
|
|
114
|
+
getRFIDQRTAG: (t) => p.get("/rfid-qr/scan", { params: t })
|
|
115
|
+
}, U = n({
|
|
116
116
|
prefix: "/tracking/v2/tracking"
|
|
117
|
-
}),
|
|
118
|
-
putFoundAsset: (t, e,
|
|
117
|
+
}), w = {
|
|
118
|
+
putFoundAsset: (t, e, s) => {
|
|
119
119
|
const a = {
|
|
120
120
|
tag: t,
|
|
121
121
|
group: e,
|
|
122
|
-
serialNumber:
|
|
122
|
+
serialNumber: s,
|
|
123
123
|
type: "Global"
|
|
124
124
|
};
|
|
125
|
-
return
|
|
125
|
+
return U.put("/found", { params: a });
|
|
126
126
|
}
|
|
127
|
-
},
|
|
127
|
+
}, r = n({
|
|
128
128
|
prefix: "/settings-user-role/v2"
|
|
129
|
-
}),
|
|
130
|
-
reLogin: (t) =>
|
|
131
|
-
changePassword: (t) =>
|
|
132
|
-
getUserDetail: (t) =>
|
|
129
|
+
}), M = {
|
|
130
|
+
reLogin: (t) => r.post("/auth/login", t),
|
|
131
|
+
changePassword: (t) => r.put("/users/change-password", t),
|
|
132
|
+
getUserDetail: (t) => r.get(`/users/${t}`),
|
|
133
133
|
putEditUser: (t, e) => {
|
|
134
|
-
const
|
|
135
|
-
return
|
|
134
|
+
const s = { "Content-Type": "multipart/form-data" };
|
|
135
|
+
return r.put(`/users/${t}`, e, { headers: s });
|
|
136
136
|
},
|
|
137
|
-
putDeleteProfilePicture: (t) =>
|
|
138
|
-
putCancelEmailChange: (t, e) =>
|
|
137
|
+
putDeleteProfilePicture: (t) => r.put(`/users/${t}/delete-profile-picture`),
|
|
138
|
+
putCancelEmailChange: (t, e) => r.put("/auth/confirm-email-change/cancel", {
|
|
139
139
|
user: t,
|
|
140
140
|
companyCode: e
|
|
141
141
|
}),
|
|
@@ -145,39 +145,39 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
145
145
|
* @param type {"Global" | "Group"} Whether the system role's type is global or group
|
|
146
146
|
* @param params {Record<string, unknown>}
|
|
147
147
|
*/
|
|
148
|
-
getUserDetailSystemRoles: (t, e,
|
|
148
|
+
getUserDetailSystemRoles: (t, e, s) => r.get(`/user-detail/${t}/system-roles`, {
|
|
149
149
|
params: {
|
|
150
|
-
...
|
|
150
|
+
...s,
|
|
151
151
|
type: e
|
|
152
152
|
}
|
|
153
153
|
}),
|
|
154
154
|
// User Detail
|
|
155
|
-
getUserDetailSystemRoleList: (t, e) =>
|
|
156
|
-
getUserDetailSystemRoleOptions: (t, e) =>
|
|
157
|
-
getUserDetailTransactionRoleList: (t, e) =>
|
|
158
|
-
getUserDetailUserLogBorrowingList: (t, e) =>
|
|
159
|
-
getUserDetailUserLogAssignmentList: (t, e) =>
|
|
160
|
-
getUserDetailUserLogBorrowingOption: (t, e) =>
|
|
161
|
-
getUserDetailUserLogAssignmentOption: (t, e) =>
|
|
162
|
-
getUserDetailTransactionAdminLogList: (t, e) =>
|
|
163
|
-
getUserDetailTransactionAdminLogOption: (t, e) =>
|
|
164
|
-
},
|
|
155
|
+
getUserDetailSystemRoleList: (t, e) => r.get(`/user-detail/${t}/system-role-list`, { params: e }),
|
|
156
|
+
getUserDetailSystemRoleOptions: (t, e) => r.get(`/user-detail/${t}/system-role/option`, { params: e }),
|
|
157
|
+
getUserDetailTransactionRoleList: (t, e) => r.get(`/user-detail/${t}/transaction-role-list`, { params: e }),
|
|
158
|
+
getUserDetailUserLogBorrowingList: (t, e) => r.get(`/users-log/${t}/borrowing`, { params: e }),
|
|
159
|
+
getUserDetailUserLogAssignmentList: (t, e) => r.get(`/users-log/${t}/assignment`, { params: e }),
|
|
160
|
+
getUserDetailUserLogBorrowingOption: (t, e) => r.get(`/users-log/${t}/borrowing/option`, { params: e }),
|
|
161
|
+
getUserDetailUserLogAssignmentOption: (t, e) => r.get(`/users-log/${t}/assignment/option`, { params: e }),
|
|
162
|
+
getUserDetailTransactionAdminLogList: (t, e) => r.get(`/users-log/${t}/transaction-log`, { params: e }),
|
|
163
|
+
getUserDetailTransactionAdminLogOption: (t, e) => r.get(`/users-log/${t}/transaction-log/option`, { params: e })
|
|
164
|
+
}, c = n({
|
|
165
165
|
env: "APP_ADMIN_API",
|
|
166
166
|
prefix: "/settings-attribute/languages"
|
|
167
|
-
}),
|
|
167
|
+
}), V = {
|
|
168
168
|
/**
|
|
169
169
|
* Fetch all translation messages for a specific locale.
|
|
170
170
|
* @param locale The locale code (e.g., 'en', 'id').
|
|
171
171
|
* @returns A promise resolving to a key-value record of messages.
|
|
172
172
|
*/
|
|
173
|
-
getMessages: (t) =>
|
|
173
|
+
getMessages: (t) => c.get(`/${t}/translations`),
|
|
174
174
|
/**
|
|
175
175
|
* Fetch all available lang options for LanguageDropdown and LanguageSwitcher
|
|
176
176
|
*
|
|
177
177
|
* @returns Promise Array of options
|
|
178
178
|
*/
|
|
179
179
|
getLanguageOptions: async () => {
|
|
180
|
-
const { data: t } = await
|
|
180
|
+
const { data: t } = await c.get(
|
|
181
181
|
"/dropdown"
|
|
182
182
|
);
|
|
183
183
|
return t.data;
|
|
@@ -189,7 +189,7 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
189
189
|
* @returns Promise LanguageMeta
|
|
190
190
|
*/
|
|
191
191
|
getLanguageOptionMeta: async (t) => {
|
|
192
|
-
const { data: e } = await
|
|
192
|
+
const { data: e } = await c.get(
|
|
193
193
|
"/dropdown/" + t
|
|
194
194
|
);
|
|
195
195
|
return e.data;
|
|
@@ -201,32 +201,55 @@ const v = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
201
201
|
* @param locale Target locale code.
|
|
202
202
|
*/
|
|
203
203
|
translateText: async (t, e) => {
|
|
204
|
-
const { data:
|
|
204
|
+
const { data: s } = await c.post("/translate", {
|
|
205
205
|
q: t,
|
|
206
206
|
target: e
|
|
207
207
|
});
|
|
208
|
-
return
|
|
208
|
+
return s.data.translations[t];
|
|
209
209
|
}
|
|
210
|
-
},
|
|
210
|
+
}, I = n({
|
|
211
211
|
prefix: "/dashboard/v2/dashboard"
|
|
212
|
-
}),
|
|
213
|
-
getLatestTask: (t) =>
|
|
214
|
-
getSummary: (t) =>
|
|
212
|
+
}), B = {
|
|
213
|
+
getLatestTask: (t) => I.get("/latest-task", { params: t }),
|
|
214
|
+
getSummary: (t) => I.get("/summary", { params: t })
|
|
215
|
+
}, l = n({
|
|
216
|
+
prefix: "/alias-code/api/alias-code"
|
|
217
|
+
}), j = {
|
|
218
|
+
getAliasCode: () => l.get("/"),
|
|
219
|
+
postAliasCode: (t) => l.post("/", t),
|
|
220
|
+
getAliasCodeList: (t) => l.get(`/${t.object}/code-list`, { params: t })
|
|
221
|
+
}, S = n({
|
|
222
|
+
prefix: "/settings-attribute/v2/general-settings"
|
|
223
|
+
}), J = {
|
|
224
|
+
getGeneralSettings: () => S.get("/"),
|
|
225
|
+
putUpdateGeneralSettings: (t) => S.put("/", t)
|
|
226
|
+
}, g = n({
|
|
227
|
+
prefix: "/settings-attribute/v2/custom-field"
|
|
228
|
+
}), Y = {
|
|
229
|
+
getCustomField: async (t) => g.get("/", { params: t }),
|
|
230
|
+
getOptions: async (t) => g.get("/options", { params: t }),
|
|
231
|
+
postCreateCustomField: async (t, e) => g.post("/", e, { params: t }),
|
|
232
|
+
putEditCustomField: async (t, e, s) => g.put(`/${s}`, e, { params: t }),
|
|
233
|
+
putChangeStatus: async (t, e) => g.put("/bulk", e, { params: t }),
|
|
234
|
+
deleteCustomField: async (t) => g.delete("/bulk", { data: t })
|
|
215
235
|
};
|
|
216
236
|
export {
|
|
237
|
+
j as AliasCodeServices,
|
|
217
238
|
R as AssetServices,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
E as
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
239
|
+
G as ChangelogServices,
|
|
240
|
+
Y as CustomFieldServices,
|
|
241
|
+
B as DashboardServices,
|
|
242
|
+
J as GeneralSettingsServices,
|
|
243
|
+
b as GroupCategoryServices,
|
|
244
|
+
V as I18nService,
|
|
245
|
+
E as MissingServices,
|
|
246
|
+
N as NotificationApprovalServices,
|
|
247
|
+
x as NotificationServices,
|
|
248
|
+
F as SessionLogServices,
|
|
249
|
+
k as TAGServices,
|
|
250
|
+
w as TrackingServices,
|
|
251
|
+
M as UserServices,
|
|
252
|
+
m as getBaseURL,
|
|
253
|
+
D as getImageURL,
|
|
254
|
+
C as queryParamsStringfy
|
|
232
255
|
};
|
package/api-services.system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["axios"],function(
|
|
1
|
+
System.register(["axios"],function(r,h){"use strict";var S;return{setters:[p=>{S=p.default}],execute:function(){const p={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",(t="APP_API")=>p["VITE_"+t]),o=(t={},e=!1)=>{const{env:s="APP_API",prefix:a="",headers:m={},...O}=t,U=`${P(s)}${a}`,_=JSON.parse(localStorage.getItem("user")??"{}"),C=_.jwt??_.token??"";return S.create({...O,baseURL:U,headers:e?m:{"Content-Type":"application/json",Authorization:`Bearer ${C}`,...m}})},D=r("queryParamsStringfy",t=>{if(!t||typeof t=="string")return;const e={};return Object.keys(t).forEach(s=>{Array.isArray(t[s])?t[s].length>0&&Object.assign(e,{[s]:JSON.stringify(t[s])}):t[s]!==void 0&&Object.assign(e,{[s]:t[s]})}),e}),b=r("getImageURL",t=>{if(!t)return;const e=P("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),g=o({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),G=r("GroupCategoryServices",{getGroupCategory:(t,e)=>{const s=t==="category"?t:"groups";return g.get(`/${s}/tree`,{params:e})},getGroupCategoryList:(t,e,s)=>{const a=t==="category"?t:"groups";return g.get(`/${a}/${e}`,{params:s})},getNames:t=>{const e=t==="category"?t:"groups";return g.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const s=t==="category"?t:"groups";return g.post(`/${s}`,e)},putEditGroupCategory:(t,e,s)=>{const a=t==="category"?t:"groups";return g.put(`/${a}/${s}`,e)},putMoveGroup:(t,e)=>g.put(`/groups/${e}/move-group`,t),putEditBulkGroups:async t=>g.put("/groups/bulk",t),deleteGroupCategory:(t,e,s)=>{const a=t==="category"?t:"groups";return g.delete(`/${a}/${s}`,{data:e})}}),$=o({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),N=r("NotificationApprovalServices",{getTotalApprovals:()=>$.get("/approval/count")}),c=o({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),R=r("ChangelogServices",{getActionLog:t=>c.get("/change-log",{params:t}),getActionLogOption:t=>c.get("/change-log/options",{params:t}),getSessionLogList:t=>c.get("/session-log",{params:t}),getUserDetailSystemLogList:t=>c.get("/change-log",{params:t}),getUserDetailSystemLogOption:t=>c.get("/change-log/options",{params:t})}),i=o({prefix:"/assets/v2/assets"}),E=r("AssetServices",{getScanTag:t=>i.get("/scan",{params:{tag:t}}),getAllAssets:t=>i.get("/",{params:t}),getAvailableAssets:t=>i.get("/available",{params:t}),scanAsset:t=>i.get("",{params:{tag:t}}),getAssetsById:(t,e)=>i.get("/by-id",{params:{_id:t,...e}}),getOptions:(t,e)=>i.get(t?`/${t}/options`:"/options",{params:e}),getUnlinkedAssets:t=>i.get("/unlinked",{params:t}),getAssetDetail:(t,e)=>i.get(`/${t}`,{params:e}),getLinkedAssetFamily:t=>i.get("/family",{params:{id:t}}),matchAssetWithTag:(t,e)=>{const s={_id:JSON.stringify([t]),tag:e};return i.get("/by-id",{params:s})}}),y=o({prefix:"/tracking/v2/missing"}),F=r("MissingServices",{putFoundAsset:(t,e)=>{const s={ids:[t],serialNumber:e};return y.put("/found",s)}}),v=o({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),k=r("NotificationServices",{getNotifications:t=>v.get("/",{params:t}),readNotification:t=>v.put(`/${t}`)}),T=o({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),w=r("SessionLogServices",{postLogout:()=>T.post("/logout")}),A=o({prefix:"/tag/v2"}),M=r("TAGServices",{getScanQR:t=>A.get("/qr",{params:{tag:t}}),getScanRFID:t=>A.get("/rfid",{params:{tag:t}}),getRFIDQRTAG:t=>A.get("/rfid-qr/scan",{params:t})}),L=o({prefix:"/tracking/v2/tracking"}),V=r("TrackingServices",{putFoundAsset:(t,e,s)=>{const a={tag:t,group:e,serialNumber:s,type:"Global"};return L.put("/found",{params:a})}}),n=o({prefix:"/settings-user-role/v2"}),B=r("UserServices",{reLogin:t=>n.post("/auth/login",t),changePassword:t=>n.put("/users/change-password",t),getUserDetail:t=>n.get(`/users/${t}`),putEditUser:(t,e)=>{const s={"Content-Type":"multipart/form-data"};return n.put(`/users/${t}`,e,{headers:s})},putDeleteProfilePicture:t=>n.put(`/users/${t}/delete-profile-picture`),putCancelEmailChange:(t,e)=>n.put("/auth/confirm-email-change/cancel",{user:t,companyCode:e}),getUserDetailSystemRoles:(t,e,s)=>n.get(`/user-detail/${t}/system-roles`,{params:{...s,type:e}}),getUserDetailSystemRoleList:(t,e)=>n.get(`/user-detail/${t}/system-role-list`,{params:e}),getUserDetailSystemRoleOptions:(t,e)=>n.get(`/user-detail/${t}/system-role/option`,{params:e}),getUserDetailTransactionRoleList:(t,e)=>n.get(`/user-detail/${t}/transaction-role-list`,{params:e}),getUserDetailUserLogBorrowingList:(t,e)=>n.get(`/users-log/${t}/borrowing`,{params:e}),getUserDetailUserLogAssignmentList:(t,e)=>n.get(`/users-log/${t}/assignment`,{params:e}),getUserDetailUserLogBorrowingOption:(t,e)=>n.get(`/users-log/${t}/borrowing/option`,{params:e}),getUserDetailUserLogAssignmentOption:(t,e)=>n.get(`/users-log/${t}/assignment/option`,{params:e}),getUserDetailTransactionAdminLogList:(t,e)=>n.get(`/users-log/${t}/transaction-log`,{params:e}),getUserDetailTransactionAdminLogOption:(t,e)=>n.get(`/users-log/${t}/transaction-log/option`,{params:e})}),l=o({env:"APP_ADMIN_API",prefix:"/settings-attribute/languages"}),j=r("I18nService",{getMessages:t=>l.get(`/${t}/translations`),getLanguageOptions:async()=>{const{data:t}=await l.get("/dropdown");return t.data},getLanguageOptionMeta:async t=>{const{data:e}=await l.get("/dropdown/"+t);return e.data},translateText:async(t,e)=>{const{data:s}=await l.post("/translate",{q:t,target:e});return s.data.translations[t]}}),I=o({prefix:"/dashboard/v2/dashboard"}),q=r("DashboardServices",{getLatestTask:t=>I.get("/latest-task",{params:t}),getSummary:t=>I.get("/summary",{params:t})}),d=o({prefix:"/alias-code/api/alias-code"}),J=r("AliasCodeServices",{getAliasCode:()=>d.get("/"),postAliasCode:t=>d.post("/",t),getAliasCodeList:t=>d.get(`/${t.object}/code-list`,{params:t})}),f=o({prefix:"/settings-attribute/v2/general-settings"}),Y=r("GeneralSettingsServices",{getGeneralSettings:()=>f.get("/"),putUpdateGeneralSettings:t=>f.put("/",t)}),u=o({prefix:"/settings-attribute/v2/custom-field"}),x=r("CustomFieldServices",{getCustomField:async t=>u.get("/",{params:t}),getOptions:async t=>u.get("/options",{params:t}),postCreateCustomField:async(t,e)=>u.post("/",e,{params:t}),putEditCustomField:async(t,e,s)=>u.put(`/${s}`,e,{params:t}),putChangeStatus:async(t,e)=>u.put("/bulk",e,{params:t}),deleteCustomField:async t=>u.delete("/bulk",{data:t})})}}});
|
package/main.d.ts
CHANGED
|
@@ -11,3 +11,6 @@ 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';
|
|
16
|
+
export { default as CustomFieldServices } from './src/services/oldCustomField.service';
|
package/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CustomFieldParams } from '../types/customField.type';
|
|
2
|
+
import { QueryParams } from '../types/fetchResponse.type';
|
|
3
|
+
export interface CustomFieldFilterQuery extends QueryParams {
|
|
4
|
+
type?: string;
|
|
5
|
+
category?: string | number[];
|
|
6
|
+
valueOptions?: boolean;
|
|
7
|
+
dataTypeOptions?: boolean;
|
|
8
|
+
nameOptions?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type BodyFiltered = {
|
|
11
|
+
customFieldIds: string[];
|
|
12
|
+
status?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type CustomFieldQuery = {
|
|
15
|
+
type: CustomFieldParams;
|
|
16
|
+
};
|
|
@@ -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
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { BodyFiltered, CustomFieldFilterQuery, CustomFieldQuery } from '../dto/customField.dto';
|
|
3
|
+
import { CustomFieldData } from '../types/customField.type';
|
|
4
|
+
/**
|
|
5
|
+
* Object containing client services.
|
|
6
|
+
* getCustomField: Makes a GET request to the URL for a list of customField base on the type and returns the response.
|
|
7
|
+
*/
|
|
8
|
+
declare const CustomFieldServices: {
|
|
9
|
+
getCustomField: (params: CustomFieldFilterQuery) => Promise<AxiosResponse>;
|
|
10
|
+
getOptions: (params: CustomFieldFilterQuery) => Promise<AxiosResponse>;
|
|
11
|
+
postCreateCustomField: (params: CustomFieldQuery, data: CustomFieldData) => Promise<AxiosResponse>;
|
|
12
|
+
putEditCustomField: (params: CustomFieldQuery, data: CustomFieldData, id: CustomFieldData["_id"]) => Promise<AxiosResponse>;
|
|
13
|
+
putChangeStatus: (params: CustomFieldQuery, data: BodyFiltered) => Promise<AxiosResponse>;
|
|
14
|
+
deleteCustomField: (data: BodyFiltered) => Promise<AxiosResponse>;
|
|
15
|
+
};
|
|
16
|
+
export default CustomFieldServices;
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type CustomFieldData = {
|
|
2
|
+
_id?: string;
|
|
3
|
+
key?: number;
|
|
4
|
+
keys?: number[];
|
|
5
|
+
name?: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
dataType?: string;
|
|
8
|
+
isShowOnTable?: boolean;
|
|
9
|
+
isRequired?: boolean | string;
|
|
10
|
+
isRequiredString?: string;
|
|
11
|
+
optionValue?: string[] | null;
|
|
12
|
+
category?: [
|
|
13
|
+
{
|
|
14
|
+
name: string;
|
|
15
|
+
key: number;
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
categoryKeys?: number[];
|
|
19
|
+
status?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type CustomFieldFilter = {
|
|
22
|
+
status?: string[];
|
|
23
|
+
name?: string[];
|
|
24
|
+
dataType?: string[];
|
|
25
|
+
optionValue?: string[];
|
|
26
|
+
isRequired?: boolean[];
|
|
27
|
+
category?: number[];
|
|
28
|
+
};
|
|
29
|
+
export type CustomFieldType = {
|
|
30
|
+
_id?: string;
|
|
31
|
+
isActive: boolean;
|
|
32
|
+
fieldName: string;
|
|
33
|
+
dataType: string;
|
|
34
|
+
value?: string[];
|
|
35
|
+
required: boolean;
|
|
36
|
+
category: string[];
|
|
37
|
+
};
|
|
38
|
+
export type CustomFieldLoadingOptions = {
|
|
39
|
+
valueOptions: boolean;
|
|
40
|
+
dataTypeOptions: boolean;
|
|
41
|
+
nameOptions: boolean;
|
|
42
|
+
};
|
|
43
|
+
export type CustomFieldParams = 'General Information' | 'Purchase' | 'Accounting' | 'Maintenance Routine' | 'Audit';
|