@tagsamurai/fats-api-services 1.0.0-alpha.24 → 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.
@@ -1,74 +1,74 @@
1
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 ?? "";
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
4
  return $.create({
5
- ...S,
6
- baseURL: v,
7
- headers: e ? l : {
5
+ ...v,
6
+ baseURL: _,
7
+ headers: e ? A : {
8
8
  "Content-Type": "application/json",
9
9
  Authorization: `Bearer ${f}`,
10
- ...l
10
+ ...A
11
11
  }
12
12
  });
13
- }, h = (t) => {
13
+ }, C = (t) => {
14
14
  if (!t || typeof t == "string")
15
15
  return;
16
16
  const e = {};
17
- return Object.keys(t).forEach((r) => {
18
- Array.isArray(t[r]) ? t[r].length > 0 && Object.assign(e, {
19
- [r]: JSON.stringify(t[r])
20
- }) : t[r] !== void 0 && Object.assign(e, {
21
- [r]: t[r]
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 = _("APP_TAGSAMURAI_API");
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
- }), C = {
31
+ }), b = {
32
32
  getGroupCategory: (t, e) => {
33
- const r = t === "category" ? t : "groups";
34
- return i.get(`/${r}/tree`, { params: e });
33
+ const s = t === "category" ? t : "groups";
34
+ return i.get(`/${s}/tree`, { params: e });
35
35
  },
36
- getGroupCategoryList: (t, e, r) => {
36
+ getGroupCategoryList: (t, e, s) => {
37
37
  const a = t === "category" ? t : "groups";
38
- return i.get(`/${a}/${e}`, { params: r });
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 r = t === "category" ? t : "groups";
46
- return i.post(`/${r}`, e);
45
+ const s = t === "category" ? t : "groups";
46
+ return i.post(`/${s}`, e);
47
47
  },
48
- putEditGroupCategory: (t, e, r) => {
48
+ putEditGroupCategory: (t, e, s) => {
49
49
  const a = t === "category" ? t : "groups";
50
- return i.put(`/${a}/${r}`, e);
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, r) => {
54
+ deleteGroupCategory: (t, e, s) => {
55
55
  const a = t === "category" ? t : "groups";
56
- return i.delete(`/${a}/${r}`, { data: e });
56
+ return i.delete(`/${a}/${s}`, { data: e });
57
57
  }
58
- }, T = n({
58
+ }, y = n({
59
59
  prefix: "/v2",
60
60
  env: "APP_LOGS_NOTIFICATION_API"
61
61
  }), N = {
62
- getTotalApprovals: () => T.get("/approval/count")
63
- }, g = n({
62
+ getTotalApprovals: () => y.get("/approval/count")
63
+ }, u = n({
64
64
  prefix: "/v2",
65
65
  env: "APP_LOGS_NOTIFICATION_API"
66
66
  }), G = {
67
- getActionLog: (t) => g.get("/change-log", { params: t }),
68
- getActionLogOption: (t) => g.get("/change-log/options", { params: t }),
69
- getSessionLogList: (t) => g.get("/session-log", { params: t }),
70
- getUserDetailSystemLogList: (t) => g.get("/change-log", { params: t }),
71
- getUserDetailSystemLogOption: (t) => g.get("/change-log/options", { params: t })
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 m = { 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 r = {
85
+ const s = {
86
86
  _id: JSON.stringify([t]),
87
87
  tag: e
88
88
  };
89
- return o.get("/by-id", { params: r });
89
+ return o.get("/by-id", { params: s });
90
90
  }
91
- }, y = n({
91
+ }, L = n({
92
92
  prefix: "/tracking/v2/missing"
93
- }), b = {
93
+ }), E = {
94
94
  putFoundAsset: (t, e) => {
95
- const r = { ids: [t], serialNumber: e };
96
- return y.put("/found", r);
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
- }), E = {
101
+ }), x = {
102
102
  getNotifications: (t) => P.get("/", { params: t }),
103
103
  readNotification: (t) => P.put(`/${t}`)
104
- }, L = n({
104
+ }, O = n({
105
105
  prefix: "/v2/session-log",
106
106
  env: "APP_LOGS_NOTIFICATION_API"
107
- }), x = {
108
- postLogout: () => L.post("/logout")
109
- }, c = n({
107
+ }), F = {
108
+ postLogout: () => O.post("/logout")
109
+ }, p = n({
110
110
  prefix: "/tag/v2"
111
- }), w = {
112
- getScanQR: (t) => c.get("/qr", { params: { tag: t } }),
113
- getScanRFID: (t) => c.get("/rfid", { params: { tag: t } }),
114
- getRFIDQRTAG: (t) => c.get("/rfid-qr/scan", { params: t })
115
- }, O = n({
116
- prefix: "/tracking/v2/tracking"
117
111
  }), k = {
118
- putFoundAsset: (t, e, r) => {
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
+ prefix: "/tracking/v2/tracking"
117
+ }), w = {
118
+ putFoundAsset: (t, e, s) => {
119
119
  const a = {
120
120
  tag: t,
121
121
  group: e,
122
- serialNumber: r,
122
+ serialNumber: s,
123
123
  type: "Global"
124
124
  };
125
- return O.put("/found", { params: a });
125
+ return U.put("/found", { params: a });
126
126
  }
127
- }, s = n({
127
+ }, r = n({
128
128
  prefix: "/settings-user-role/v2"
129
- }), F = {
130
- reLogin: (t) => s.post("/auth/login", t),
131
- changePassword: (t) => s.put("/users/change-password", t),
132
- getUserDetail: (t) => s.get(`/users/${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 r = { "Content-Type": "multipart/form-data" };
135
- return s.put(`/users/${t}`, e, { headers: r });
134
+ const s = { "Content-Type": "multipart/form-data" };
135
+ return r.put(`/users/${t}`, e, { headers: s });
136
136
  },
137
- putDeleteProfilePicture: (t) => s.put(`/users/${t}/delete-profile-picture`),
138
- putCancelEmailChange: (t, e) => s.put("/auth/confirm-email-change/cancel", {
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 m = { 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, r) => s.get(`/user-detail/${t}/system-roles`, {
148
+ getUserDetailSystemRoles: (t, e, s) => r.get(`/user-detail/${t}/system-roles`, {
149
149
  params: {
150
- ...r,
150
+ ...s,
151
151
  type: e
152
152
  }
153
153
  }),
154
154
  // User Detail
155
- getUserDetailSystemRoleList: (t, e) => s.get(`/user-detail/${t}/system-role-list`, { params: e }),
156
- getUserDetailSystemRoleOptions: (t, e) => s.get(`/user-detail/${t}/system-role/option`, { params: e }),
157
- getUserDetailTransactionRoleList: (t, e) => s.get(`/user-detail/${t}/transaction-role-list`, { params: e }),
158
- getUserDetailUserLogBorrowingList: (t, e) => s.get(`/users-log/${t}/borrowing`, { params: e }),
159
- getUserDetailUserLogAssignmentList: (t, e) => s.get(`/users-log/${t}/assignment`, { params: e }),
160
- getUserDetailUserLogBorrowingOption: (t, e) => s.get(`/users-log/${t}/borrowing/option`, { params: e }),
161
- getUserDetailUserLogAssignmentOption: (t, e) => s.get(`/users-log/${t}/assignment/option`, { params: e }),
162
- getUserDetailTransactionAdminLogList: (t, e) => s.get(`/users-log/${t}/transaction-log`, { params: e }),
163
- getUserDetailTransactionAdminLogOption: (t, e) => s.get(`/users-log/${t}/transaction-log/option`, { params: e })
164
- }, u = n({
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
- }), M = {
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) => u.get(`/${t}/translations`),
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 u.get(
180
+ const { data: t } = await c.get(
181
181
  "/dropdown"
182
182
  );
183
183
  return t.data;
@@ -189,7 +189,7 @@ const m = { 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 u.get(
192
+ const { data: e } = await c.get(
193
193
  "/dropdown/" + t
194
194
  );
195
195
  return e.data;
@@ -201,45 +201,55 @@ const m = { 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: r } = await u.post("/translate", {
204
+ const { data: s } = await c.post("/translate", {
205
205
  q: t,
206
206
  target: e
207
207
  });
208
- return r.data.translations[t];
208
+ return s.data.translations[t];
209
209
  }
210
- }, d = n({
210
+ }, I = n({
211
211
  prefix: "/dashboard/v2/dashboard"
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
212
  }), 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"
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"
223
217
  }), j = {
224
- getGeneralSettings: () => I.get("/"),
225
- putUpdateGeneralSettings: (t) => I.put("/", t)
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 })
226
235
  };
227
236
  export {
228
- B as AliasCodeServices,
237
+ j as AliasCodeServices,
229
238
  R as AssetServices,
230
239
  G as ChangelogServices,
231
- V as DashboardServices,
232
- j as GeneralSettingsServices,
233
- C as GroupCategoryServices,
234
- M as I18nService,
235
- b as MissingServices,
240
+ Y as CustomFieldServices,
241
+ B as DashboardServices,
242
+ J as GeneralSettingsServices,
243
+ b as GroupCategoryServices,
244
+ V as I18nService,
245
+ E as MissingServices,
236
246
  N as NotificationApprovalServices,
237
- E as NotificationServices,
238
- x as SessionLogServices,
239
- w as TAGServices,
240
- k as TrackingServices,
241
- F as UserServices,
242
- _ as getBaseURL,
247
+ x as NotificationServices,
248
+ F as SessionLogServices,
249
+ k as TAGServices,
250
+ w as TrackingServices,
251
+ M as UserServices,
252
+ m as getBaseURL,
243
253
  D as getImageURL,
244
- h as queryParamsStringfy
254
+ C as queryParamsStringfy
245
255
  };
@@ -1 +1 @@
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)})}}});
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
@@ -13,3 +13,4 @@ export { default as I18nService } from './src/services/i18n.service';
13
13
  export { default as DashboardServices } from './src/services/oldDashboard.service';
14
14
  export { default as AliasCodeServices } from './src/services/oldAliasCode.service';
15
15
  export { default as GeneralSettingsServices } from './src/services/oldGeneralSettings.service';
16
+ export { default as CustomFieldServices } from './src/services/oldCustomField.service';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "1.0.0-alpha.24",
3
+ "version": "1.0.0-alpha.25",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Fixed Asset Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -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,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,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';