@tagsamurai/gsts-api-services 2.0.1-alpha.29 → 2.0.1-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api-services.es.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import R from "axios";
|
|
2
|
-
const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_GLOBAL_SETTINGS_API: "https://dev-api.global-settings.tagsamurai.com", VITE_APP_IMAGE_BASE_URL: "https://dev-api.tagsamurai.com/fam/utility/v2/files", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" },
|
|
2
|
+
const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_GLOBAL_SETTINGS_API: "https://dev-api.global-settings.tagsamurai.com", VITE_APP_IMAGE_BASE_URL: "https://dev-api.tagsamurai.com/fam/utility/v2/files", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, w = (t = "APP_TAGSAMURAI_API") => U["VITE_" + t], p = (t = {}, e = !1) => {
|
|
3
3
|
const {
|
|
4
4
|
env: r = "APP_GLOBAL_SETTINGS_API",
|
|
5
5
|
prefix: n = "",
|
|
6
6
|
headers: u = {},
|
|
7
7
|
...l
|
|
8
|
-
} = t,
|
|
8
|
+
} = t, I = "".concat(w(r)).concat(n), A = R.create({
|
|
9
9
|
...l,
|
|
10
|
-
baseURL:
|
|
10
|
+
baseURL: I,
|
|
11
11
|
headers: e ? u : {
|
|
12
12
|
"Content-Type": "application/json",
|
|
13
13
|
...u
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
return
|
|
17
|
-
var S,
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
}),
|
|
16
|
+
return A.interceptors.request.use((P) => {
|
|
17
|
+
var S, $, T;
|
|
18
|
+
const y = JSON.parse((S = localStorage.getItem("user")) != null ? S : "{}"), O = (T = ($ = y.jwt) != null ? $ : y.token) != null ? T : "";
|
|
19
|
+
return P.headers.Authorization = "Bearer ".concat(O), P;
|
|
20
|
+
}), A;
|
|
21
21
|
}, c = p({
|
|
22
22
|
prefix: "/v1/global-settings/auth"
|
|
23
23
|
}), L = (t) => {
|
|
@@ -50,7 +50,7 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
50
50
|
*/
|
|
51
51
|
logout: () => c.post("/logout")
|
|
52
52
|
}, E = (t, e, r) => {
|
|
53
|
-
const n = new URL(
|
|
53
|
+
const n = new URL(w("APP_TAGSAMURAI_API") || "").origin;
|
|
54
54
|
let u = t.startsWith("http") ? t : "".concat(n, "/file-storage/api/file/").concat(t.replace(/^\/+/, ""));
|
|
55
55
|
if (e || r) {
|
|
56
56
|
const l = new URLSearchParams();
|
|
@@ -80,11 +80,11 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
80
80
|
} catch (e) {
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, H = async (t, e, r, n) => {
|
|
84
84
|
if (!t) return;
|
|
85
85
|
const u = E(t, e, r);
|
|
86
86
|
return n ? u : N(u);
|
|
87
|
-
},
|
|
87
|
+
}, J = (t) => {
|
|
88
88
|
if (!t || typeof t == "string")
|
|
89
89
|
return;
|
|
90
90
|
const e = {};
|
|
@@ -112,14 +112,19 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
112
112
|
const n = t[r];
|
|
113
113
|
e[r] = x(n) ? JSON.parse(n.trim()) : n;
|
|
114
114
|
}), e;
|
|
115
|
-
},
|
|
115
|
+
}, b = p({
|
|
116
116
|
prefix: "v2/analytics-reporting"
|
|
117
117
|
}), j = {
|
|
118
118
|
getChangelogs: (t) => {
|
|
119
119
|
const e = a(t);
|
|
120
|
-
return
|
|
120
|
+
return b.post("/change-log/list", e);
|
|
121
|
+
},
|
|
122
|
+
getChangelogOptions: (t) => b.post("/change-log/options", t),
|
|
123
|
+
getHardwareChangelogs: (t) => {
|
|
124
|
+
const e = a(t);
|
|
125
|
+
return b.post("/hardware-change-log/list", e);
|
|
121
126
|
},
|
|
122
|
-
|
|
127
|
+
getHardwareOptions: (t) => b.post("/hardware-change-log/options", t)
|
|
123
128
|
}, m = p({
|
|
124
129
|
prefix: "/v1/global-settings/division"
|
|
125
130
|
}), B = {
|
|
@@ -230,18 +235,18 @@ const U = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
230
235
|
prefix: "/tag/v2"
|
|
231
236
|
}), W = {
|
|
232
237
|
getTagInfo: (t) => G.get("/rfid-qr/scan", { params: t })
|
|
233
|
-
},
|
|
238
|
+
}, h = p({
|
|
234
239
|
prefix: "/v2/hardware-tagging"
|
|
235
240
|
}), K = {
|
|
236
241
|
getTAGEventlog: (t) => {
|
|
237
242
|
const e = a(t);
|
|
238
|
-
return
|
|
243
|
+
return h.post("/tag-event-log/list", e);
|
|
239
244
|
},
|
|
240
245
|
getTAGEventlogOptions: (t) => {
|
|
241
246
|
const e = a(t);
|
|
242
|
-
return
|
|
247
|
+
return h.post("/tag-event-log/options", e);
|
|
243
248
|
},
|
|
244
|
-
getDetailTAGEventlog: (t) =>
|
|
249
|
+
getDetailTAGEventlog: (t) => h.get("/tag-event-log/".concat(t))
|
|
245
250
|
}, g = p({
|
|
246
251
|
prefix: "/v1/global-settings/user"
|
|
247
252
|
}), Q = {
|
|
@@ -443,7 +448,7 @@ export {
|
|
|
443
448
|
K as TagEventlogServices,
|
|
444
449
|
W as TagServices,
|
|
445
450
|
Q as UserServices,
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
451
|
+
w as getBaseURL,
|
|
452
|
+
H as getImageURL,
|
|
453
|
+
J as queryParamsStringfy
|
|
449
454
|
};
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import { ChangelogType } from '../types/changelog.type';
|
|
|
3
3
|
import { FetchListResponse, FetchOptionResponse } from '../types/fetchResponse.type';
|
|
4
4
|
export type ChangelogResponse = FetchListResponse<ChangelogType>;
|
|
5
5
|
export type ChangelogOptionResponse = FetchOptionResponse<ChangelogOptionFilter>;
|
|
6
|
+
type HardwareType = 'Hardware Handheld' | 'Hardware Smart Fixed Reader' | 'Tablet';
|
|
6
7
|
export interface ChangelogFilterQuery extends TableParams {
|
|
7
8
|
objects?: string[];
|
|
8
9
|
objectName?: string[];
|
|
@@ -30,3 +31,22 @@ export interface ChangelogOptionQuery extends ChangelogOptionFilter {
|
|
|
30
31
|
userId?: string;
|
|
31
32
|
activityLog?: boolean;
|
|
32
33
|
}
|
|
34
|
+
export interface HardwareChangelogFilterQuery extends TableParams {
|
|
35
|
+
type?: HardwareType;
|
|
36
|
+
createdAt?: number[];
|
|
37
|
+
deviceName?: string[];
|
|
38
|
+
sku?: string[];
|
|
39
|
+
action?: string[];
|
|
40
|
+
modifiedBy?: string[];
|
|
41
|
+
}
|
|
42
|
+
export type HardwareChangelogOptionFilter = {
|
|
43
|
+
deviceNameOptions?: boolean;
|
|
44
|
+
skuOptions?: boolean;
|
|
45
|
+
actionOptions?: boolean;
|
|
46
|
+
modifiedByOptions?: boolean;
|
|
47
|
+
};
|
|
48
|
+
export interface HardwareChangelogOptionQuery extends HardwareChangelogOptionFilter {
|
|
49
|
+
type?: string;
|
|
50
|
+
objectId?: string;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
|
-
import { ChangelogFilterQuery, ChangelogOptionQuery, ChangelogOptionResponse, ChangelogResponse } from '../dto/changelog.dto';
|
|
3
|
-
import { FilterQuery } from '../types/fetchResponse.type';
|
|
2
|
+
import { ChangelogFilterQuery, ChangelogOptionQuery, ChangelogOptionResponse, ChangelogResponse, HardwareChangelogFilterQuery, HardwareChangelogOptionFilter, HardwareChangelogOptionQuery } from '../dto/changelog.dto';
|
|
3
|
+
import { FetchListResponse, FetchOptionResponse, FilterQuery } from '../types/fetchResponse.type';
|
|
4
|
+
import { HardwareChangelogType } from '../types/changelog.type';
|
|
4
5
|
declare const ChangelogServices: {
|
|
5
6
|
getChangelogs: (params?: FilterQuery<ChangelogFilterQuery>) => Promise<AxiosResponse<ChangelogResponse>>;
|
|
6
7
|
getChangelogOptions: (body?: ChangelogOptionQuery) => Promise<AxiosResponse<{
|
|
7
8
|
data: ChangelogOptionResponse;
|
|
8
9
|
}>>;
|
|
10
|
+
getHardwareChangelogs: (params?: FilterQuery<HardwareChangelogFilterQuery>) => Promise<AxiosResponse<FetchListResponse<HardwareChangelogType>>>;
|
|
11
|
+
getHardwareOptions: (body?: HardwareChangelogOptionQuery) => Promise<AxiosResponse<{
|
|
12
|
+
data: FetchOptionResponse<HardwareChangelogOptionFilter>;
|
|
13
|
+
}>>;
|
|
9
14
|
};
|
|
10
15
|
export default ChangelogServices;
|
|
@@ -10,3 +10,15 @@ export type ChangelogType = {
|
|
|
10
10
|
createdAt: string;
|
|
11
11
|
updatedAt: string;
|
|
12
12
|
};
|
|
13
|
+
export type HardwareChangelogType = {
|
|
14
|
+
_id: string;
|
|
15
|
+
deviceNameWithSequence: string;
|
|
16
|
+
sku: string;
|
|
17
|
+
serialNumber: string;
|
|
18
|
+
action: string;
|
|
19
|
+
oldValue?: string;
|
|
20
|
+
newValue?: string;
|
|
21
|
+
modifiedBy: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
};
|