@tagsamurai/fats-api-services 1.0.0-alpha.35 → 1.0.0-alpha.37

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,164 +1,164 @@
1
1
  import T from "axios";
2
- const h = { 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" }, v = (e = "APP_API") => h["VITE_" + e], s = (e = {}, t = !1) => {
3
- const { env: r = "APP_API", prefix: o = "", headers: $ = {}, ...L } = e, O = `${v(r)}${o}`, f = JSON.parse(localStorage.getItem("user") ?? "{}"), U = f.jwt ?? f.token ?? "";
2
+ const D = { 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") => D["VITE_" + t], s = (t = {}, e = !1) => {
3
+ const { env: r = "APP_API", prefix: o = "", headers: P = {}, ...O } = t, U = `${$(r)}${o}`, y = JSON.parse(localStorage.getItem("user") ?? "{}"), h = y.jwt ?? y.token ?? "";
4
4
  return T.create({
5
- ...L,
6
- baseURL: O,
7
- headers: t ? $ : {
5
+ ...O,
6
+ baseURL: U,
7
+ headers: e ? P : {
8
8
  "Content-Type": "application/json",
9
- Authorization: `Bearer ${U}`,
10
- ...$
9
+ Authorization: `Bearer ${h}`,
10
+ ...P
11
11
  }
12
12
  });
13
- }, x = (e) => {
14
- if (!e || typeof e == "string")
13
+ }, R = (t) => {
14
+ if (!t || typeof t == "string")
15
15
  return;
16
- const t = {};
17
- return Object.keys(e).forEach((r) => {
18
- Array.isArray(e[r]) ? e[r].length > 0 && Object.assign(t, {
19
- [r]: JSON.stringify(e[r])
20
- }) : e[r] !== void 0 && Object.assign(t, {
21
- [r]: e[r]
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]
22
22
  });
23
- }), t;
24
- }, R = (e) => {
25
- if (!e) return;
26
- const t = v("APP_TAGSAMURAI_API");
27
- return e.startsWith("http") ? e : `${t}/file-manager/v2/files/${e}`;
23
+ }), e;
24
+ }, M = (t) => {
25
+ if (!t) return;
26
+ const e = $("APP_TAGSAMURAI_API");
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
- }), M = {
32
- getGroupCategory: (e, t) => {
33
- const r = e === "category" ? e : "groups";
34
- return g.get(`/${r}/tree`, { params: t });
31
+ }), w = {
32
+ getGroupCategory: (t, e) => {
33
+ const r = t === "category" ? t : "groups";
34
+ return g.get(`/${r}/tree`, { params: e });
35
35
  },
36
- getGroupCategoryList: (e, t, r) => {
37
- const o = e === "category" ? e : "groups";
38
- return g.get(`/${o}/${t}`, { params: r });
36
+ getGroupCategoryList: (t, e, r) => {
37
+ const o = t === "category" ? t : "groups";
38
+ return g.get(`/${o}/${e}`, { params: r });
39
39
  },
40
- getNames: (e) => {
41
- const t = e === "category" ? e : "groups";
42
- return g.get(`/${t}/names`);
40
+ getNames: (t) => {
41
+ const e = t === "category" ? t : "groups";
42
+ return g.get(`/${e}/names`);
43
43
  },
44
- getCodes: (e) => {
45
- const t = e === "category" ? e : "groups";
46
- return g.get(`/${t}/codes`);
44
+ getCodes: (t) => {
45
+ const e = t === "category" ? t : "groups";
46
+ return g.get(`/${e}/codes`);
47
47
  },
48
- postCreateGroupCategory: (e, t) => {
49
- const r = e === "category" ? e : "groups";
50
- return g.post(`/${r}`, t);
48
+ postCreateGroupCategory: (t, e) => {
49
+ const r = t === "category" ? t : "groups";
50
+ return g.post(`/${r}`, e);
51
51
  },
52
- putEditGroupCategory: (e, t, r) => {
53
- const o = e === "category" ? e : "groups";
54
- return g.put(`/${o}/${r}`, t);
52
+ putEditGroupCategory: (t, e, r) => {
53
+ const o = t === "category" ? t : "groups";
54
+ return g.put(`/${o}/${r}`, e);
55
55
  },
56
- putMoveGroup: (e, t) => g.put(`/groups/${t}/move-group`, e),
57
- putEditBulkGroups: async (e) => g.put("/groups/bulk", e),
58
- deleteGroupCategory: (e, t, r) => {
59
- const o = e === "category" ? e : "groups";
60
- return g.delete(`/${o}/${r}`, { data: t });
56
+ putMoveGroup: (t, e) => g.put(`/groups/${e}/move-group`, t),
57
+ putEditBulkGroups: async (t) => g.put("/groups/bulk", t),
58
+ deleteGroupCategory: (t, e, r) => {
59
+ const o = t === "category" ? t : "groups";
60
+ return g.delete(`/${o}/${r}`, { data: e });
61
61
  }
62
62
  }, c = s({
63
63
  prefix: "/settings-attribute-go/v2"
64
64
  }), k = {
65
- getGroupCategory: (e, t) => {
66
- const r = e === "category" ? e : "groups";
67
- return c.get(`/${r}/tree`, { params: t });
65
+ getGroupCategory: (t, e) => {
66
+ const r = t === "category" ? t : "groups";
67
+ return c.get(`/${r}/tree`, { params: e });
68
68
  },
69
- getGroupCategoryList: (e, t) => {
70
- const r = e === "category" ? e : "groups";
71
- return c.get(`/${r}/${t}`);
69
+ getGroupCategoryList: (t, e) => {
70
+ const r = t === "category" ? t : "groups";
71
+ return c.get(`/${r}/${e}`);
72
72
  },
73
- getNames: (e) => {
74
- const t = e === "category" ? e : "groups";
75
- return c.get(`/${t}/names`);
73
+ getNames: (t) => {
74
+ const e = t === "category" ? t : "groups";
75
+ return c.get(`/${e}/names`);
76
76
  },
77
- getCodes: (e) => {
78
- const t = e === "category" ? e : "groups";
79
- return c.get(`/${t}/codes`);
77
+ getCodes: (t) => {
78
+ const e = t === "category" ? t : "groups";
79
+ return c.get(`/${e}/codes`);
80
80
  },
81
- postCreateGroupCategory: (e, t) => {
82
- const r = e === "category" ? e : "groups";
83
- return c.post(`/${r}`, t);
81
+ postCreateGroupCategory: (t, e) => {
82
+ const r = t === "category" ? t : "groups";
83
+ return c.post(`/${r}`, e);
84
84
  },
85
- putEditGroupCategory: (e, t, r) => {
86
- const o = e === "category" ? e : "groups";
87
- return c.put(`/${o}/${r}`, t);
85
+ putEditGroupCategory: (t, e, r) => {
86
+ const o = t === "category" ? t : "groups";
87
+ return c.put(`/${o}/${r}`, e);
88
88
  },
89
- deleteGroupCategory: (e, t, r) => {
90
- const o = e === "category" ? e : "groups";
91
- return c.delete(`/${o}/${r}`, { data: t });
89
+ deleteGroupCategory: (t, e, r) => {
90
+ const o = t === "category" ? t : "groups";
91
+ return c.delete(`/${o}/${r}`, { data: e });
92
92
  }
93
93
  }, G = s({
94
94
  prefix: "/v2",
95
95
  env: "APP_LOGS_NOTIFICATION_API"
96
- }), w = {
96
+ }), B = {
97
97
  getTotalApprovals: () => G.get("/approval/count")
98
- }, A = s({
98
+ }, d = s({
99
99
  prefix: "/v2",
100
100
  env: "APP_LOGS_NOTIFICATION_API"
101
- }), B = {
102
- getActionLog: (e) => A.get("/change-log", { params: e }),
103
- getActionLogOption: (e) => A.get("/change-log/options", { params: e }),
104
- getSessionLogList: (e) => A.get("/session-log", { params: e }),
105
- getUserDetailSystemLogList: (e) => A.get("/change-log", { params: e }),
106
- getUserDetailSystemLogOption: (e) => A.get("/change-log/options", { params: e })
101
+ }), V = {
102
+ getActionLog: (t) => d.get("/change-log", { params: t }),
103
+ getActionLogOption: (t) => d.get("/change-log/options", { params: t }),
104
+ getSessionLogList: (t) => d.get("/session-log", { params: t }),
105
+ getUserDetailSystemLogList: (t) => d.get("/change-log", { params: t }),
106
+ getUserDetailSystemLogOption: (t) => d.get("/change-log/options", { params: t })
107
107
  }, a = s({
108
108
  prefix: "/assets/v2/assets"
109
- }), V = {
110
- getScanTag: (e) => a.get("/scan", { params: { tag: e } }),
111
- getAllAssets: (e) => a.get("/", { params: e }),
112
- getAvailableAssets: (e) => a.get("/available", { params: e }),
113
- scanAsset: (e) => a.get("", { params: { tag: e } }),
114
- getAssetsById: (e, t) => a.get("/by-id", { params: { _id: e, ...t } }),
115
- getOptions: (e, t) => a.get(e ? `/${e}/options` : "/options", { params: t }),
116
- getUnlinkedAssets: (e) => a.get("/unlinked", { params: e }),
117
- getAssetDetail: (e, t) => a.get(`/${e}`, { params: t }),
118
- getLinkedAssetFamily: (e) => a.get("/family", { params: { id: e } }),
119
- matchAssetWithTag: (e, t) => {
109
+ }), j = {
110
+ getScanTag: (t) => a.get("/scan", { params: { tag: t } }),
111
+ getAllAssets: (t) => a.get("/", { params: t }),
112
+ getAvailableAssets: (t) => a.get("/available", { params: t }),
113
+ scanAsset: (t) => a.get("", { params: { tag: t } }),
114
+ getAssetsById: (t, e) => a.get("/by-id", { params: { _id: t, ...e } }),
115
+ getOptions: (t, e) => a.get(t ? `/${t}/options` : "/options", { params: e }),
116
+ getUnlinkedAssets: (t) => a.get("/unlinked", { params: t }),
117
+ getAssetDetail: (t, e) => a.get(`/${t}`, { params: e }),
118
+ getLinkedAssetFamily: (t) => a.get("/family", { params: { id: t } }),
119
+ matchAssetWithTag: (t, e) => {
120
120
  const r = {
121
- _id: JSON.stringify([e]),
122
- tag: t
121
+ _id: JSON.stringify([t]),
122
+ tag: e
123
123
  };
124
124
  return a.get("/by-id", { params: r });
125
125
  }
126
126
  }, N = s({
127
127
  prefix: "/tracking/v2/missing"
128
- }), j = {
129
- putFoundAsset: (e, t) => {
130
- const r = { ids: [e], serialNumber: t };
128
+ }), Y = {
129
+ putFoundAsset: (t, e) => {
130
+ const r = { ids: [t], serialNumber: e };
131
131
  return N.put("/found", r);
132
132
  }
133
- }, y = s({
133
+ }, _ = s({
134
134
  prefix: "/v2/notification",
135
135
  env: "APP_LOGS_NOTIFICATION_API"
136
- }), Y = {
137
- getNotifications: (e) => y.get("/", { params: e }),
138
- readNotification: (e) => y.put(`/${e}`)
136
+ }), J = {
137
+ getNotifications: (t) => _.get("/", { params: t }),
138
+ readNotification: (t) => _.put(`/${t}`)
139
139
  }, m = s({
140
140
  prefix: "/utility/v2/notification"
141
- }), J = {
142
- getNotifications: (e) => m.get("/", { params: e }),
143
- readNotification: (e) => m.put(`/${e}`)
141
+ }), q = {
142
+ getNotifications: (t) => m.get("/", { params: t }),
143
+ readNotification: (t) => m.put(`/${t}`)
144
144
  }, F = s({
145
145
  prefix: "/v2/session-log",
146
146
  env: "APP_LOGS_NOTIFICATION_API"
147
- }), q = {
147
+ }), K = {
148
148
  postLogout: () => F.post("/logout")
149
- }, P = s({
149
+ }, I = s({
150
150
  prefix: "/tag/v2"
151
- }), K = {
152
- getScanQR: (e) => P.get("/qr", { params: { tag: e } }),
153
- getScanRFID: (e) => P.get("/rfid", { params: { tag: e } }),
154
- getRFIDQRTAG: (e) => P.get("/rfid-qr/scan", { params: e })
151
+ }), W = {
152
+ getScanQR: (t) => I.get("/qr", { params: { tag: t } }),
153
+ getScanRFID: (t) => I.get("/rfid", { params: { tag: t } }),
154
+ getRFIDQRTAG: (t) => I.get("/rfid-qr/scan", { params: t })
155
155
  }, b = s({
156
156
  prefix: "/tracking/v2/tracking"
157
- }), W = {
158
- putFoundAsset: (e, t, r) => {
157
+ }), z = {
158
+ putFoundAsset: (t, e, r) => {
159
159
  const o = {
160
- tag: e,
161
- group: t,
160
+ tag: t,
161
+ group: e,
162
162
  serialNumber: r,
163
163
  type: "Global"
164
164
  };
@@ -166,18 +166,25 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
166
166
  }
167
167
  }, n = s({
168
168
  prefix: "/settings-user-role/v2"
169
- }), z = {
170
- reLogin: (e) => n.post("/auth/login", e),
171
- changePassword: (e) => n.put("/users/change-password", e),
172
- getUserDetail: (e) => n.get(`/users/${e}`),
173
- putEditUser: (e, t) => {
169
+ }), Q = {
170
+ reLogin: (t) => n.post("/auth/login", t),
171
+ changePassword: (t) => n.put("/users/change-password", t),
172
+ /**
173
+ * Retrieves the user list as dropdown options.
174
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
175
+ */
176
+ getUserDropdown: (t) => n.get("/users/dropdown", { params: t }),
177
+ getUserOptions: (t) => n.get("/users/options", { params: t }),
178
+ getUserList: (t) => n.get("/users", { params: t }),
179
+ getUserDetail: (t) => n.get(`/users/${t}`),
180
+ putEditUser: (t, e) => {
174
181
  const r = { "Content-Type": "multipart/form-data" };
175
- return n.put(`/users/${e}`, t, { headers: r });
182
+ return n.put(`/users/${t}`, e, { headers: r });
176
183
  },
177
- putDeleteProfilePicture: (e) => n.put(`/users/${e}/delete-profile-picture`),
178
- putCancelEmailChange: (e, t) => n.put("/auth/confirm-email-change/cancel", {
179
- user: e,
180
- companyCode: t
184
+ putDeleteProfilePicture: (t) => n.put(`/users/${t}/delete-profile-picture`),
185
+ putCancelEmailChange: (t, e) => n.put("/auth/confirm-email-change/cancel", {
186
+ user: t,
187
+ companyCode: e
181
188
  }),
182
189
  /**
183
190
  *
@@ -185,42 +192,42 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
185
192
  * @param type {"Global" | "Group"} Whether the system role's type is global or group
186
193
  * @param params {Record<string, unknown>}
187
194
  */
188
- getUserDetailSystemRoles: (e, t, r) => n.get(`/user-detail/${e}/system-roles`, {
195
+ getUserDetailSystemRoles: (t, e, r) => n.get(`/user-detail/${t}/system-roles`, {
189
196
  params: {
190
197
  ...r,
191
- type: t
198
+ type: e
192
199
  }
193
200
  }),
194
201
  // User Detail
195
- getUserDetailSystemRoleList: (e, t) => n.get(`/user-detail/${e}/system-role-list`, { params: t }),
196
- getUserDetailSystemRoleOptions: (e, t) => n.get(`/user-detail/${e}/system-role/option`, { params: t }),
197
- getUserDetailTransactionRoleList: (e, t) => n.get(`/user-detail/${e}/transaction-role-list`, { params: t }),
198
- getUserDetailUserLogBorrowingList: (e, t) => n.get(`/users-log/${e}/borrowing`, { params: t }),
199
- getUserDetailUserLogAssignmentList: (e, t) => n.get(`/users-log/${e}/assignment`, { params: t }),
200
- getUserDetailUserLogBorrowingOption: (e, t) => n.get(`/users-log/${e}/borrowing/option`, { params: t }),
201
- getUserDetailUserLogAssignmentOption: (e, t) => n.get(`/users-log/${e}/assignment/option`, { params: t }),
202
- getUserDetailTransactionAdminLogList: (e, t) => n.get(`/users-log/${e}/transaction-log`, { params: t }),
203
- getUserDetailTransactionAdminLogOption: (e, t) => n.get(`/users-log/${e}/transaction-log/option`, { params: t })
204
- }, d = s({
202
+ getUserDetailSystemRoleList: (t, e) => n.get(`/user-detail/${t}/system-role-list`, { params: e }),
203
+ getUserDetailSystemRoleOptions: (t, e) => n.get(`/user-detail/${t}/system-role/option`, { params: e }),
204
+ getUserDetailTransactionRoleList: (t, e) => n.get(`/user-detail/${t}/transaction-role-list`, { params: e }),
205
+ getUserDetailUserLogBorrowingList: (t, e) => n.get(`/users-log/${t}/borrowing`, { params: e }),
206
+ getUserDetailUserLogAssignmentList: (t, e) => n.get(`/users-log/${t}/assignment`, { params: e }),
207
+ getUserDetailUserLogBorrowingOption: (t, e) => n.get(`/users-log/${t}/borrowing/option`, { params: e }),
208
+ getUserDetailUserLogAssignmentOption: (t, e) => n.get(`/users-log/${t}/assignment/option`, { params: e }),
209
+ getUserDetailTransactionAdminLogList: (t, e) => n.get(`/users-log/${t}/transaction-log`, { params: e }),
210
+ getUserDetailTransactionAdminLogOption: (t, e) => n.get(`/users-log/${t}/transaction-log/option`, { params: e })
211
+ }, v = s({
205
212
  env: "APP_ADMIN_API",
206
213
  prefix: "/settings-attribute/languages"
207
- }), Q = {
214
+ }), Z = {
208
215
  /**
209
216
  * Fetch all translation messages for a specific locale.
210
217
  * @param locale The locale code (e.g., 'en', 'id').
211
218
  * @returns A promise resolving to a key-value record of messages.
212
219
  */
213
- getMessages: (e) => d.get(`/${e}/translations`),
220
+ getMessages: (t) => v.get(`/${t}/translations`),
214
221
  /**
215
222
  * Fetch all available lang options for LanguageDropdown and LanguageSwitcher
216
223
  *
217
224
  * @returns Promise Array of options
218
225
  */
219
226
  getLanguageOptions: async () => {
220
- const { data: e } = await d.get(
227
+ const { data: t } = await v.get(
221
228
  "/dropdown"
222
229
  );
223
- return e.data;
230
+ return t.data;
224
231
  },
225
232
  /**
226
233
  * Fetch single lang option meta data
@@ -228,11 +235,11 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
228
235
  * @param isoCode The locale code (e.g., 'en', 'id').
229
236
  * @returns Promise LanguageMeta
230
237
  */
231
- getLanguageOptionMeta: async (e) => {
232
- const { data: t } = await d.get(
233
- "/dropdown/" + e
238
+ getLanguageOptionMeta: async (t) => {
239
+ const { data: e } = await v.get(
240
+ "/dropdown/" + t
234
241
  );
235
- return t.data;
242
+ return e.data;
236
243
  },
237
244
  /**
238
245
  * Translate a specific text to the target locale.
@@ -240,81 +247,81 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
240
247
  * @param key Unique translation key.
241
248
  * @param locale Target locale code.
242
249
  */
243
- translateText: async (e, t) => {
244
- const { data: r } = await d.post("/translate", {
245
- q: e,
246
- target: t
250
+ translateText: async (t, e) => {
251
+ const { data: r } = await v.post("/translate", {
252
+ q: t,
253
+ target: e
247
254
  });
248
- return r.data.translations[e];
255
+ return r.data.translations[t];
249
256
  }
250
- }, _ = s({
257
+ }, C = s({
251
258
  prefix: "/dashboard/v2/dashboard"
252
- }), Z = {
253
- getLatestTask: (e) => _.get("/latest-task", { params: e }),
254
- getSummary: (e) => _.get("/summary", { params: e })
255
- }, I = s({
256
- prefix: "/alias-code/api/alias-code"
257
259
  }), H = {
258
- getAliasCode: () => I.get("/"),
259
- postAliasCode: (e) => I.post("/", e),
260
- getAliasCodeList: (e) => I.get(`/${e.object}/code-list`, { params: e })
261
- }, C = s({
262
- prefix: "/settings-attribute/v2/general-settings"
260
+ getLatestTask: (t) => C.get("/latest-task", { params: t }),
261
+ getSummary: (t) => C.get("/summary", { params: t })
262
+ }, S = s({
263
+ prefix: "/alias-code/api/alias-code"
263
264
  }), X = {
264
- getGeneralSettings: () => C.get("/"),
265
- putUpdateGeneralSettings: (e) => C.put("/", e)
266
- }, u = s({
265
+ getAliasCode: () => S.get("/"),
266
+ postAliasCode: (t) => S.post("/", t),
267
+ getAliasCodeList: (t) => S.get(`/${t.object}/code-list`, { params: t })
268
+ }, L = s({
269
+ prefix: "/settings-attribute/v2/general-settings"
270
+ }), tt = {
271
+ getGeneralSettings: () => L.get("/"),
272
+ putUpdateGeneralSettings: (t) => L.put("/", t)
273
+ }, p = s({
267
274
  prefix: "/settings-attribute/v2/custom-field"
268
- }), ee = {
269
- getCustomField: async (e) => u.get("/", { params: e }),
270
- getOptions: async (e) => u.get("/options", { params: e }),
271
- postCreateCustomField: async (e, t) => u.post("/", t, { params: e }),
272
- putEditCustomField: async (e, t, r) => u.put(`/${r}`, t, { params: e }),
273
- putChangeStatus: async (e, t) => u.put("/bulk", t, { params: e }),
274
- deleteCustomField: async (e) => u.delete("/bulk", { data: e })
275
- }, S = ({ headers: e = {}, params: t = {} } = {}) => {
276
- const r = v("APP_COUNTRY_STATE_API"), o = v("APP_COUNTRY_STATE_API_KEY");
275
+ }), et = {
276
+ getCustomField: async (t) => p.get("/", { params: t }),
277
+ getOptions: async (t) => p.get("/options", { params: t }),
278
+ postCreateCustomField: async (t, e) => p.post("/", e, { params: t }),
279
+ putEditCustomField: async (t, e, r) => p.put(`/${r}`, e, { params: t }),
280
+ putChangeStatus: async (t, e) => p.put("/bulk", e, { params: t }),
281
+ deleteCustomField: async (t) => p.delete("/bulk", { data: t })
282
+ }, f = ({ headers: t = {}, params: e = {} } = {}) => {
283
+ const r = $("APP_COUNTRY_STATE_API"), o = $("APP_COUNTRY_STATE_API_KEY");
277
284
  return T.create({
278
285
  baseURL: `${r}/v1`,
279
286
  headers: {
280
287
  "Content-type": "application/json",
281
288
  "X-CSCAPI-KEY": o,
282
- ...e
289
+ ...t
283
290
  },
284
- params: t
291
+ params: e
285
292
  });
286
- }, te = {
287
- getCountry: () => S().get("/countries"),
288
- getState: (e) => S().get(`/countries/${e}/states`),
289
- getCity: (e, t) => S().get(`/countries/${e}/states/${t}/cities`)
293
+ }, rt = {
294
+ getCountry: () => f().get("/countries"),
295
+ getState: (t) => f().get(`/countries/${t}/states`),
296
+ getCity: (t, e) => f().get(`/countries/${t}/states/${e}/cities`)
290
297
  }, i = s({
291
298
  prefix: "/routine/v2"
292
- }), re = {
293
- getList: (e) => i.get("/service-center", { params: e }),
294
- postList: (e) => i.post("/service-center", e),
295
- putList: (e, t) => i.put(`/service-center/${e}`, t),
296
- putActivate: (e) => i.put("/service-center/bulk", e),
297
- getDetailList: (e) => i.get(`/service-center/${e}`),
298
- getListOptions: (e) => i.get("/service-center/options", { params: e }),
299
- deleteList: (e) => i.delete("/service-center", { params: e }),
299
+ }), st = {
300
+ getList: (t) => i.get("/service-center", { params: t }),
301
+ postList: (t) => i.post("/service-center", t),
302
+ putList: (t, e) => i.put(`/service-center/${t}`, e),
303
+ putActivate: (t) => i.put("/service-center/bulk", t),
304
+ getDetailList: (t) => i.get(`/service-center/${t}`),
305
+ getListOptions: (t) => i.get("/service-center/options", { params: t }),
306
+ deleteList: (t) => i.delete("/service-center", { params: t }),
300
307
  // Activities
301
- getActivities: (e) => i.get("/service-activities", { params: e }),
302
- getActivityOptions: (e) => i.get("/service-activities/options", { params: e }),
303
- getActivityDetail: (e) => i.get(`/service-activities/${e}`),
304
- getActivityLog: (e) => i.get(`/service-activities/${e}/activity-log`)
305
- }, D = s({
308
+ getActivities: (t) => i.get("/service-activities", { params: t }),
309
+ getActivityOptions: (t) => i.get("/service-activities/options", { params: t }),
310
+ getActivityDetail: (t) => i.get(`/service-activities/${t}`),
311
+ getActivityLog: (t) => i.get(`/service-activities/${t}/activity-log`)
312
+ }, E = s({
306
313
  prefix: "/settings-attribute/v2/brands"
307
- }), se = {
308
- getDropdown: (e) => D.get("/dropdown", { params: e })
309
- }, p = s({
314
+ }), nt = {
315
+ getDropdown: (t) => E.get("/dropdown", { params: t })
316
+ }, l = s({
310
317
  prefix: "/file-manager/v2"
311
- }), ne = {
318
+ }), ot = {
312
319
  /**
313
320
  * Get storage information.
314
321
  *
315
322
  * @returns {Promise<AxiosResponse>} The Axios Response.
316
323
  */
317
- getStorageInformation: () => p.get("/files/storage"),
324
+ getStorageInformation: () => l.get("/files/storage"),
318
325
  /**
319
326
  * Get file manager data.
320
327
  *
@@ -322,7 +329,7 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
322
329
  * @param {FileManagerFilterParams} [params] - The parameters for filtering.
323
330
  * @returns {Promise<AxiosResponse>} The Axios Response.
324
331
  */
325
- getFileManager: (e, t) => p.get(`/${e}`, { params: t }),
332
+ getFileManager: (t, e) => l.get(`/${t}`, { params: e }),
326
333
  /**
327
334
  * Get file manager options.
328
335
  *
@@ -330,7 +337,7 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
330
337
  * @param {FileManagerOptionBoolean} [params] - The parameters for options.
331
338
  * @returns {Promise<AxiosResponse>} The Axios Response.
332
339
  */
333
- getFileManagerOption: (e, t) => p.get(`/${e}/options`, { params: t }),
340
+ getFileManagerOption: (t, e) => l.get(`/${t}/options`, { params: e }),
334
341
  /**
335
342
  * Recover files.
336
343
  *
@@ -338,7 +345,7 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
338
345
  * @param {object} body - The body of the request.
339
346
  * @returns {Promise<AxiosResponse>} The Axios Response.
340
347
  */
341
- recoverFiles: (e, t) => p.put(`/${e}/recover`, t),
348
+ recoverFiles: (t, e) => l.put(`/${t}/recover`, e),
342
349
  /**
343
350
  * Delete files.
344
351
  *
@@ -346,7 +353,7 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
346
353
  * @param {DeleteFileManagerDto} params - The params of the request.
347
354
  * @returns {Promise<AxiosResponse>} The Axios Response.
348
355
  */
349
- deleteFiles: (e, t) => p.delete(`/${e}`, { params: t }),
356
+ deleteFiles: (t, e) => l.delete(`/${t}`, { params: e }),
350
357
  /**
351
358
  * Delete files permanently.
352
359
  *
@@ -354,16 +361,16 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
354
361
  * @param {object} body - The body of the request.
355
362
  * @returns {Promise<AxiosResponse>} The Axios Response.
356
363
  */
357
- deletePermanently: (e, t) => p.delete(`/${e}/delete-permanent`, { params: t })
358
- }, l = s({
364
+ deletePermanently: (t, e) => l.delete(`/${t}/delete-permanent`, { params: e })
365
+ }, A = s({
359
366
  prefix: "/utility/v2"
360
- }), oe = {
367
+ }), it = {
361
368
  /**
362
369
  * Get storage information.
363
370
  *
364
371
  * @returns {Promise<AxiosResponse>} The Axios Response.
365
372
  */
366
- getStorageInformation: () => l.get("/files/storage"),
373
+ getStorageInformation: () => A.get("/files/storage"),
367
374
  /**
368
375
  * Get file manager data.
369
376
  *
@@ -371,7 +378,7 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
371
378
  * @param {FileManagerFilterParams} [params] - The parameters for filtering.
372
379
  * @returns {Promise<AxiosResponse>} The Axios Response.
373
380
  */
374
- getFileManager: (e, t) => l.get(`/${e}`, { params: t }),
381
+ getFileManager: (t, e) => A.get(`/${t}`, { params: e }),
375
382
  /**
376
383
  * Get file manager options.
377
384
  *
@@ -379,7 +386,7 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
379
386
  * @param {FileManagerOptionBoolean} [params] - The parameters for options.
380
387
  * @returns {Promise<AxiosResponse>} The Axios Response.
381
388
  */
382
- getFileManagerOption: (e, t) => l.get(`/${e}/options`, { params: t }),
389
+ getFileManagerOption: (t, e) => A.get(`/${t}/options`, { params: e }),
383
390
  /**
384
391
  * Recover files.
385
392
  *
@@ -387,7 +394,7 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
387
394
  * @param {object} body - The body of the request.
388
395
  * @returns {Promise<AxiosResponse>} The Axios Response.
389
396
  */
390
- recoverFiles: (e, t) => l.put(`/${e}/recover`, t),
397
+ recoverFiles: (t, e) => A.put(`/${t}/recover`, e),
391
398
  /**
392
399
  * Delete files.
393
400
  *
@@ -395,7 +402,7 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
395
402
  * @param {DeleteFileManagerDto} params - The params of the request.
396
403
  * @returns {Promise<AxiosResponse>} The Axios Response.
397
404
  */
398
- deleteFiles: (e, t) => l.delete(`/${e}`, { params: t }),
405
+ deleteFiles: (t, e) => A.delete(`/${t}`, { params: e }),
399
406
  /**
400
407
  * Delete files permanently.
401
408
  *
@@ -403,32 +410,44 @@ const h = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
403
410
  * @param {object} body - The body of the request.
404
411
  * @returns {Promise<AxiosResponse>} The Axios Response.
405
412
  */
406
- deletePermanently: (e, t) => l.delete(`/${e}/delete-permanent`, { params: t })
413
+ deletePermanently: (t, e) => A.delete(`/${t}/delete-permanent`, { params: e })
414
+ }, u = s({
415
+ prefix: "/iot/v2/reader"
416
+ }), at = {
417
+ getData: (t) => u.get("/", { params: t }),
418
+ getDataOptions: (t) => u.get("/options", { params: t }),
419
+ getActivityLogData: (t) => u.get("/activity-log", { params: t }),
420
+ getActivityLogOptions: (t) => u.get("/activity-log/options", { params: t }),
421
+ getDataById: (t) => u.get(`/${t}`),
422
+ getChangeLog: (t) => u.get(`/${t.id}/change-log`, { params: t }),
423
+ getChangeLogOptions: (t) => u.get(`/${t.id}/change-log/options`, { params: t }),
424
+ putData: (t, e) => u.put(`/${t}`, e)
407
425
  };
408
426
  export {
409
- H as AliasCodeServices,
410
- V as AssetServices,
411
- se as BrandServices,
412
- B as ChangelogServices,
413
- te as CountryStateServices,
414
- ee as CustomFieldServices,
415
- Z as DashboardServices,
416
- ne as FileManagerServices,
417
- oe as FileManagerServicesGo,
418
- X as GeneralSettingsServices,
419
- M as GroupCategoryServices,
427
+ X as AliasCodeServices,
428
+ j as AssetServices,
429
+ nt as BrandServices,
430
+ V as ChangelogServices,
431
+ rt as CountryStateServices,
432
+ et as CustomFieldServices,
433
+ H as DashboardServices,
434
+ ot as FileManagerServices,
435
+ it as FileManagerServicesGo,
436
+ tt as GeneralSettingsServices,
437
+ w as GroupCategoryServices,
420
438
  k as GroupCategoryServicesGo,
421
- Q as I18nService,
422
- j as MissingServices,
423
- w as NotificationApprovalServices,
424
- Y as NotificationServices,
425
- J as NotificationServicesGo,
426
- re as ServiceCenterServices,
427
- q as SessionLogServices,
428
- K as TAGServices,
429
- W as TrackingServices,
430
- z as UserServices,
431
- v as getBaseURL,
432
- R as getImageURL,
433
- x as queryParamsStringfy
439
+ Z as I18nService,
440
+ Y as MissingServices,
441
+ B as NotificationApprovalServices,
442
+ J as NotificationServices,
443
+ q as NotificationServicesGo,
444
+ at as ReaderServices,
445
+ st as ServiceCenterServices,
446
+ K as SessionLogServices,
447
+ W as TAGServices,
448
+ z as TrackingServices,
449
+ Q as UserServices,
450
+ $ as getBaseURL,
451
+ M as getImageURL,
452
+ R as queryParamsStringfy
434
453
  };
@@ -1 +1 @@
1
- System.register(["axios"],function(s,R){"use strict";var $;return{setters:[P=>{$=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"},v=s("getBaseURL",(e="APP_API")=>P["VITE_"+e]),n=(e={},t=!1)=>{const{env:r="APP_API",prefix:o="",headers:m={},...b}=e,D=`${v(r)}${o}`,O=JSON.parse(localStorage.getItem("user")??"{}"),E=O.jwt??O.token??"";return $.create({...b,baseURL:D,headers:t?m:{"Content-Type":"application/json",Authorization:`Bearer ${E}`,...m}})},M=s("queryParamsStringfy",e=>{if(!e||typeof e=="string")return;const t={};return Object.keys(e).forEach(r=>{Array.isArray(e[r])?e[r].length>0&&Object.assign(t,{[r]:JSON.stringify(e[r])}):e[r]!==void 0&&Object.assign(t,{[r]:e[r]})}),t}),k=s("getImageURL",e=>{if(!e)return;const t=v("APP_TAGSAMURAI_API");return e.startsWith("http")?e:`${t}/file-manager/v2/files/${e}`}),c=n({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),w=s("GroupCategoryServices",{getGroupCategory:(e,t)=>{const r=e==="category"?e:"groups";return c.get(`/${r}/tree`,{params:t})},getGroupCategoryList:(e,t,r)=>{const o=e==="category"?e:"groups";return c.get(`/${o}/${t}`,{params:r})},getNames:e=>{const t=e==="category"?e:"groups";return c.get(`/${t}/names`)},getCodes:e=>{const t=e==="category"?e:"groups";return c.get(`/${t}/codes`)},postCreateGroupCategory:(e,t)=>{const r=e==="category"?e:"groups";return c.post(`/${r}`,t)},putEditGroupCategory:(e,t,r)=>{const o=e==="category"?e:"groups";return c.put(`/${o}/${r}`,t)},putMoveGroup:(e,t)=>c.put(`/groups/${t}/move-group`,e),putEditBulkGroups:async e=>c.put("/groups/bulk",e),deleteGroupCategory:(e,t,r)=>{const o=e==="category"?e:"groups";return c.delete(`/${o}/${r}`,{data:t})}}),u=n({prefix:"/settings-attribute-go/v2"}),B=s("GroupCategoryServicesGo",{getGroupCategory:(e,t)=>{const r=e==="category"?e:"groups";return u.get(`/${r}/tree`,{params:t})},getGroupCategoryList:(e,t)=>{const r=e==="category"?e:"groups";return u.get(`/${r}/${t}`)},getNames:e=>{const t=e==="category"?e:"groups";return u.get(`/${t}/names`)},getCodes:e=>{const t=e==="category"?e:"groups";return u.get(`/${t}/codes`)},postCreateGroupCategory:(e,t)=>{const r=e==="category"?e:"groups";return u.post(`/${r}`,t)},putEditGroupCategory:(e,t,r)=>{const o=e==="category"?e:"groups";return u.put(`/${o}/${r}`,t)},deleteGroupCategory:(e,t,r)=>{const o=e==="category"?e:"groups";return u.delete(`/${o}/${r}`,{data:t})}}),U=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),V=s("NotificationApprovalServices",{getTotalApprovals:()=>U.get("/approval/count")}),d=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),j=s("ChangelogServices",{getActionLog:e=>d.get("/change-log",{params:e}),getActionLogOption:e=>d.get("/change-log/options",{params:e}),getSessionLogList:e=>d.get("/session-log",{params:e}),getUserDetailSystemLogList:e=>d.get("/change-log",{params:e}),getUserDetailSystemLogOption:e=>d.get("/change-log/options",{params:e})}),g=n({prefix:"/assets/v2/assets"}),Y=s("AssetServices",{getScanTag:e=>g.get("/scan",{params:{tag:e}}),getAllAssets:e=>g.get("/",{params:e}),getAvailableAssets:e=>g.get("/available",{params:e}),scanAsset:e=>g.get("",{params:{tag:e}}),getAssetsById:(e,t)=>g.get("/by-id",{params:{_id:e,...t}}),getOptions:(e,t)=>g.get(e?`/${e}/options`:"/options",{params:t}),getUnlinkedAssets:e=>g.get("/unlinked",{params:e}),getAssetDetail:(e,t)=>g.get(`/${e}`,{params:t}),getLinkedAssetFamily:e=>g.get("/family",{params:{id:e}}),matchAssetWithTag:(e,t)=>{const r={_id:JSON.stringify([e]),tag:t};return g.get("/by-id",{params:r})}}),h=n({prefix:"/tracking/v2/missing"}),q=s("MissingServices",{putFoundAsset:(e,t)=>{const r={ids:[e],serialNumber:t};return h.put("/found",r)}}),_=n({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),J=s("NotificationServices",{getNotifications:e=>_.get("/",{params:e}),readNotification:e=>_.put(`/${e}`)}),C=n({prefix:"/utility/v2/notification"}),K=s("NotificationServicesGo",{getNotifications:e=>C.get("/",{params:e}),readNotification:e=>C.put(`/${e}`)}),G=n({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),x=s("SessionLogServices",{postLogout:()=>G.post("/logout")}),I=n({prefix:"/tag/v2"}),W=s("TAGServices",{getScanQR:e=>I.get("/qr",{params:{tag:e}}),getScanRFID:e=>I.get("/rfid",{params:{tag:e}}),getRFIDQRTAG:e=>I.get("/rfid-qr/scan",{params:e})}),N=n({prefix:"/tracking/v2/tracking"}),z=s("TrackingServices",{putFoundAsset:(e,t,r)=>{const o={tag:e,group:t,serialNumber:r,type:"Global"};return N.put("/found",{params:o})}}),i=n({prefix:"/settings-user-role/v2"}),Q=s("UserServices",{reLogin:e=>i.post("/auth/login",e),changePassword:e=>i.put("/users/change-password",e),getUserDetail:e=>i.get(`/users/${e}`),putEditUser:(e,t)=>{const r={"Content-Type":"multipart/form-data"};return i.put(`/users/${e}`,t,{headers:r})},putDeleteProfilePicture:e=>i.put(`/users/${e}/delete-profile-picture`),putCancelEmailChange:(e,t)=>i.put("/auth/confirm-email-change/cancel",{user:e,companyCode:t}),getUserDetailSystemRoles:(e,t,r)=>i.get(`/user-detail/${e}/system-roles`,{params:{...r,type:t}}),getUserDetailSystemRoleList:(e,t)=>i.get(`/user-detail/${e}/system-role-list`,{params:t}),getUserDetailSystemRoleOptions:(e,t)=>i.get(`/user-detail/${e}/system-role/option`,{params:t}),getUserDetailTransactionRoleList:(e,t)=>i.get(`/user-detail/${e}/transaction-role-list`,{params:t}),getUserDetailUserLogBorrowingList:(e,t)=>i.get(`/users-log/${e}/borrowing`,{params:t}),getUserDetailUserLogAssignmentList:(e,t)=>i.get(`/users-log/${e}/assignment`,{params:t}),getUserDetailUserLogBorrowingOption:(e,t)=>i.get(`/users-log/${e}/borrowing/option`,{params:t}),getUserDetailUserLogAssignmentOption:(e,t)=>i.get(`/users-log/${e}/assignment/option`,{params:t}),getUserDetailTransactionAdminLogList:(e,t)=>i.get(`/users-log/${e}/transaction-log`,{params:t}),getUserDetailTransactionAdminLogOption:(e,t)=>i.get(`/users-log/${e}/transaction-log/option`,{params:t})}),S=n({env:"APP_ADMIN_API",prefix:"/settings-attribute/languages"}),Z=s("I18nService",{getMessages:e=>S.get(`/${e}/translations`),getLanguageOptions:async()=>{const{data:e}=await S.get("/dropdown");return e.data},getLanguageOptionMeta:async e=>{const{data:t}=await S.get("/dropdown/"+e);return t.data},translateText:async(e,t)=>{const{data:r}=await S.post("/translate",{q:e,target:t});return r.data.translations[e]}}),T=n({prefix:"/dashboard/v2/dashboard"}),H=s("DashboardServices",{getLatestTask:e=>T.get("/latest-task",{params:e}),getSummary:e=>T.get("/summary",{params:e})}),f=n({prefix:"/alias-code/api/alias-code"}),X=s("AliasCodeServices",{getAliasCode:()=>f.get("/"),postAliasCode:e=>f.post("/",e),getAliasCodeList:e=>f.get(`/${e.object}/code-list`,{params:e})}),L=n({prefix:"/settings-attribute/v2/general-settings"}),ee=s("GeneralSettingsServices",{getGeneralSettings:()=>L.get("/"),putUpdateGeneralSettings:e=>L.put("/",e)}),l=n({prefix:"/settings-attribute/v2/custom-field"}),te=s("CustomFieldServices",{getCustomField:async e=>l.get("/",{params:e}),getOptions:async e=>l.get("/options",{params:e}),postCreateCustomField:async(e,t)=>l.post("/",t,{params:e}),putEditCustomField:async(e,t,r)=>l.put(`/${r}`,t,{params:e}),putChangeStatus:async(e,t)=>l.put("/bulk",t,{params:e}),deleteCustomField:async e=>l.delete("/bulk",{data:e})}),y=({headers:e={},params:t={}}={})=>{const r=v("APP_COUNTRY_STATE_API"),o=v("APP_COUNTRY_STATE_API_KEY");return $.create({baseURL:`${r}/v1`,headers:{"Content-type":"application/json","X-CSCAPI-KEY":o,...e},params:t})},re=s("CountryStateServices",{getCountry:()=>y().get("/countries"),getState:e=>y().get(`/countries/${e}/states`),getCity:(e,t)=>y().get(`/countries/${e}/states/${t}/cities`)}),a=n({prefix:"/routine/v2"}),se=s("ServiceCenterServices",{getList:e=>a.get("/service-center",{params:e}),postList:e=>a.post("/service-center",e),putList:(e,t)=>a.put(`/service-center/${e}`,t),putActivate:e=>a.put("/service-center/bulk",e),getDetailList:e=>a.get(`/service-center/${e}`),getListOptions:e=>a.get("/service-center/options",{params:e}),deleteList:e=>a.delete("/service-center",{params:e}),getActivities:e=>a.get("/service-activities",{params:e}),getActivityOptions:e=>a.get("/service-activities/options",{params:e}),getActivityDetail:e=>a.get(`/service-activities/${e}`),getActivityLog:e=>a.get(`/service-activities/${e}/activity-log`)}),F=n({prefix:"/settings-attribute/v2/brands"}),ne=s("BrandServices",{getDropdown:e=>F.get("/dropdown",{params:e})}),p=n({prefix:"/file-manager/v2"}),ie=s("FileManagerServices",{getStorageInformation:()=>p.get("/files/storage"),getFileManager:(e,t)=>p.get(`/${e}`,{params:t}),getFileManagerOption:(e,t)=>p.get(`/${e}/options`,{params:t}),recoverFiles:(e,t)=>p.put(`/${e}/recover`,t),deleteFiles:(e,t)=>p.delete(`/${e}`,{params:t}),deletePermanently:(e,t)=>p.delete(`/${e}/delete-permanent`,{params:t})}),A=n({prefix:"/utility/v2"}),oe=s("FileManagerServicesGo",{getStorageInformation:()=>A.get("/files/storage"),getFileManager:(e,t)=>A.get(`/${e}`,{params:t}),getFileManagerOption:(e,t)=>A.get(`/${e}/options`,{params:t}),recoverFiles:(e,t)=>A.put(`/${e}/recover`,t),deleteFiles:(e,t)=>A.delete(`/${e}`,{params:t}),deletePermanently:(e,t)=>A.delete(`/${e}/delete-permanent`,{params:t})})}}});
1
+ System.register(["axios"],function(s,M){"use strict";var P;return{setters:[I=>{P=I.default}],execute:function(){const I={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"},S=s("getBaseURL",(e="APP_API")=>I["VITE_"+e]),n=(e={},t=!1)=>{const{env:r="APP_API",prefix:o="",headers:_={},...b}=e,R=`${S(r)}${o}`,U=JSON.parse(localStorage.getItem("user")??"{}"),E=U.jwt??U.token??"";return P.create({...b,baseURL:R,headers:t?_:{"Content-Type":"application/json",Authorization:`Bearer ${E}`,..._}})},w=s("queryParamsStringfy",e=>{if(!e||typeof e=="string")return;const t={};return Object.keys(e).forEach(r=>{Array.isArray(e[r])?e[r].length>0&&Object.assign(t,{[r]:JSON.stringify(e[r])}):e[r]!==void 0&&Object.assign(t,{[r]:e[r]})}),t}),k=s("getImageURL",e=>{if(!e)return;const t=S("APP_TAGSAMURAI_API");return e.startsWith("http")?e:`${t}/file-manager/v2/files/${e}`}),c=n({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),B=s("GroupCategoryServices",{getGroupCategory:(e,t)=>{const r=e==="category"?e:"groups";return c.get(`/${r}/tree`,{params:t})},getGroupCategoryList:(e,t,r)=>{const o=e==="category"?e:"groups";return c.get(`/${o}/${t}`,{params:r})},getNames:e=>{const t=e==="category"?e:"groups";return c.get(`/${t}/names`)},getCodes:e=>{const t=e==="category"?e:"groups";return c.get(`/${t}/codes`)},postCreateGroupCategory:(e,t)=>{const r=e==="category"?e:"groups";return c.post(`/${r}`,t)},putEditGroupCategory:(e,t,r)=>{const o=e==="category"?e:"groups";return c.put(`/${o}/${r}`,t)},putMoveGroup:(e,t)=>c.put(`/groups/${t}/move-group`,e),putEditBulkGroups:async e=>c.put("/groups/bulk",e),deleteGroupCategory:(e,t,r)=>{const o=e==="category"?e:"groups";return c.delete(`/${o}/${r}`,{data:t})}}),l=n({prefix:"/settings-attribute-go/v2"}),V=s("GroupCategoryServicesGo",{getGroupCategory:(e,t)=>{const r=e==="category"?e:"groups";return l.get(`/${r}/tree`,{params:t})},getGroupCategoryList:(e,t)=>{const r=e==="category"?e:"groups";return l.get(`/${r}/${t}`)},getNames:e=>{const t=e==="category"?e:"groups";return l.get(`/${t}/names`)},getCodes:e=>{const t=e==="category"?e:"groups";return l.get(`/${t}/codes`)},postCreateGroupCategory:(e,t)=>{const r=e==="category"?e:"groups";return l.post(`/${r}`,t)},putEditGroupCategory:(e,t,r)=>{const o=e==="category"?e:"groups";return l.put(`/${o}/${r}`,t)},deleteGroupCategory:(e,t,r)=>{const o=e==="category"?e:"groups";return l.delete(`/${o}/${r}`,{data:t})}}),h=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),j=s("NotificationApprovalServices",{getTotalApprovals:()=>h.get("/approval/count")}),v=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),Y=s("ChangelogServices",{getActionLog:e=>v.get("/change-log",{params:e}),getActionLogOption:e=>v.get("/change-log/options",{params:e}),getSessionLogList:e=>v.get("/session-log",{params:e}),getUserDetailSystemLogList:e=>v.get("/change-log",{params:e}),getUserDetailSystemLogOption:e=>v.get("/change-log/options",{params:e})}),g=n({prefix:"/assets/v2/assets"}),q=s("AssetServices",{getScanTag:e=>g.get("/scan",{params:{tag:e}}),getAllAssets:e=>g.get("/",{params:e}),getAvailableAssets:e=>g.get("/available",{params:e}),scanAsset:e=>g.get("",{params:{tag:e}}),getAssetsById:(e,t)=>g.get("/by-id",{params:{_id:e,...t}}),getOptions:(e,t)=>g.get(e?`/${e}/options`:"/options",{params:t}),getUnlinkedAssets:e=>g.get("/unlinked",{params:e}),getAssetDetail:(e,t)=>g.get(`/${e}`,{params:t}),getLinkedAssetFamily:e=>g.get("/family",{params:{id:e}}),matchAssetWithTag:(e,t)=>{const r={_id:JSON.stringify([e]),tag:t};return g.get("/by-id",{params:r})}}),D=n({prefix:"/tracking/v2/missing"}),J=s("MissingServices",{putFoundAsset:(e,t)=>{const r={ids:[e],serialNumber:t};return D.put("/found",r)}}),C=n({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),K=s("NotificationServices",{getNotifications:e=>C.get("/",{params:e}),readNotification:e=>C.put(`/${e}`)}),L=n({prefix:"/utility/v2/notification"}),x=s("NotificationServicesGo",{getNotifications:e=>L.get("/",{params:e}),readNotification:e=>L.put(`/${e}`)}),G=n({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),W=s("SessionLogServices",{postLogout:()=>G.post("/logout")}),f=n({prefix:"/tag/v2"}),z=s("TAGServices",{getScanQR:e=>f.get("/qr",{params:{tag:e}}),getScanRFID:e=>f.get("/rfid",{params:{tag:e}}),getRFIDQRTAG:e=>f.get("/rfid-qr/scan",{params:e})}),N=n({prefix:"/tracking/v2/tracking"}),Q=s("TrackingServices",{putFoundAsset:(e,t,r)=>{const o={tag:e,group:t,serialNumber:r,type:"Global"};return N.put("/found",{params:o})}}),i=n({prefix:"/settings-user-role/v2"}),Z=s("UserServices",{reLogin:e=>i.post("/auth/login",e),changePassword:e=>i.put("/users/change-password",e),getUserDropdown:e=>i.get("/users/dropdown",{params:e}),getUserOptions:e=>i.get("/users/options",{params:e}),getUserList:e=>i.get("/users",{params:e}),getUserDetail:e=>i.get(`/users/${e}`),putEditUser:(e,t)=>{const r={"Content-Type":"multipart/form-data"};return i.put(`/users/${e}`,t,{headers:r})},putDeleteProfilePicture:e=>i.put(`/users/${e}/delete-profile-picture`),putCancelEmailChange:(e,t)=>i.put("/auth/confirm-email-change/cancel",{user:e,companyCode:t}),getUserDetailSystemRoles:(e,t,r)=>i.get(`/user-detail/${e}/system-roles`,{params:{...r,type:t}}),getUserDetailSystemRoleList:(e,t)=>i.get(`/user-detail/${e}/system-role-list`,{params:t}),getUserDetailSystemRoleOptions:(e,t)=>i.get(`/user-detail/${e}/system-role/option`,{params:t}),getUserDetailTransactionRoleList:(e,t)=>i.get(`/user-detail/${e}/transaction-role-list`,{params:t}),getUserDetailUserLogBorrowingList:(e,t)=>i.get(`/users-log/${e}/borrowing`,{params:t}),getUserDetailUserLogAssignmentList:(e,t)=>i.get(`/users-log/${e}/assignment`,{params:t}),getUserDetailUserLogBorrowingOption:(e,t)=>i.get(`/users-log/${e}/borrowing/option`,{params:t}),getUserDetailUserLogAssignmentOption:(e,t)=>i.get(`/users-log/${e}/assignment/option`,{params:t}),getUserDetailTransactionAdminLogList:(e,t)=>i.get(`/users-log/${e}/transaction-log`,{params:t}),getUserDetailTransactionAdminLogOption:(e,t)=>i.get(`/users-log/${e}/transaction-log/option`,{params:t})}),$=n({env:"APP_ADMIN_API",prefix:"/settings-attribute/languages"}),H=s("I18nService",{getMessages:e=>$.get(`/${e}/translations`),getLanguageOptions:async()=>{const{data:e}=await $.get("/dropdown");return e.data},getLanguageOptionMeta:async e=>{const{data:t}=await $.get("/dropdown/"+e);return t.data},translateText:async(e,t)=>{const{data:r}=await $.post("/translate",{q:e,target:t});return r.data.translations[e]}}),T=n({prefix:"/dashboard/v2/dashboard"}),X=s("DashboardServices",{getLatestTask:e=>T.get("/latest-task",{params:e}),getSummary:e=>T.get("/summary",{params:e})}),y=n({prefix:"/alias-code/api/alias-code"}),ee=s("AliasCodeServices",{getAliasCode:()=>y.get("/"),postAliasCode:e=>y.post("/",e),getAliasCodeList:e=>y.get(`/${e.object}/code-list`,{params:e})}),O=n({prefix:"/settings-attribute/v2/general-settings"}),te=s("GeneralSettingsServices",{getGeneralSettings:()=>O.get("/"),putUpdateGeneralSettings:e=>O.put("/",e)}),p=n({prefix:"/settings-attribute/v2/custom-field"}),re=s("CustomFieldServices",{getCustomField:async e=>p.get("/",{params:e}),getOptions:async e=>p.get("/options",{params:e}),postCreateCustomField:async(e,t)=>p.post("/",t,{params:e}),putEditCustomField:async(e,t,r)=>p.put(`/${r}`,t,{params:e}),putChangeStatus:async(e,t)=>p.put("/bulk",t,{params:e}),deleteCustomField:async e=>p.delete("/bulk",{data:e})}),m=({headers:e={},params:t={}}={})=>{const r=S("APP_COUNTRY_STATE_API"),o=S("APP_COUNTRY_STATE_API_KEY");return P.create({baseURL:`${r}/v1`,headers:{"Content-type":"application/json","X-CSCAPI-KEY":o,...e},params:t})},se=s("CountryStateServices",{getCountry:()=>m().get("/countries"),getState:e=>m().get(`/countries/${e}/states`),getCity:(e,t)=>m().get(`/countries/${e}/states/${t}/cities`)}),a=n({prefix:"/routine/v2"}),ne=s("ServiceCenterServices",{getList:e=>a.get("/service-center",{params:e}),postList:e=>a.post("/service-center",e),putList:(e,t)=>a.put(`/service-center/${e}`,t),putActivate:e=>a.put("/service-center/bulk",e),getDetailList:e=>a.get(`/service-center/${e}`),getListOptions:e=>a.get("/service-center/options",{params:e}),deleteList:e=>a.delete("/service-center",{params:e}),getActivities:e=>a.get("/service-activities",{params:e}),getActivityOptions:e=>a.get("/service-activities/options",{params:e}),getActivityDetail:e=>a.get(`/service-activities/${e}`),getActivityLog:e=>a.get(`/service-activities/${e}/activity-log`)}),F=n({prefix:"/settings-attribute/v2/brands"}),ie=s("BrandServices",{getDropdown:e=>F.get("/dropdown",{params:e})}),A=n({prefix:"/file-manager/v2"}),oe=s("FileManagerServices",{getStorageInformation:()=>A.get("/files/storage"),getFileManager:(e,t)=>A.get(`/${e}`,{params:t}),getFileManagerOption:(e,t)=>A.get(`/${e}/options`,{params:t}),recoverFiles:(e,t)=>A.put(`/${e}/recover`,t),deleteFiles:(e,t)=>A.delete(`/${e}`,{params:t}),deletePermanently:(e,t)=>A.delete(`/${e}/delete-permanent`,{params:t})}),d=n({prefix:"/utility/v2"}),ae=s("FileManagerServicesGo",{getStorageInformation:()=>d.get("/files/storage"),getFileManager:(e,t)=>d.get(`/${e}`,{params:t}),getFileManagerOption:(e,t)=>d.get(`/${e}/options`,{params:t}),recoverFiles:(e,t)=>d.put(`/${e}/recover`,t),deleteFiles:(e,t)=>d.delete(`/${e}`,{params:t}),deletePermanently:(e,t)=>d.delete(`/${e}/delete-permanent`,{params:t})}),u=n({prefix:"/iot/v2/reader"}),ge=s("ReaderServices",{getData:e=>u.get("/",{params:e}),getDataOptions:e=>u.get("/options",{params:e}),getActivityLogData:e=>u.get("/activity-log",{params:e}),getActivityLogOptions:e=>u.get("/activity-log/options",{params:e}),getDataById:e=>u.get(`/${e}`),getChangeLog:e=>u.get(`/${e.id}/change-log`,{params:e}),getChangeLogOptions:e=>u.get(`/${e.id}/change-log/options`,{params:e}),putData:(e,t)=>u.put(`/${e}`,t)})}}});
package/main.d.ts CHANGED
@@ -21,3 +21,4 @@ export { default as ServiceCenterServices } from './src/services/oldServiceCente
21
21
  export { default as BrandServices } from './src/services/oldBrand.service';
22
22
  export { default as FileManagerServices } from './src/services/oldFileManager.service';
23
23
  export { default as FileManagerServicesGo } from './src/services/fileManager.service';
24
+ export { default as ReaderServices } from './src/services/oldReader.service';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "1.0.0-alpha.35",
3
+ "version": "1.0.0-alpha.37",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Fixed Asset Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -0,0 +1,61 @@
1
+ import { MultiSelectOption } from '../types/options.type';
2
+ import { PermissionType, UserPermission } from '../types/role.type';
3
+ import { SimpleUserType, UserType } from '../types/user.type';
4
+ export type FetchUserRoleResponse = {
5
+ status: string;
6
+ message: string;
7
+ data: {
8
+ totalRecords: number;
9
+ data: UserPermission[];
10
+ isManager?: boolean;
11
+ };
12
+ };
13
+ export type FetchUserRoleOptionResponse = {
14
+ status: string;
15
+ message: string;
16
+ data: {
17
+ positionOptions?: MultiSelectOption[];
18
+ divisionOptions?: MultiSelectOption[];
19
+ };
20
+ };
21
+ export interface RoleAssignUserDto {
22
+ userIds: string[];
23
+ groupKeys: number[];
24
+ }
25
+ export interface RoleEditUserDto {
26
+ groupKeys?: number[];
27
+ permissions?: RolePermission;
28
+ permissionType?: PermissionType;
29
+ }
30
+ export interface RoleSetActiveDto {
31
+ ids: string[];
32
+ isActive: boolean;
33
+ }
34
+ export interface RolePermission {
35
+ create: boolean;
36
+ delete: boolean;
37
+ update: boolean;
38
+ view: boolean;
39
+ defaultView?: boolean;
40
+ }
41
+ export interface TransactionRoleUpdateUser {
42
+ role: UserType;
43
+ action: 'Add' | 'Delete';
44
+ user: SimpleUserType[];
45
+ level?: number;
46
+ }
47
+ export interface TransactionRoleUserManager {
48
+ user: SimpleUserType;
49
+ isActive?: boolean;
50
+ isTotalControl?: boolean;
51
+ _id?: string;
52
+ }
53
+ export interface TransactionRoleUserApprovalLevel {
54
+ action?: 'Add' | 'Delete' | 'Edit';
55
+ level?: number;
56
+ approvalType?: 'Or' | 'And';
57
+ users?: TransactionRoleUserManager[];
58
+ }
59
+ export interface GroupManageByParent {
60
+ value: boolean;
61
+ }
@@ -129,3 +129,11 @@ export type TransactionLogLoadingFilters = {
129
129
  userFullNameOptions?: boolean;
130
130
  assignedToOptions?: boolean;
131
131
  };
132
+ export type SelectUserOptionBoolean = {
133
+ positionOptions?: boolean;
134
+ divisionOptions?: boolean;
135
+ id?: string;
136
+ excludeId?: string;
137
+ group?: string;
138
+ isTotalControl?: boolean;
139
+ };
@@ -0,0 +1,13 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { ActivityLogOptionParams, ChangeLogOptionParams, ChangeLogParams, OptionParams, QueryParams } from '../types/reader';
3
+ declare const ReaderServices: {
4
+ getData: (params: QueryParams) => Promise<AxiosResponse>;
5
+ getDataOptions: (params: OptionParams) => Promise<AxiosResponse>;
6
+ getActivityLogData: (params: QueryParams) => Promise<AxiosResponse>;
7
+ getActivityLogOptions: (params: ActivityLogOptionParams) => Promise<AxiosResponse>;
8
+ getDataById: (id: string) => Promise<AxiosResponse>;
9
+ getChangeLog: (params: ChangeLogParams) => Promise<AxiosResponse>;
10
+ getChangeLogOptions: (params: ChangeLogOptionParams) => Promise<AxiosResponse>;
11
+ putData: (id: string, body: object) => Promise<AxiosResponse>;
12
+ };
13
+ export default ReaderServices;
@@ -0,0 +1,53 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { PermissionType, RoleAssignedUserQuery, RoleGroupInfo, TransactionRoleName } from '../types/role.type';
3
+ import { FetchUserRoleOptionResponse, FetchUserRoleResponse, GroupManageByParent, RoleAssignUserDto, RoleEditUserDto, RoleSetActiveDto, TransactionRoleUpdateUser, TransactionRoleUserApprovalLevel } from '../dto/role.dto';
4
+ import { SelectUserOptionBoolean } from '../dto/user.dto';
5
+ /**
6
+ * Object containing methods for interacting with role-related APIs.
7
+ */
8
+ declare const RoleServices: {
9
+ /**
10
+ * Retrieves the transaction role for the given group and transaction name.
11
+ * @param {string} groupId - The ID of the group to retrieve the transaction role for.
12
+ * @param {string} transactionName - The name of the transaction to retrieve the role for.
13
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
14
+ */
15
+ getTransactionRole: (groupId: RoleGroupInfo["_id"], transactionName: TransactionRoleName) => Promise<AxiosResponse>;
16
+ /**
17
+ * Updates the users assigned to the given transaction role.
18
+ * @param {string} groupId - The ID of the group the transaction role belongs to.
19
+ * @param {string} transactionName - The name of the transaction to update.
20
+ * @param {UpdateUser} body - The request body containing the updated user information.
21
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
22
+ */
23
+ putUpdateUsers: (groupId: RoleGroupInfo["_id"], transactionName: TransactionRoleName, body: TransactionRoleUpdateUser) => Promise<AxiosResponse>;
24
+ /**
25
+ * Updates the approval level for the given transaction role.
26
+ * @param {string} groupId - The ID of the group the transaction role belongs to.
27
+ * @param {string} transactionName - The name of the transaction to update.
28
+ * @param {UserApprovalLevel} body - The request body containing the updated approval level.
29
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
30
+ */
31
+ putUpdateLevel: (groupId: RoleGroupInfo["_id"], transactionName: TransactionRoleName, body: TransactionRoleUserApprovalLevel) => Promise<AxiosResponse>;
32
+ /**
33
+ * Updates the group management settings for the given transaction role.
34
+ * @param {string} groupId - The ID of the group the transaction role belongs to.
35
+ * @param {string} transactionName - The name of the transaction to update.
36
+ * @param {GroupManageByParent} body - The request body containing the updated management settings.
37
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
38
+ */
39
+ putUpdateGroupManage: (groupId: RoleGroupInfo["_id"], transactionName: TransactionRoleName, body: GroupManageByParent) => Promise<AxiosResponse>;
40
+ getAssignedUserAmounts: () => Promise<AxiosResponse>;
41
+ getPermissionUser: (permissionType?: PermissionType, params?: RoleAssignedUserQuery) => Promise<AxiosResponse<FetchUserRoleResponse>>;
42
+ getPermissionUserOptions: (permissionType?: PermissionType, params?: SelectUserOptionBoolean) => Promise<AxiosResponse<FetchUserRoleOptionResponse>>;
43
+ getUserGroups: (params?: {
44
+ users?: string;
45
+ }, permissionType?: PermissionType) => Promise<AxiosResponse>;
46
+ postAssignUser: (body: RoleAssignUserDto, permissionType?: PermissionType) => Promise<AxiosResponse>;
47
+ putEditUser: (body: RoleEditUserDto, roleId?: string) => Promise<AxiosResponse>;
48
+ putSetActive: (body?: RoleSetActiveDto, permissionType?: PermissionType) => Promise<AxiosResponse>;
49
+ deleteRemoveUser: (body: {
50
+ [key: string]: string[] | undefined;
51
+ }, permissionType?: PermissionType) => Promise<AxiosResponse>;
52
+ };
53
+ export default RoleServices;
@@ -1,16 +1,33 @@
1
1
  import { AxiosResponse } from 'axios';
2
- import { ChangePasswordBody, EditUserDTO, GetTransactionAdminLogOptionsResponse, GetUserLogAssignmentOptionsResponse, GetUserLogBorrowingOptionsResponse, SystemRoleFetchParams, TransactionLogFetchParams, TransactionLogLoadingFilters, TransactionLogType, TransactionRoleFetchParams, UserLogAssignmentFetchParams, UserLogAssignmentLoadingFilters, UserLogBorrowingFetchParams, UserLogBorrowingLoadingFilters } from '../dto/user.dto';
2
+ import { ChangePasswordBody, EditUserDTO, GetTransactionAdminLogOptionsResponse, GetUserLogAssignmentOptionsResponse, GetUserLogBorrowingOptionsResponse, SelectUserOptionBoolean, SystemRoleFetchParams, TransactionLogFetchParams, TransactionLogLoadingFilters, TransactionLogType, TransactionRoleFetchParams, UserLogAssignmentFetchParams, UserLogAssignmentLoadingFilters, UserLogBorrowingFetchParams, UserLogBorrowingLoadingFilters } from '../dto/user.dto';
3
3
  import { FetchDetailResponse, FetchListResponse, FetchOptionResponse } from '../types/fetchResponse.type';
4
4
  import { UserDetail } from '../types/user.type';
5
5
  import { UserSystemRole } from '../types/userSystemRole.type';
6
6
  import { MultiSelectOption } from '../types/options.type';
7
7
  import { UserTransactionRole } from '../types/userTransactionRole.type';
8
8
  import { UserLogAssignment, UserLogBorrowing } from '../types/userLog.type';
9
+ import { FetchUserRoleOptionResponse } from '../dto/role.dto';
9
10
  declare const UserServices: {
10
11
  reLogin: (body: {
11
12
  jwt: string;
12
13
  }) => Promise<AxiosResponse>;
13
14
  changePassword: (body: ChangePasswordBody) => Promise<AxiosResponse>;
15
+ /**
16
+ * Retrieves the user list as dropdown options.
17
+ * @returns {Promise<AxiosResponse>} - A promise that resolves to the response from the API.
18
+ */
19
+ getUserDropdown: (params?: {
20
+ excludeId?: string;
21
+ group?: string;
22
+ isConfirmed?: string;
23
+ useDefaultGroup?: string;
24
+ }) => Promise<AxiosResponse>;
25
+ getUserOptions: (params?: SelectUserOptionBoolean) => Promise<AxiosResponse<{
26
+ data: FetchUserRoleOptionResponse;
27
+ }>>;
28
+ getUserList: (params?: {
29
+ [key: string]: unknown;
30
+ }) => Promise<AxiosResponse>;
14
31
  getUserDetail: (id: string) => Promise<AxiosResponse<FetchDetailResponse<UserDetail>>>;
15
32
  putEditUser: (id: string, data: EditUserDTO) => Promise<AxiosResponse>;
16
33
  putDeleteProfilePicture: (id: string) => Promise<AxiosResponse>;
@@ -0,0 +1,55 @@
1
+ export type QueryParams = {
2
+ reportedDate?: number[];
3
+ manager?: number[];
4
+ group?: number[];
5
+ qrCode?: string;
6
+ status?: string;
7
+ deviceName?: number[];
8
+ sortOrder?: number;
9
+ sortBy?: string;
10
+ limit?: number;
11
+ page?: number;
12
+ search?: string;
13
+ readerId?: string;
14
+ type?: string;
15
+ activity?: string;
16
+ };
17
+ export type OptionParams = {
18
+ status?: string;
19
+ deviceNameOptions?: string;
20
+ activityOptions?: string;
21
+ managerOptions?: string;
22
+ assetNameOptions?: string;
23
+ };
24
+ export type ActivityLogOptionParams = {
25
+ foundGroupOptions?: string;
26
+ groupOptions?: string;
27
+ deviceNameOptions?: string;
28
+ activityOptions?: string;
29
+ managerOptions?: string;
30
+ assetNameOptions?: string;
31
+ borrowerOptions?: string;
32
+ conditionOptions?: string;
33
+ auditTypeOptions?: string;
34
+ assignedToOptions?: string;
35
+ originGroupOptions?: string;
36
+ destinationGroupOptions?: string;
37
+ type?: string;
38
+ readerId?: string;
39
+ activity?: string;
40
+ };
41
+ export type ChangeLogParams = {
42
+ id: string;
43
+ manager?: string[];
44
+ activity?: string[];
45
+ createdAt?: string[];
46
+ sortOrder?: number;
47
+ sortBy?: string;
48
+ limit?: number;
49
+ page?: number;
50
+ search?: string;
51
+ };
52
+ export type ChangeLogOptionParams = {
53
+ id: string;
54
+ managerOptions?: boolean;
55
+ };
@@ -1,3 +1,4 @@
1
+ import { RolePermission, TransactionRoleUserApprovalLevel, TransactionRoleUserManager } from '../dto/role.dto';
1
2
  export type Role = {
2
3
  _id: string;
3
4
  name: string;
@@ -7,10 +8,113 @@ export type Role = {
7
8
  isUsedByUser: boolean;
8
9
  key: number;
9
10
  };
10
- export type RolePermission = {
11
- create: boolean;
12
- view: boolean;
13
- update: boolean;
14
- delete: boolean;
15
- defaultView?: boolean;
11
+ export type RoleGroupInfo = {
12
+ _id: string;
13
+ name: string;
14
+ key: number;
15
+ isManagedByParent?: boolean;
16
+ hasSystemRoles?: {
17
+ group?: {
18
+ create: boolean;
19
+ view: boolean;
20
+ delete: boolean;
21
+ update: boolean;
22
+ };
23
+ create?: boolean;
24
+ view?: boolean;
25
+ delete?: boolean;
26
+ update?: boolean;
27
+ };
28
+ level?: number;
29
+ };
30
+ export type UserRole = {
31
+ _id: string;
32
+ isActive?: boolean;
33
+ key: number;
34
+ name?: string;
35
+ fullName?: string;
36
+ position: string;
37
+ division: string;
38
+ updatedAt?: Date;
39
+ systemRole?: {
40
+ _id: string;
41
+ group: RoleGroupInfo[];
42
+ };
43
+ };
44
+ export type RoleAssignedUserParams = {
45
+ isActive?: (string | boolean)[];
46
+ group?: string[];
47
+ position?: string[];
48
+ division?: string[];
49
+ updatedAt?: string[];
50
+ mappedGroup?: string[];
51
+ mappedDate?: number[];
52
+ };
53
+ export type RoleAssignedUserQuery = Partial<Record<keyof RoleAssignedUserParams, string>>;
54
+ export type TransactionRoleName = 'borrowingRole' | 'transferRole' | 'auditRole' | 'disposalRole' | 'maintenanceRole' | 'damagedRole' | 'repairRole' | 'missingRole' | 'trackingRole';
55
+ export type TransactionRoleType = {
56
+ group: RoleGroupInfo;
57
+ manager: TransactionRoleUserManager[];
58
+ monitoring: TransactionRoleUserManager[];
59
+ staff: TransactionRoleUserManager[];
60
+ approval: TransactionRoleUserApprovalLevel[];
61
+ };
62
+ export type RowNameType = {
63
+ [key: string]: string;
64
+ };
65
+ export type PermissionType = 'importData' | 'assetAttribute' | 'assetPolicies' | 'tagType' | 'depreciationGroup' | 'depreciationMethod' | 'openApi' | 'documentDeletion' | 'group' | 'userAndRole' | 'iotReader' | 'license' | 'purchaseDocument' | 'purchaseInformation' | 'tag' | 'registerAsset' | 'totalControl' | 'readOnly';
66
+ export type PermissionDetail = {
67
+ permission?: PermissionType;
68
+ name?: string;
69
+ object: string;
70
+ fileName?: string;
71
+ desc?: string;
72
+ isGroupRole?: boolean;
73
+ useCRUDPermission?: boolean;
74
+ };
75
+ export type SystemRoleData = {
76
+ globalPermissions: SystemRoleAssignedData[];
77
+ groupPermissions: SystemRoleAssignedData[];
78
+ };
79
+ export type SystemRoleAssignedData = {
80
+ _id?: string;
81
+ permission: PermissionType;
82
+ assignedUser: number;
83
+ name?: string;
84
+ };
85
+ export type UserTotalControlReadOnlyPermission = UserRole & {
86
+ _id: string;
87
+ formattedIsActive?: 'Active' | 'Inactive';
88
+ isActive: boolean;
89
+ isDefault?: boolean;
90
+ profilePictureSmall?: string;
91
+ profilePictureMedium?: string;
92
+ profilePictureBig?: string;
93
+ };
94
+ export type UserSystemRolePermission = {
95
+ _id: string;
96
+ profilePictureSmall?: string;
97
+ profilePictureMedium?: string;
98
+ profilePictureBig?: string;
99
+ managePermission: Partial<{
100
+ [T in PermissionType]: RolePermission;
101
+ }>;
102
+ permissions: Omit<RolePermission, 'totalControl' | 'readOnly'>;
103
+ user: UserRole & {
104
+ isDefault?: boolean;
105
+ profilePictureSmall?: string;
106
+ profilePictureMedium?: string;
107
+ profilePictureBig?: string;
108
+ };
109
+ group: RoleGroupInfo[];
110
+ formattedIsActive?: 'Active' | 'Inactive';
111
+ formattedCreate?: 'Active' | 'Inactive';
112
+ formattedView?: 'Active' | 'Inactive';
113
+ formattedUpdate?: 'Active' | 'Inactive';
114
+ formattedDelete?: 'Active' | 'Inactive';
115
+ isActive: boolean;
116
+ isReadOnly: boolean;
117
+ isTotalControl: boolean;
118
+ isDefault?: boolean;
16
119
  };
120
+ export type UserPermission<T extends 'system' | 'totalread' = 'system' | 'totalread'> = T extends 'system' ? UserSystemRolePermission : UserTotalControlReadOnlyPermission;
@@ -124,6 +124,12 @@ export type User = {
124
124
  profilePictureMedium: string;
125
125
  profilePictureBig: string;
126
126
  };
127
+ export type SimpleUserType = {
128
+ _id?: string;
129
+ fullName?: string;
130
+ isDefault?: boolean;
131
+ key?: number;
132
+ };
127
133
  export type UserDetail = {
128
134
  _id: string;
129
135
  key: number;
@@ -1,4 +1,4 @@
1
- import { RolePermission } from './role.type';
1
+ import { RolePermission } from '../dto/role.dto';
2
2
  export type UserGlobalRole = {
3
3
  /**
4
4
  * =================
@@ -1,5 +1,5 @@
1
+ import { RolePermission } from '../dto/role.dto';
1
2
  import { Group } from './group.type';
2
- import { RolePermission } from './role.type';
3
3
  export type UserGroupRole = {
4
4
  /**
5
5
  * =================