@tagsamurai/fats-api-services 1.0.0-alpha.26 → 1.0.0-alpha.27

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,16 +1,16 @@
1
- import _ from "axios";
2
- const T = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_ADMIN_API: "https://dev-admin-api.tagsamurai.com", VITE_APP_API: "https://dev-api.tagsamurai.com", VITE_APP_COUNTRY_STATE_API: "https://api.countrystatecity.in", VITE_APP_COUNTRY_STATE_API_KEY: "ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, S = (t = "APP_API") => T["VITE_" + t], n = (t = {}, e = !1) => {
3
- const { env: r = "APP_API", prefix: o = "", headers: d = {}, ...m } = t, f = `${S(r)}${o}`, P = JSON.parse(localStorage.getItem("user") ?? "{}"), y = P.jwt ?? P.token ?? "";
4
- return _.create({
1
+ import f from "axios";
2
+ const L = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_ADMIN_API: "https://dev-admin-api.tagsamurai.com", VITE_APP_API: "https://dev-api.tagsamurai.com", VITE_APP_COUNTRY_STATE_API: "https://api.countrystatecity.in", VITE_APP_COUNTRY_STATE_API_KEY: "ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, A = (t = "APP_API") => L["VITE_" + t], s = (t = {}, e = !1) => {
3
+ const { env: r = "APP_API", prefix: o = "", headers: d = {}, ...m } = t, T = `${A(r)}${o}`, $ = JSON.parse(localStorage.getItem("user") ?? "{}"), C = $.jwt ?? $.token ?? "";
4
+ return f.create({
5
5
  ...m,
6
- baseURL: f,
6
+ baseURL: T,
7
7
  headers: e ? d : {
8
8
  "Content-Type": "application/json",
9
- Authorization: `Bearer ${y}`,
9
+ Authorization: `Bearer ${C}`,
10
10
  ...d
11
11
  }
12
12
  });
13
- }, G = (t) => {
13
+ }, E = (t) => {
14
14
  if (!t || typeof t == "string")
15
15
  return;
16
16
  const e = {};
@@ -21,84 +21,84 @@ const T = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
21
21
  [r]: t[r]
22
22
  });
23
23
  }), e;
24
- }, b = (t) => {
24
+ }, N = (t) => {
25
25
  if (!t) return;
26
- const e = S("APP_TAGSAMURAI_API");
26
+ const e = A("APP_TAGSAMURAI_API");
27
27
  return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
28
- }, i = n({
28
+ }, g = s({
29
29
  prefix: "/settings-attribute/v2",
30
30
  env: "APP_TAGSAMURAI_API"
31
- }), D = {
31
+ }), R = {
32
32
  getGroupCategory: (t, e) => {
33
33
  const r = t === "category" ? t : "groups";
34
- return i.get(`/${r}/tree`, { params: e });
34
+ return g.get(`/${r}/tree`, { params: e });
35
35
  },
36
36
  getGroupCategoryList: (t, e, r) => {
37
37
  const o = t === "category" ? t : "groups";
38
- return i.get(`/${o}/${e}`, { params: r });
38
+ return g.get(`/${o}/${e}`, { params: r });
39
39
  },
40
40
  getNames: (t) => {
41
41
  const e = t === "category" ? t : "groups";
42
- return i.get(`/${e}/names`);
42
+ return g.get(`/${e}/names`);
43
43
  },
44
44
  postCreateGroupCategory: (t, e) => {
45
45
  const r = t === "category" ? t : "groups";
46
- return i.post(`/${r}`, e);
46
+ return g.post(`/${r}`, e);
47
47
  },
48
48
  putEditGroupCategory: (t, e, r) => {
49
49
  const o = t === "category" ? t : "groups";
50
- return i.put(`/${o}/${r}`, e);
50
+ return g.put(`/${o}/${r}`, e);
51
51
  },
52
- putMoveGroup: (t, e) => i.put(`/groups/${e}/move-group`, t),
53
- putEditBulkGroups: async (t) => i.put("/groups/bulk", t),
52
+ putMoveGroup: (t, e) => g.put(`/groups/${e}/move-group`, t),
53
+ putEditBulkGroups: async (t) => g.put("/groups/bulk", t),
54
54
  deleteGroupCategory: (t, e, r) => {
55
55
  const o = t === "category" ? t : "groups";
56
- return i.delete(`/${o}/${r}`, { data: e });
56
+ return g.delete(`/${o}/${r}`, { data: e });
57
57
  }
58
- }, g = n({
58
+ }, u = s({
59
59
  prefix: "/settings-attribute-go/v2"
60
- }), N = {
60
+ }), x = {
61
61
  getGroupCategory: (t, e) => {
62
62
  const r = t === "category" ? t : "groups";
63
- return g.get(`/${r}/tree`, { params: e });
63
+ return u.get(`/${r}/tree`, { params: e });
64
64
  },
65
65
  getGroupCategoryList: (t, e) => {
66
66
  const r = t === "category" ? t : "groups";
67
- return g.get(`/${r}/${e}`);
67
+ return u.get(`/${r}/${e}`);
68
68
  },
69
69
  getNames: (t) => {
70
70
  const e = t === "category" ? t : "groups";
71
- return g.get(`/${e}/names`);
71
+ return u.get(`/${e}/names`);
72
72
  },
73
73
  postCreateGroupCategory: (t, e) => {
74
74
  const r = t === "category" ? t : "groups";
75
- return g.post(`/${r}`, e);
75
+ return u.post(`/${r}`, e);
76
76
  },
77
77
  putEditGroupCategory: (t, e, r) => {
78
78
  const o = t === "category" ? t : "groups";
79
- return g.put(`/${o}/${r}`, e);
79
+ return u.put(`/${o}/${r}`, e);
80
80
  },
81
81
  deleteGroupCategory: (t, e, r) => {
82
82
  const o = t === "category" ? t : "groups";
83
- return g.delete(`/${o}/${r}`, { data: e });
83
+ return u.delete(`/${o}/${r}`, { data: e });
84
84
  }
85
- }, C = n({
85
+ }, O = s({
86
86
  prefix: "/v2",
87
87
  env: "APP_LOGS_NOTIFICATION_API"
88
- }), E = {
89
- getTotalApprovals: () => C.get("/approval/count")
90
- }, c = n({
88
+ }), F = {
89
+ getTotalApprovals: () => O.get("/approval/count")
90
+ }, p = s({
91
91
  prefix: "/v2",
92
92
  env: "APP_LOGS_NOTIFICATION_API"
93
- }), R = {
94
- getActionLog: (t) => c.get("/change-log", { params: t }),
95
- getActionLogOption: (t) => c.get("/change-log/options", { params: t }),
96
- getSessionLogList: (t) => c.get("/session-log", { params: t }),
97
- getUserDetailSystemLogList: (t) => c.get("/change-log", { params: t }),
98
- getUserDetailSystemLogOption: (t) => c.get("/change-log/options", { params: t })
99
- }, a = n({
93
+ }), k = {
94
+ getActionLog: (t) => p.get("/change-log", { params: t }),
95
+ getActionLogOption: (t) => p.get("/change-log/options", { params: t }),
96
+ getSessionLogList: (t) => p.get("/session-log", { params: t }),
97
+ getUserDetailSystemLogList: (t) => p.get("/change-log", { params: t }),
98
+ getUserDetailSystemLogOption: (t) => p.get("/change-log/options", { params: t })
99
+ }, a = s({
100
100
  prefix: "/assets/v2/assets"
101
- }), x = {
101
+ }), w = {
102
102
  getScanTag: (t) => a.get("/scan", { params: { tag: t } }),
103
103
  getAllAssets: (t) => a.get("/", { params: t }),
104
104
  getAvailableAssets: (t) => a.get("/available", { params: t }),
@@ -115,33 +115,33 @@ const T = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
115
115
  };
116
116
  return a.get("/by-id", { params: r });
117
117
  }
118
- }, L = n({
118
+ }, U = s({
119
119
  prefix: "/tracking/v2/missing"
120
- }), F = {
120
+ }), M = {
121
121
  putFoundAsset: (t, e) => {
122
122
  const r = { ids: [t], serialNumber: e };
123
- return L.put("/found", r);
123
+ return U.put("/found", r);
124
124
  }
125
- }, I = n({
125
+ }, S = s({
126
126
  prefix: "/v2/notification",
127
127
  env: "APP_LOGS_NOTIFICATION_API"
128
- }), k = {
129
- getNotifications: (t) => I.get("/", { params: t }),
130
- readNotification: (t) => I.put(`/${t}`)
131
- }, O = n({
128
+ }), B = {
129
+ getNotifications: (t) => S.get("/", { params: t }),
130
+ readNotification: (t) => S.put(`/${t}`)
131
+ }, h = s({
132
132
  prefix: "/v2/session-log",
133
133
  env: "APP_LOGS_NOTIFICATION_API"
134
- }), w = {
135
- postLogout: () => O.post("/logout")
136
- }, l = n({
134
+ }), V = {
135
+ postLogout: () => h.post("/logout")
136
+ }, v = s({
137
137
  prefix: "/tag/v2"
138
- }), M = {
139
- getScanQR: (t) => l.get("/qr", { params: { tag: t } }),
140
- getScanRFID: (t) => l.get("/rfid", { params: { tag: t } }),
141
- getRFIDQRTAG: (t) => l.get("/rfid-qr/scan", { params: t })
142
- }, U = n({
138
+ }), Y = {
139
+ getScanQR: (t) => v.get("/qr", { params: { tag: t } }),
140
+ getScanRFID: (t) => v.get("/rfid", { params: { tag: t } }),
141
+ getRFIDQRTAG: (t) => v.get("/rfid-qr/scan", { params: t })
142
+ }, G = s({
143
143
  prefix: "/tracking/v2/tracking"
144
- }), V = {
144
+ }), j = {
145
145
  putFoundAsset: (t, e, r) => {
146
146
  const o = {
147
147
  tag: t,
@@ -149,20 +149,20 @@ const T = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
149
149
  serialNumber: r,
150
150
  type: "Global"
151
151
  };
152
- return U.put("/found", { params: o });
152
+ return G.put("/found", { params: o });
153
153
  }
154
- }, s = n({
154
+ }, n = s({
155
155
  prefix: "/settings-user-role/v2"
156
- }), B = {
157
- reLogin: (t) => s.post("/auth/login", t),
158
- changePassword: (t) => s.put("/users/change-password", t),
159
- getUserDetail: (t) => s.get(`/users/${t}`),
156
+ }), J = {
157
+ reLogin: (t) => n.post("/auth/login", t),
158
+ changePassword: (t) => n.put("/users/change-password", t),
159
+ getUserDetail: (t) => n.get(`/users/${t}`),
160
160
  putEditUser: (t, e) => {
161
161
  const r = { "Content-Type": "multipart/form-data" };
162
- return s.put(`/users/${t}`, e, { headers: r });
162
+ return n.put(`/users/${t}`, e, { headers: r });
163
163
  },
164
- putDeleteProfilePicture: (t) => s.put(`/users/${t}/delete-profile-picture`),
165
- putCancelEmailChange: (t, e) => s.put("/auth/confirm-email-change/cancel", {
164
+ putDeleteProfilePicture: (t) => n.put(`/users/${t}/delete-profile-picture`),
165
+ putCancelEmailChange: (t, e) => n.put("/auth/confirm-email-change/cancel", {
166
166
  user: t,
167
167
  companyCode: e
168
168
  }),
@@ -172,39 +172,39 @@ const T = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
172
172
  * @param type {"Global" | "Group"} Whether the system role's type is global or group
173
173
  * @param params {Record<string, unknown>}
174
174
  */
175
- getUserDetailSystemRoles: (t, e, r) => s.get(`/user-detail/${t}/system-roles`, {
175
+ getUserDetailSystemRoles: (t, e, r) => n.get(`/user-detail/${t}/system-roles`, {
176
176
  params: {
177
177
  ...r,
178
178
  type: e
179
179
  }
180
180
  }),
181
181
  // User Detail
182
- getUserDetailSystemRoleList: (t, e) => s.get(`/user-detail/${t}/system-role-list`, { params: e }),
183
- getUserDetailSystemRoleOptions: (t, e) => s.get(`/user-detail/${t}/system-role/option`, { params: e }),
184
- getUserDetailTransactionRoleList: (t, e) => s.get(`/user-detail/${t}/transaction-role-list`, { params: e }),
185
- getUserDetailUserLogBorrowingList: (t, e) => s.get(`/users-log/${t}/borrowing`, { params: e }),
186
- getUserDetailUserLogAssignmentList: (t, e) => s.get(`/users-log/${t}/assignment`, { params: e }),
187
- getUserDetailUserLogBorrowingOption: (t, e) => s.get(`/users-log/${t}/borrowing/option`, { params: e }),
188
- getUserDetailUserLogAssignmentOption: (t, e) => s.get(`/users-log/${t}/assignment/option`, { params: e }),
189
- getUserDetailTransactionAdminLogList: (t, e) => s.get(`/users-log/${t}/transaction-log`, { params: e }),
190
- getUserDetailTransactionAdminLogOption: (t, e) => s.get(`/users-log/${t}/transaction-log/option`, { params: e })
191
- }, p = n({
182
+ getUserDetailSystemRoleList: (t, e) => n.get(`/user-detail/${t}/system-role-list`, { params: e }),
183
+ getUserDetailSystemRoleOptions: (t, e) => n.get(`/user-detail/${t}/system-role/option`, { params: e }),
184
+ getUserDetailTransactionRoleList: (t, e) => n.get(`/user-detail/${t}/transaction-role-list`, { params: e }),
185
+ getUserDetailUserLogBorrowingList: (t, e) => n.get(`/users-log/${t}/borrowing`, { params: e }),
186
+ getUserDetailUserLogAssignmentList: (t, e) => n.get(`/users-log/${t}/assignment`, { params: e }),
187
+ getUserDetailUserLogBorrowingOption: (t, e) => n.get(`/users-log/${t}/borrowing/option`, { params: e }),
188
+ getUserDetailUserLogAssignmentOption: (t, e) => n.get(`/users-log/${t}/assignment/option`, { params: e }),
189
+ getUserDetailTransactionAdminLogList: (t, e) => n.get(`/users-log/${t}/transaction-log`, { params: e }),
190
+ getUserDetailTransactionAdminLogOption: (t, e) => n.get(`/users-log/${t}/transaction-log/option`, { params: e })
191
+ }, l = s({
192
192
  env: "APP_ADMIN_API",
193
193
  prefix: "/settings-attribute/languages"
194
- }), j = {
194
+ }), q = {
195
195
  /**
196
196
  * Fetch all translation messages for a specific locale.
197
197
  * @param locale The locale code (e.g., 'en', 'id').
198
198
  * @returns A promise resolving to a key-value record of messages.
199
199
  */
200
- getMessages: (t) => p.get(`/${t}/translations`),
200
+ getMessages: (t) => l.get(`/${t}/translations`),
201
201
  /**
202
202
  * Fetch all available lang options for LanguageDropdown and LanguageSwitcher
203
203
  *
204
204
  * @returns Promise Array of options
205
205
  */
206
206
  getLanguageOptions: async () => {
207
- const { data: t } = await p.get(
207
+ const { data: t } = await l.get(
208
208
  "/dropdown"
209
209
  );
210
210
  return t.data;
@@ -216,7 +216,7 @@ const T = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
216
216
  * @returns Promise LanguageMeta
217
217
  */
218
218
  getLanguageOptionMeta: async (t) => {
219
- const { data: e } = await p.get(
219
+ const { data: e } = await l.get(
220
220
  "/dropdown/" + t
221
221
  );
222
222
  return e.data;
@@ -228,56 +228,93 @@ const T = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
228
228
  * @param locale Target locale code.
229
229
  */
230
230
  translateText: async (t, e) => {
231
- const { data: r } = await p.post("/translate", {
231
+ const { data: r } = await l.post("/translate", {
232
232
  q: t,
233
233
  target: e
234
234
  });
235
235
  return r.data.translations[t];
236
236
  }
237
- }, $ = n({
237
+ }, _ = s({
238
238
  prefix: "/dashboard/v2/dashboard"
239
- }), J = {
240
- getLatestTask: (t) => $.get("/latest-task", { params: t }),
241
- getSummary: (t) => $.get("/summary", { params: t })
242
- }, A = n({
239
+ }), K = {
240
+ getLatestTask: (t) => _.get("/latest-task", { params: t }),
241
+ getSummary: (t) => _.get("/summary", { params: t })
242
+ }, P = s({
243
243
  prefix: "/alias-code/api/alias-code"
244
- }), Y = {
245
- getAliasCode: () => A.get("/"),
246
- postAliasCode: (t) => A.post("/", t),
247
- getAliasCodeList: (t) => A.get(`/${t.object}/code-list`, { params: t })
248
- }, v = n({
244
+ }), W = {
245
+ getAliasCode: () => P.get("/"),
246
+ postAliasCode: (t) => P.post("/", t),
247
+ getAliasCodeList: (t) => P.get(`/${t.object}/code-list`, { params: t })
248
+ }, y = s({
249
249
  prefix: "/settings-attribute/v2/general-settings"
250
- }), q = {
251
- getGeneralSettings: () => v.get("/"),
252
- putUpdateGeneralSettings: (t) => v.put("/", t)
253
- }, u = n({
250
+ }), z = {
251
+ getGeneralSettings: () => y.get("/"),
252
+ putUpdateGeneralSettings: (t) => y.put("/", t)
253
+ }, c = s({
254
254
  prefix: "/settings-attribute/v2/custom-field"
255
- }), W = {
256
- getCustomField: async (t) => u.get("/", { params: t }),
257
- getOptions: async (t) => u.get("/options", { params: t }),
258
- postCreateCustomField: async (t, e) => u.post("/", e, { params: t }),
259
- putEditCustomField: async (t, e, r) => u.put(`/${r}`, e, { params: t }),
260
- putChangeStatus: async (t, e) => u.put("/bulk", e, { params: t }),
261
- deleteCustomField: async (t) => u.delete("/bulk", { data: t })
255
+ }), Q = {
256
+ getCustomField: async (t) => c.get("/", { params: t }),
257
+ getOptions: async (t) => c.get("/options", { params: t }),
258
+ postCreateCustomField: async (t, e) => c.post("/", e, { params: t }),
259
+ putEditCustomField: async (t, e, r) => c.put(`/${r}`, e, { params: t }),
260
+ putChangeStatus: async (t, e) => c.put("/bulk", e, { params: t }),
261
+ deleteCustomField: async (t) => c.delete("/bulk", { data: t })
262
+ }, I = ({ headers: t = {}, params: e = {} } = {}) => {
263
+ const r = A("APP_COUNTRY_STATE_API"), o = A("APP_COUNTRY_STATE_API_KEY");
264
+ return f.create({
265
+ baseURL: `${r}/v1`,
266
+ headers: {
267
+ "Content-type": "application/json",
268
+ "X-CSCAPI-KEY": o,
269
+ ...t
270
+ },
271
+ params: e
272
+ });
273
+ }, Z = {
274
+ getCountry: () => I().get("/countries"),
275
+ getState: (t) => I().get(`/countries/${t}/states`),
276
+ getCity: (t, e) => I().get(`/countries/${t}/states/${e}/cities`)
277
+ }, i = s({
278
+ prefix: "/routine/v2"
279
+ }), H = {
280
+ getList: (t) => i.get("/service-center", { params: t }),
281
+ postList: (t) => i.post("/service-center", t),
282
+ putList: (t, e) => i.put(`/service-center/${t}`, e),
283
+ putActivate: (t) => i.put("/service-center/bulk", t),
284
+ getDetailList: (t) => i.get(`/service-center/${t}`),
285
+ getListOptions: (t) => i.get("/service-center/options", { params: t }),
286
+ deleteList: (t) => i.delete("/service-center", { params: t }),
287
+ // Activities
288
+ getActivities: (t) => i.get("/service-activities", { params: t }),
289
+ getActivityOptions: (t) => i.get("/service-activities/options", { params: t }),
290
+ getActivityDetail: (t) => i.get(`/service-activities/${t}`),
291
+ getActivityLog: (t) => i.get(`/service-activities/${t}/activity-log`)
292
+ }, b = s({
293
+ prefix: "/settings-attribute/v2/brands"
294
+ }), X = {
295
+ getDropdown: (t) => b.get("/dropdown", { params: t })
262
296
  };
263
297
  export {
264
- Y as AliasCodeServices,
265
- x as AssetServices,
266
- R as ChangelogServices,
267
- W as CustomFieldServices,
268
- J as DashboardServices,
269
- q as GeneralSettingsServices,
270
- D as GroupCategoryServices,
271
- N as GroupCategoryServicesGo,
272
- j as I18nService,
273
- F as MissingServices,
274
- E as NotificationApprovalServices,
275
- k as NotificationServices,
276
- w as SessionLogServices,
277
- M as TAGServices,
278
- V as TrackingServices,
279
- B as UserServices,
280
- S as getBaseURL,
281
- b as getImageURL,
282
- G as queryParamsStringfy
298
+ W as AliasCodeServices,
299
+ w as AssetServices,
300
+ X as BrandServices,
301
+ k as ChangelogServices,
302
+ Z as CountryStateServices,
303
+ Q as CustomFieldServices,
304
+ K as DashboardServices,
305
+ z as GeneralSettingsServices,
306
+ R as GroupCategoryServices,
307
+ x as GroupCategoryServicesGo,
308
+ q as I18nService,
309
+ M as MissingServices,
310
+ F as NotificationApprovalServices,
311
+ B as NotificationServices,
312
+ H as ServiceCenterServices,
313
+ V as SessionLogServices,
314
+ Y as TAGServices,
315
+ j as TrackingServices,
316
+ J as UserServices,
317
+ A as getBaseURL,
318
+ N as getImageURL,
319
+ E as queryParamsStringfy
283
320
  };
@@ -1 +1 @@
1
- System.register(["axios"],function(s,G){"use strict";var v;return{setters:[A=>{v=A.default}],execute:function(){const A={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=s("getBaseURL",(t="APP_API")=>A["VITE_"+t]),n=(t={},e=!1)=>{const{env:r="APP_API",prefix:i="",headers:m={},...O}=t,U=`${P(r)}${i}`,y=JSON.parse(localStorage.getItem("user")??"{}"),h=y.jwt??y.token??"";return v.create({...O,baseURL:U,headers:e?m:{"Content-Type":"application/json",Authorization:`Bearer ${h}`,...m}})},b=s("queryParamsStringfy",t=>{if(!t||typeof t=="string")return;const e={};return Object.keys(t).forEach(r=>{Array.isArray(t[r])?t[r].length>0&&Object.assign(e,{[r]:JSON.stringify(t[r])}):t[r]!==void 0&&Object.assign(e,{[r]:t[r]})}),e}),D=s("getImageURL",t=>{if(!t)return;const e=P("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),g=n({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),N=s("GroupCategoryServices",{getGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return g.get(`/${r}/tree`,{params:e})},getGroupCategoryList:(t,e,r)=>{const i=t==="category"?t:"groups";return g.get(`/${i}/${e}`,{params:r})},getNames:t=>{const e=t==="category"?t:"groups";return g.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return g.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const i=t==="category"?t:"groups";return g.put(`/${i}/${r}`,e)},putMoveGroup:(t,e)=>g.put(`/groups/${e}/move-group`,t),putEditBulkGroups:async t=>g.put("/groups/bulk",t),deleteGroupCategory:(t,e,r)=>{const i=t==="category"?t:"groups";return g.delete(`/${i}/${r}`,{data:e})}}),u=n({prefix:"/settings-attribute-go/v2"}),R=s("GroupCategoryServicesGo",{getGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return u.get(`/${r}/tree`,{params:e})},getGroupCategoryList:(t,e)=>{const r=t==="category"?t:"groups";return u.get(`/${r}/${e}`)},getNames:t=>{const e=t==="category"?t:"groups";return u.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return u.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const i=t==="category"?t:"groups";return u.put(`/${i}/${r}`,e)},deleteGroupCategory:(t,e,r)=>{const i=t==="category"?t:"groups";return u.delete(`/${i}/${r}`,{data:e})}}),_=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),E=s("NotificationApprovalServices",{getTotalApprovals:()=>_.get("/approval/count")}),p=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),F=s("ChangelogServices",{getActionLog:t=>p.get("/change-log",{params:t}),getActionLogOption:t=>p.get("/change-log/options",{params:t}),getSessionLogList:t=>p.get("/session-log",{params:t}),getUserDetailSystemLogList:t=>p.get("/change-log",{params:t}),getUserDetailSystemLogOption:t=>p.get("/change-log/options",{params:t})}),a=n({prefix:"/assets/v2/assets"}),k=s("AssetServices",{getScanTag:t=>a.get("/scan",{params:{tag:t}}),getAllAssets:t=>a.get("/",{params:t}),getAvailableAssets:t=>a.get("/available",{params:t}),scanAsset:t=>a.get("",{params:{tag:t}}),getAssetsById:(t,e)=>a.get("/by-id",{params:{_id:t,...e}}),getOptions:(t,e)=>a.get(t?`/${t}/options`:"/options",{params:e}),getUnlinkedAssets:t=>a.get("/unlinked",{params:t}),getAssetDetail:(t,e)=>a.get(`/${t}`,{params:e}),getLinkedAssetFamily:t=>a.get("/family",{params:{id:t}}),matchAssetWithTag:(t,e)=>{const r={_id:JSON.stringify([t]),tag:e};return a.get("/by-id",{params:r})}}),T=n({prefix:"/tracking/v2/missing"}),w=s("MissingServices",{putFoundAsset:(t,e)=>{const r={ids:[t],serialNumber:e};return T.put("/found",r)}}),I=n({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),M=s("NotificationServices",{getNotifications:t=>I.get("/",{params:t}),readNotification:t=>I.put(`/${t}`)}),C=n({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),V=s("SessionLogServices",{postLogout:()=>C.post("/logout")}),d=n({prefix:"/tag/v2"}),B=s("TAGServices",{getScanQR:t=>d.get("/qr",{params:{tag:t}}),getScanRFID:t=>d.get("/rfid",{params:{tag:t}}),getRFIDQRTAG:t=>d.get("/rfid-qr/scan",{params:t})}),L=n({prefix:"/tracking/v2/tracking"}),j=s("TrackingServices",{putFoundAsset:(t,e,r)=>{const i={tag:t,group:e,serialNumber:r,type:"Global"};return L.put("/found",{params:i})}}),o=n({prefix:"/settings-user-role/v2"}),q=s("UserServices",{reLogin:t=>o.post("/auth/login",t),changePassword:t=>o.put("/users/change-password",t),getUserDetail:t=>o.get(`/users/${t}`),putEditUser:(t,e)=>{const r={"Content-Type":"multipart/form-data"};return o.put(`/users/${t}`,e,{headers:r})},putDeleteProfilePicture:t=>o.put(`/users/${t}/delete-profile-picture`),putCancelEmailChange:(t,e)=>o.put("/auth/confirm-email-change/cancel",{user:t,companyCode:e}),getUserDetailSystemRoles:(t,e,r)=>o.get(`/user-detail/${t}/system-roles`,{params:{...r,type:e}}),getUserDetailSystemRoleList:(t,e)=>o.get(`/user-detail/${t}/system-role-list`,{params:e}),getUserDetailSystemRoleOptions:(t,e)=>o.get(`/user-detail/${t}/system-role/option`,{params:e}),getUserDetailTransactionRoleList:(t,e)=>o.get(`/user-detail/${t}/transaction-role-list`,{params:e}),getUserDetailUserLogBorrowingList:(t,e)=>o.get(`/users-log/${t}/borrowing`,{params:e}),getUserDetailUserLogAssignmentList:(t,e)=>o.get(`/users-log/${t}/assignment`,{params:e}),getUserDetailUserLogBorrowingOption:(t,e)=>o.get(`/users-log/${t}/borrowing/option`,{params:e}),getUserDetailUserLogAssignmentOption:(t,e)=>o.get(`/users-log/${t}/assignment/option`,{params:e}),getUserDetailTransactionAdminLogList:(t,e)=>o.get(`/users-log/${t}/transaction-log`,{params:e}),getUserDetailTransactionAdminLogOption:(t,e)=>o.get(`/users-log/${t}/transaction-log/option`,{params:e})}),l=n({env:"APP_ADMIN_API",prefix:"/settings-attribute/languages"}),J=s("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:r}=await l.post("/translate",{q:t,target:e});return r.data.translations[t]}}),$=n({prefix:"/dashboard/v2/dashboard"}),Y=s("DashboardServices",{getLatestTask:t=>$.get("/latest-task",{params:t}),getSummary:t=>$.get("/summary",{params:t})}),S=n({prefix:"/alias-code/api/alias-code"}),x=s("AliasCodeServices",{getAliasCode:()=>S.get("/"),postAliasCode:t=>S.post("/",t),getAliasCodeList:t=>S.get(`/${t.object}/code-list`,{params:t})}),f=n({prefix:"/settings-attribute/v2/general-settings"}),W=s("GeneralSettingsServices",{getGeneralSettings:()=>f.get("/"),putUpdateGeneralSettings:t=>f.put("/",t)}),c=n({prefix:"/settings-attribute/v2/custom-field"}),z=s("CustomFieldServices",{getCustomField:async t=>c.get("/",{params:t}),getOptions:async t=>c.get("/options",{params:t}),postCreateCustomField:async(t,e)=>c.post("/",e,{params:t}),putEditCustomField:async(t,e,r)=>c.put(`/${r}`,e,{params:t}),putChangeStatus:async(t,e)=>c.put("/bulk",e,{params:t}),deleteCustomField:async t=>c.delete("/bulk",{data:t})})}}});
1
+ System.register(["axios"],function(s,E){"use strict";var d;return{setters:[S=>{d=S.default}],execute:function(){const S={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_ADMIN_API:"https://dev-admin-api.tagsamurai.com",VITE_APP_API:"https://dev-api.tagsamurai.com",VITE_APP_COUNTRY_STATE_API:"https://api.countrystatecity.in",VITE_APP_COUNTRY_STATE_API_KEY:"ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==",VITE_APP_LOGS_NOTIFICATION_API:"https://dev-api-logs-notification.tagsamurai.com",VITE_APP_TAGSAMURAI_API:"https://dev-api.tagsamurai.com"},A=s("getBaseURL",(t="APP_API")=>S["VITE_"+t]),n=(t={},e=!1)=>{const{env:r="APP_API",prefix:o="",headers:y={},...G}=t,b=`${A(r)}${o}`,C=JSON.parse(localStorage.getItem("user")??"{}"),D=C.jwt??C.token??"";return d.create({...G,baseURL:b,headers:e?y:{"Content-Type":"application/json",Authorization:`Bearer ${D}`,...y}})},N=s("queryParamsStringfy",t=>{if(!t||typeof t=="string")return;const e={};return Object.keys(t).forEach(r=>{Array.isArray(t[r])?t[r].length>0&&Object.assign(e,{[r]:JSON.stringify(t[r])}):t[r]!==void 0&&Object.assign(e,{[r]:t[r]})}),e}),R=s("getImageURL",t=>{if(!t)return;const e=A("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),c=n({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),F=s("GroupCategoryServices",{getGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return c.get(`/${r}/tree`,{params:e})},getGroupCategoryList:(t,e,r)=>{const o=t==="category"?t:"groups";return c.get(`/${o}/${e}`,{params:r})},getNames:t=>{const e=t==="category"?t:"groups";return c.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return c.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return c.put(`/${o}/${r}`,e)},putMoveGroup:(t,e)=>c.put(`/groups/${e}/move-group`,t),putEditBulkGroups:async t=>c.put("/groups/bulk",t),deleteGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return c.delete(`/${o}/${r}`,{data:e})}}),u=n({prefix:"/settings-attribute-go/v2"}),k=s("GroupCategoryServicesGo",{getGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return u.get(`/${r}/tree`,{params:e})},getGroupCategoryList:(t,e)=>{const r=t==="category"?t:"groups";return u.get(`/${r}/${e}`)},getNames:t=>{const e=t==="category"?t:"groups";return u.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return u.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return u.put(`/${o}/${r}`,e)},deleteGroupCategory:(t,e,r)=>{const o=t==="category"?t:"groups";return u.delete(`/${o}/${r}`,{data:e})}}),T=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),w=s("NotificationApprovalServices",{getTotalApprovals:()=>T.get("/approval/count")}),l=n({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),B=s("ChangelogServices",{getActionLog:t=>l.get("/change-log",{params:t}),getActionLogOption:t=>l.get("/change-log/options",{params:t}),getSessionLogList:t=>l.get("/session-log",{params:t}),getUserDetailSystemLogList:t=>l.get("/change-log",{params:t}),getUserDetailSystemLogOption:t=>l.get("/change-log/options",{params:t})}),g=n({prefix:"/assets/v2/assets"}),M=s("AssetServices",{getScanTag:t=>g.get("/scan",{params:{tag:t}}),getAllAssets:t=>g.get("/",{params:t}),getAvailableAssets:t=>g.get("/available",{params:t}),scanAsset:t=>g.get("",{params:{tag:t}}),getAssetsById:(t,e)=>g.get("/by-id",{params:{_id:t,...e}}),getOptions:(t,e)=>g.get(t?`/${t}/options`:"/options",{params:e}),getUnlinkedAssets:t=>g.get("/unlinked",{params:t}),getAssetDetail:(t,e)=>g.get(`/${t}`,{params:e}),getLinkedAssetFamily:t=>g.get("/family",{params:{id:t}}),matchAssetWithTag:(t,e)=>{const r={_id:JSON.stringify([t]),tag:e};return g.get("/by-id",{params:r})}}),L=n({prefix:"/tracking/v2/missing"}),V=s("MissingServices",{putFoundAsset:(t,e)=>{const r={ids:[t],serialNumber:e};return L.put("/found",r)}}),_=n({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),Y=s("NotificationServices",{getNotifications:t=>_.get("/",{params:t}),readNotification:t=>_.put(`/${t}`)}),O=n({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),j=s("SessionLogServices",{postLogout:()=>O.post("/logout")}),P=n({prefix:"/tag/v2"}),q=s("TAGServices",{getScanQR:t=>P.get("/qr",{params:{tag:t}}),getScanRFID:t=>P.get("/rfid",{params:{tag:t}}),getRFIDQRTAG:t=>P.get("/rfid-qr/scan",{params:t})}),U=n({prefix:"/tracking/v2/tracking"}),J=s("TrackingServices",{putFoundAsset:(t,e,r)=>{const o={tag:t,group:e,serialNumber:r,type:"Global"};return U.put("/found",{params:o})}}),i=n({prefix:"/settings-user-role/v2"}),K=s("UserServices",{reLogin:t=>i.post("/auth/login",t),changePassword:t=>i.put("/users/change-password",t),getUserDetail:t=>i.get(`/users/${t}`),putEditUser:(t,e)=>{const r={"Content-Type":"multipart/form-data"};return i.put(`/users/${t}`,e,{headers:r})},putDeleteProfilePicture:t=>i.put(`/users/${t}/delete-profile-picture`),putCancelEmailChange:(t,e)=>i.put("/auth/confirm-email-change/cancel",{user:t,companyCode:e}),getUserDetailSystemRoles:(t,e,r)=>i.get(`/user-detail/${t}/system-roles`,{params:{...r,type:e}}),getUserDetailSystemRoleList:(t,e)=>i.get(`/user-detail/${t}/system-role-list`,{params:e}),getUserDetailSystemRoleOptions:(t,e)=>i.get(`/user-detail/${t}/system-role/option`,{params:e}),getUserDetailTransactionRoleList:(t,e)=>i.get(`/user-detail/${t}/transaction-role-list`,{params:e}),getUserDetailUserLogBorrowingList:(t,e)=>i.get(`/users-log/${t}/borrowing`,{params:e}),getUserDetailUserLogAssignmentList:(t,e)=>i.get(`/users-log/${t}/assignment`,{params:e}),getUserDetailUserLogBorrowingOption:(t,e)=>i.get(`/users-log/${t}/borrowing/option`,{params:e}),getUserDetailUserLogAssignmentOption:(t,e)=>i.get(`/users-log/${t}/assignment/option`,{params:e}),getUserDetailTransactionAdminLogList:(t,e)=>i.get(`/users-log/${t}/transaction-log`,{params:e}),getUserDetailTransactionAdminLogOption:(t,e)=>i.get(`/users-log/${t}/transaction-log/option`,{params:e})}),v=n({env:"APP_ADMIN_API",prefix:"/settings-attribute/languages"}),x=s("I18nService",{getMessages:t=>v.get(`/${t}/translations`),getLanguageOptions:async()=>{const{data:t}=await v.get("/dropdown");return t.data},getLanguageOptionMeta:async t=>{const{data:e}=await v.get("/dropdown/"+t);return e.data},translateText:async(t,e)=>{const{data:r}=await v.post("/translate",{q:t,target:e});return r.data.translations[t]}}),f=n({prefix:"/dashboard/v2/dashboard"}),W=s("DashboardServices",{getLatestTask:t=>f.get("/latest-task",{params:t}),getSummary:t=>f.get("/summary",{params:t})}),I=n({prefix:"/alias-code/api/alias-code"}),z=s("AliasCodeServices",{getAliasCode:()=>I.get("/"),postAliasCode:t=>I.post("/",t),getAliasCodeList:t=>I.get(`/${t.object}/code-list`,{params:t})}),m=n({prefix:"/settings-attribute/v2/general-settings"}),Q=s("GeneralSettingsServices",{getGeneralSettings:()=>m.get("/"),putUpdateGeneralSettings:t=>m.put("/",t)}),p=n({prefix:"/settings-attribute/v2/custom-field"}),Z=s("CustomFieldServices",{getCustomField:async t=>p.get("/",{params:t}),getOptions:async t=>p.get("/options",{params:t}),postCreateCustomField:async(t,e)=>p.post("/",e,{params:t}),putEditCustomField:async(t,e,r)=>p.put(`/${r}`,e,{params:t}),putChangeStatus:async(t,e)=>p.put("/bulk",e,{params:t}),deleteCustomField:async t=>p.delete("/bulk",{data:t})}),$=({headers:t={},params:e={}}={})=>{const r=A("APP_COUNTRY_STATE_API"),o=A("APP_COUNTRY_STATE_API_KEY");return d.create({baseURL:`${r}/v1`,headers:{"Content-type":"application/json","X-CSCAPI-KEY":o,...t},params:e})},H=s("CountryStateServices",{getCountry:()=>$().get("/countries"),getState:t=>$().get(`/countries/${t}/states`),getCity:(t,e)=>$().get(`/countries/${t}/states/${e}/cities`)}),a=n({prefix:"/routine/v2"}),X=s("ServiceCenterServices",{getList:t=>a.get("/service-center",{params:t}),postList:t=>a.post("/service-center",t),putList:(t,e)=>a.put(`/service-center/${t}`,e),putActivate:t=>a.put("/service-center/bulk",t),getDetailList:t=>a.get(`/service-center/${t}`),getListOptions:t=>a.get("/service-center/options",{params:t}),deleteList:t=>a.delete("/service-center",{params:t}),getActivities:t=>a.get("/service-activities",{params:t}),getActivityOptions:t=>a.get("/service-activities/options",{params:t}),getActivityDetail:t=>a.get(`/service-activities/${t}`),getActivityLog:t=>a.get(`/service-activities/${t}/activity-log`)}),h=n({prefix:"/settings-attribute/v2/brands"}),tt=s("BrandServices",{getDropdown:t=>h.get("/dropdown",{params:t})})}}});
package/main.d.ts CHANGED
@@ -15,3 +15,6 @@ export { default as DashboardServices } from './src/services/oldDashboard.servic
15
15
  export { default as AliasCodeServices } from './src/services/oldAliasCode.service';
16
16
  export { default as GeneralSettingsServices } from './src/services/oldGeneralSettings.service';
17
17
  export { default as CustomFieldServices } from './src/services/oldCustomField.service';
18
+ export { default as CountryStateServices } from './src/services/countryState.service';
19
+ export { default as ServiceCenterServices } from './src/services/oldServiceCenter.service';
20
+ export { default as BrandServices } from './src/services/oldBrand.service';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "1.0.0-alpha.26",
3
+ "version": "1.0.0-alpha.27",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Fixed Asset Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -0,0 +1,22 @@
1
+ interface Region {
2
+ name?: string;
3
+ iso?: string;
4
+ }
5
+ export interface PutBody {
6
+ id: string[];
7
+ isActive?: boolean | Event;
8
+ }
9
+ export interface PostBody {
10
+ name: string;
11
+ category: number[];
12
+ brand: number[];
13
+ state: Region;
14
+ country: Region;
15
+ city: string;
16
+ zipCode: string;
17
+ phoneNumber: string;
18
+ picName: string;
19
+ address: string;
20
+ picPhoneNumber: string;
21
+ }
22
+ export {};
@@ -0,0 +1,7 @@
1
+ import { AxiosResponse } from 'axios';
2
+ declare const CountryStateServices: {
3
+ getCountry: () => Promise<AxiosResponse>;
4
+ getState: (country: string) => Promise<AxiosResponse>;
5
+ getCity: (country: string, state: string) => Promise<AxiosResponse>;
6
+ };
7
+ export default CountryStateServices;
@@ -0,0 +1,7 @@
1
+ import { AxiosResponse } from 'axios';
2
+ declare const BrandServices: {
3
+ getDropdown: (params?: {
4
+ [key: string]: string;
5
+ }) => Promise<AxiosResponse>;
6
+ };
7
+ export default BrandServices;
@@ -0,0 +1,19 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { PostBody, PutBody } from '../dto/serviceCenter.dto';
3
+ import { FilterActivityParams, FilterParams, QueryParams } from '../types/serviceCenter.type';
4
+ declare const ServiceCenterServices: {
5
+ getList: (params: QueryParams) => Promise<AxiosResponse>;
6
+ postList: (body: PostBody) => Promise<AxiosResponse>;
7
+ putList: (id: string, body: PostBody) => Promise<AxiosResponse>;
8
+ putActivate: (body: PutBody) => Promise<AxiosResponse>;
9
+ getDetailList: (id: string) => Promise<AxiosResponse>;
10
+ getListOptions: (params: FilterParams) => Promise<AxiosResponse>;
11
+ deleteList: (params: {
12
+ id: string;
13
+ }) => Promise<AxiosResponse>;
14
+ getActivities: (params: QueryParams) => Promise<AxiosResponse>;
15
+ getActivityOptions: (params: FilterActivityParams) => Promise<AxiosResponse>;
16
+ getActivityDetail: (id: string) => Promise<AxiosResponse>;
17
+ getActivityLog: (id: string) => Promise<AxiosResponse>;
18
+ };
19
+ export default ServiceCenterServices;
@@ -0,0 +1,29 @@
1
+ export type QueryParams = {
2
+ serviceCenterId?: string;
3
+ city?: string;
4
+ isActive?: string;
5
+ category?: number;
6
+ modifiedBy?: string;
7
+ brand?: string;
8
+ updatedAt?: string;
9
+ sortOrder?: number;
10
+ sortBy?: string;
11
+ page?: number;
12
+ limit?: string;
13
+ status?: string;
14
+ search?: string;
15
+ downTime?: string;
16
+ };
17
+ export type FilterParams = {
18
+ cityOptions?: string;
19
+ modifiedByOptions?: string;
20
+ categoryOptions?: string;
21
+ brandOptions?: string;
22
+ };
23
+ export type FilterActivityParams = {
24
+ serviceCenterId?: string;
25
+ assetNameOption?: string;
26
+ assetModelOption?: string;
27
+ assetGroupOption?: string;
28
+ assetBrandOption?: string;
29
+ };