@tagsamurai/fats-api-services 2.0.0-alpha.15 → 2.0.0-alpha.17
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/package.json
CHANGED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { Tab } from '../types/hardware.type';
|
|
2
|
+
import { TableParams } from './dataTable.dto';
|
|
3
|
+
type TAG = 'RFID' | 'NFC';
|
|
4
|
+
export interface HandheldFilterRaw extends TableParams {
|
|
5
|
+
tab?: Tab;
|
|
6
|
+
deviceName?: string[];
|
|
7
|
+
type?: string[];
|
|
8
|
+
status?: string[];
|
|
9
|
+
sku?: string[];
|
|
10
|
+
group?: string[];
|
|
11
|
+
reportedBy?: string[];
|
|
12
|
+
reportedAt?: number[];
|
|
13
|
+
}
|
|
14
|
+
export interface HandheldOptions {
|
|
15
|
+
deviceNameOptions?: boolean;
|
|
16
|
+
skuOptions?: boolean;
|
|
17
|
+
reportedByOptions?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export type DetailTableFilterParams = {
|
|
20
|
+
createdAt?: string;
|
|
21
|
+
activity?: string;
|
|
22
|
+
assetName?: string;
|
|
23
|
+
assignedTo?: string;
|
|
24
|
+
borrower?: string;
|
|
25
|
+
type?: string;
|
|
26
|
+
condition?: string;
|
|
27
|
+
reportedBy?: string;
|
|
28
|
+
staff?: string;
|
|
29
|
+
manager?: string;
|
|
30
|
+
group?: string;
|
|
31
|
+
tag?: string;
|
|
32
|
+
};
|
|
33
|
+
export interface SmartFixedFilterRaw extends TableParams {
|
|
34
|
+
tab?: Tab;
|
|
35
|
+
deviceName?: string[];
|
|
36
|
+
sku?: string[];
|
|
37
|
+
networkStatus?: string[];
|
|
38
|
+
brand?: string[];
|
|
39
|
+
model?: string[];
|
|
40
|
+
type?: string[];
|
|
41
|
+
readerGroup?: string[];
|
|
42
|
+
portGroup?: string[];
|
|
43
|
+
status?: string[];
|
|
44
|
+
reportedBy?: string[];
|
|
45
|
+
reportedAt?: number[];
|
|
46
|
+
}
|
|
47
|
+
export interface SmartFixedOptions {
|
|
48
|
+
deviceNameOptions?: boolean;
|
|
49
|
+
skuOptions?: boolean;
|
|
50
|
+
brandOptions?: boolean;
|
|
51
|
+
modelOptions?: boolean;
|
|
52
|
+
typeOptions?: boolean;
|
|
53
|
+
reportedByOptions?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface TabletFilterRaw extends TableParams {
|
|
56
|
+
deviceName: string[];
|
|
57
|
+
}
|
|
58
|
+
export interface TabletOptions {
|
|
59
|
+
deviceNameOptions?: boolean;
|
|
60
|
+
skuOptions?: boolean;
|
|
61
|
+
reportedByOptions?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface PutEditAliasName {
|
|
64
|
+
aliasName: string | null;
|
|
65
|
+
}
|
|
66
|
+
export interface PostActivateHardware {
|
|
67
|
+
serialNumber: string;
|
|
68
|
+
licenseKey: string;
|
|
69
|
+
hardwareId: string;
|
|
70
|
+
}
|
|
71
|
+
export interface DeleteHardware {
|
|
72
|
+
ids: string[];
|
|
73
|
+
}
|
|
74
|
+
export interface PutEditReaderGroup {
|
|
75
|
+
fixedAssetGroup?: string;
|
|
76
|
+
supplyAssetGroup?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface PutEditSmartFixedReader {
|
|
79
|
+
antennaPower: number[];
|
|
80
|
+
rssi: number;
|
|
81
|
+
}
|
|
82
|
+
export interface SmartFixedReaderBody extends PutEditSmartFixedReader {
|
|
83
|
+
type: 'Smart Fixed Reader';
|
|
84
|
+
smartFixedReaderGroup?: SmartFixedReaderGroup;
|
|
85
|
+
portGroup?: SmartFixedReaderGroup[];
|
|
86
|
+
}
|
|
87
|
+
export interface AssetControlBody extends PutEditSmartFixedReader {
|
|
88
|
+
type: 'Asset Control';
|
|
89
|
+
assetControlSize: 'Small' | 'Medium' | 'Large';
|
|
90
|
+
assetControlReaderGroup: AssetControlReaderGroup;
|
|
91
|
+
portDirection: string[];
|
|
92
|
+
}
|
|
93
|
+
interface AssetControlReaderGroup {
|
|
94
|
+
fixedAsset?: FixedAsset;
|
|
95
|
+
supplyAsset?: FixedAsset;
|
|
96
|
+
}
|
|
97
|
+
interface FixedAsset {
|
|
98
|
+
group?: string;
|
|
99
|
+
isRoleRestricted: boolean;
|
|
100
|
+
receivingGroups: string[];
|
|
101
|
+
}
|
|
102
|
+
export interface SmartFixedReaderGroup {
|
|
103
|
+
fixedAsset?: string;
|
|
104
|
+
supplyAsset?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface PostPingReadersBody {
|
|
107
|
+
ids: string[];
|
|
108
|
+
}
|
|
109
|
+
export interface PutHardwareStatusBody {
|
|
110
|
+
status: 'Missing' | 'Damaged' | 'Available';
|
|
111
|
+
}
|
|
112
|
+
export type HardwareFormType = PutEditAliasName | PutHardwareStatusBody | PutEditReaderGroup;
|
|
113
|
+
export interface GetAllTAGParams extends TableParams {
|
|
114
|
+
sortBy?: string;
|
|
115
|
+
tagType?: string[];
|
|
116
|
+
rfidSku?: string[];
|
|
117
|
+
nfcSku?: string[];
|
|
118
|
+
type?: string[];
|
|
119
|
+
status?: string[];
|
|
120
|
+
lastScanned?: string[];
|
|
121
|
+
}
|
|
122
|
+
export type GetAllTAGOptionsQuery = {
|
|
123
|
+
tagTypeOptions?: boolean;
|
|
124
|
+
rfidSkuOptions?: boolean;
|
|
125
|
+
nfcSkuOptions?: boolean;
|
|
126
|
+
typeOptions?: boolean;
|
|
127
|
+
statusOptions?: boolean;
|
|
128
|
+
lastScannedOptions?: boolean;
|
|
129
|
+
};
|
|
130
|
+
export type GetNotPairedYetListParams = GetAllTAGParams & {
|
|
131
|
+
tag?: TAG;
|
|
132
|
+
};
|
|
133
|
+
export type GetNotPairedYetOptions = {
|
|
134
|
+
tag?: TAG;
|
|
135
|
+
tagTypeOptions?: boolean;
|
|
136
|
+
rfidSkuOptions?: boolean;
|
|
137
|
+
nfcSkuOptions?: boolean;
|
|
138
|
+
typeOptions?: boolean;
|
|
139
|
+
statusOptions?: boolean;
|
|
140
|
+
lastScannedOptions?: boolean;
|
|
141
|
+
};
|
|
142
|
+
type TAGIds = {
|
|
143
|
+
data: {
|
|
144
|
+
rfidId: string;
|
|
145
|
+
nfcId: string;
|
|
146
|
+
qrId: string;
|
|
147
|
+
}[];
|
|
148
|
+
};
|
|
149
|
+
export type GetAuditTAGDetailParams = TAGIds;
|
|
150
|
+
export type SubmitAuditTAGBody = TAGIds & {
|
|
151
|
+
markNotFoundAsDamagedMissing: boolean;
|
|
152
|
+
};
|
|
153
|
+
export type SubmitCombineTAGBody = TAGIds & {
|
|
154
|
+
tagType: 'RFID & QR';
|
|
155
|
+
};
|
|
156
|
+
export type SubmitSeparateTAGBody = TAGIds;
|
|
157
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
import { LoginCredentials, SetPasswordBody } from '../dto/globalAuth.dto';
|
|
3
3
|
import { EmailActionResponse } from '../types/emailActionResponse.type';
|
|
4
|
-
import { FetchDetailResponse
|
|
4
|
+
import { FetchDetailResponse } from '../types/fetchResponse.type';
|
|
5
5
|
interface LoginResponse {
|
|
6
6
|
_id: string;
|
|
7
7
|
companyName: string;
|
|
@@ -30,11 +30,11 @@ declare const AuthServices: {
|
|
|
30
30
|
}) => Promise<AxiosResponse<LoginResponse>>;
|
|
31
31
|
requestOTP: (email: string, resendAttempt?: number) => Promise<AxiosResponse<EmailActionResponse<boolean>>>;
|
|
32
32
|
requestResetPassLink: (email: string) => Promise<AxiosResponse<EmailActionResponse<boolean>>>;
|
|
33
|
-
setPassword: (body: SetPasswordBody) => Promise<AxiosResponse
|
|
33
|
+
setPassword: (body: SetPasswordBody) => Promise<AxiosResponse>;
|
|
34
34
|
verifyToken: (token: string) => Promise<AxiosResponse<FetchDetailResponse<boolean>>>;
|
|
35
|
-
confirmEmailChange: (token: string) => Promise<AxiosResponse
|
|
36
|
-
cancelEmailChange: (_id: string) => Promise<AxiosResponse
|
|
37
|
-
postLogout: () => Promise<AxiosResponse
|
|
35
|
+
confirmEmailChange: (token: string) => Promise<AxiosResponse>;
|
|
36
|
+
cancelEmailChange: (_id: string) => Promise<AxiosResponse>;
|
|
37
|
+
postLogout: () => Promise<AxiosResponse>;
|
|
38
38
|
};
|
|
39
39
|
declare global {
|
|
40
40
|
interface Window {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { FetchDetailResponse, FetchListResponse, FetchOptionResponse, FilterQuery, ShortFetchListResponse } from '../types/fetchResponse.type';
|
|
3
|
+
import { AssetControlBody, DeleteHardware, HandheldFilterRaw, HandheldOptions, PostActivateHardware, PostPingReadersBody, PutEditAliasName, PutEditReaderGroup, PutHardwareStatusBody, SmartFixedFilterRaw, SmartFixedOptions, SmartFixedReaderBody, TabletFilterRaw, TabletOptions } from '../dto/hardware.dto';
|
|
4
|
+
import { HandheldDataType, HandheldDetailDataType, PingSmartFixed, SmartFixedDataType, SmartFixedDetailDataType, Tab, Tablet } from '../types/hardware.type';
|
|
5
|
+
declare const HardwareServices: {
|
|
6
|
+
getHandheldReader: (params?: FilterQuery<HandheldFilterRaw>) => Promise<AxiosResponse<FetchListResponse<HandheldDataType>>>;
|
|
7
|
+
getHandheldReaderDetail: (handheldId?: string) => Promise<AxiosResponse<FetchDetailResponse<HandheldDetailDataType>>>;
|
|
8
|
+
getHandheldReaderOptions: (body?: HandheldOptions & {
|
|
9
|
+
tab?: Tab;
|
|
10
|
+
}) => Promise<AxiosResponse<{
|
|
11
|
+
data: FetchOptionResponse<HandheldOptions>;
|
|
12
|
+
}>>;
|
|
13
|
+
putHardwareStatus: (moduleTab: "smart-fixed-readers" | "handheld-readers" | "tablets", ids: string[], body: PutHardwareStatusBody) => Promise<AxiosResponse>;
|
|
14
|
+
postPingReaders: (body: PostPingReadersBody) => Promise<AxiosResponse<ShortFetchListResponse<PingSmartFixed>>>;
|
|
15
|
+
putEditReaderGroup: (moduleTab: "smart-fixed-readers" | "handheld-readers", body: PutEditReaderGroup, hardwareId?: string) => Promise<AxiosResponse>;
|
|
16
|
+
putEditAliasName: (moduleTab: "smart-fixed-readers" | "handheld-readers", body: PutEditAliasName, hardwareId?: string) => Promise<AxiosResponse>;
|
|
17
|
+
postActivateHardware: (moduleTab: "smart-fixed-readers" | "handheld-readers", body: PostActivateHardware) => Promise<AxiosResponse>;
|
|
18
|
+
deleteHardware: (moduleTab: "smart-fixed-readers" | "handheld-readers" | "tablets", params?: DeleteHardware) => Promise<AxiosResponse>;
|
|
19
|
+
getSmartFixedReader: (params?: FilterQuery<SmartFixedFilterRaw>) => Promise<AxiosResponse<FetchListResponse<SmartFixedDataType>>>;
|
|
20
|
+
getSmartFixedReaderDetail: (smartFixedId?: string) => Promise<AxiosResponse<FetchDetailResponse<SmartFixedDetailDataType>>>;
|
|
21
|
+
getSmartFixedReaderOptions: (params?: SmartFixedOptions & {
|
|
22
|
+
tab?: Tab;
|
|
23
|
+
}) => Promise<AxiosResponse<{
|
|
24
|
+
data: FetchOptionResponse<SmartFixedOptions>;
|
|
25
|
+
}>>;
|
|
26
|
+
putEditSmartFixedReader: (id: string, body: SmartFixedReaderBody | AssetControlBody) => Promise<AxiosResponse>;
|
|
27
|
+
getTablet: (id: string, params?: FilterQuery<TabletFilterRaw>) => Promise<AxiosResponse<FetchListResponse<Tablet>>>;
|
|
28
|
+
getTabletOptions: (id: string, params?: TabletOptions) => Promise<AxiosResponse<{
|
|
29
|
+
data: FetchOptionResponse<TabletOptions>;
|
|
30
|
+
}>>;
|
|
31
|
+
disconnectTablet: (id: string, body?: DeleteHardware) => Promise<AxiosResponse>;
|
|
32
|
+
};
|
|
33
|
+
export default HardwareServices;
|
|
@@ -8,6 +8,15 @@ export type FetchListResponse<T = Data> = {
|
|
|
8
8
|
totalRecords: number;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
+
export type ShortFetchListResponse<T = Data> = {
|
|
12
|
+
status: number;
|
|
13
|
+
message: string;
|
|
14
|
+
data: T[];
|
|
15
|
+
};
|
|
16
|
+
export type FetchResponse = {
|
|
17
|
+
status: number;
|
|
18
|
+
message: string;
|
|
19
|
+
};
|
|
11
20
|
export type FetchDetailResponse<T = Data> = {
|
|
12
21
|
status: number;
|
|
13
22
|
message: string;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { FetchResponse } from './fetchResponse.type';
|
|
2
|
+
export type HardwareTabType = 'activity-log' | 'handheld-damaged-missing' | 'handheld' | 'iot-reader' | 'iot-antenna' | 'iot-damaged-missing-reader' | 'iot-damaged-missing-antenna';
|
|
3
|
+
export type HardwareDetailTabType = 'All' | 'Tagging' | 'User' | 'Antenna' | 'Changelog';
|
|
4
|
+
export type ModuleType = 'fixedAsset' | 'supplyAsset';
|
|
5
|
+
export type Tab = 'Available' | 'Damaged/Missing';
|
|
6
|
+
export interface HardwareDetailDataType {
|
|
7
|
+
_id: string;
|
|
8
|
+
image?: string;
|
|
9
|
+
deviceName: string;
|
|
10
|
+
sku: string;
|
|
11
|
+
serialNumber: string;
|
|
12
|
+
aliasName?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface HandheldDataType extends HandheldDetailDataType {
|
|
15
|
+
reportedBy?: string;
|
|
16
|
+
reportedAt?: Date;
|
|
17
|
+
}
|
|
18
|
+
export interface HandheldDetailDataType extends HardwareDetailDataType {
|
|
19
|
+
type: string;
|
|
20
|
+
status: string;
|
|
21
|
+
group: ReaderGroup;
|
|
22
|
+
}
|
|
23
|
+
export interface ReaderGroup {
|
|
24
|
+
fixedAsset?: {
|
|
25
|
+
_id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
};
|
|
28
|
+
supplyAsset?: {
|
|
29
|
+
_id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface ListReaderGroup {
|
|
34
|
+
module: ModuleType;
|
|
35
|
+
_id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
}
|
|
38
|
+
export interface SmartFixedGroup {
|
|
39
|
+
fixedAsset?: string;
|
|
40
|
+
supplyAsset?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface SmartFixedGroupList {
|
|
43
|
+
fixedAsset: (string | null)[];
|
|
44
|
+
supplyAsset: (string | null)[];
|
|
45
|
+
}
|
|
46
|
+
export interface SmartFixedDataType extends Omit<SmartFixedDetailDataType, 'rssi'> {
|
|
47
|
+
connectedTablet: number;
|
|
48
|
+
status: string;
|
|
49
|
+
portGroup: SmartFixedGroupList;
|
|
50
|
+
reportedBy?: string;
|
|
51
|
+
reportedAt?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface SmartFixedDetailDataType extends HardwareDetailDataType {
|
|
54
|
+
activePort: string;
|
|
55
|
+
networkStatus: string;
|
|
56
|
+
brand: string;
|
|
57
|
+
model: string;
|
|
58
|
+
type: string;
|
|
59
|
+
readerGroup: SmartFixedGroup;
|
|
60
|
+
rssi: string;
|
|
61
|
+
}
|
|
62
|
+
export interface Tablet {
|
|
63
|
+
_id: string;
|
|
64
|
+
deviceName: string;
|
|
65
|
+
deviceId: string;
|
|
66
|
+
}
|
|
67
|
+
export interface PingSmartFixed {
|
|
68
|
+
_id: string;
|
|
69
|
+
isOnline: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface HardwareDetailUserActivity {
|
|
72
|
+
_id: string;
|
|
73
|
+
createdAt: string;
|
|
74
|
+
userFullName?: string;
|
|
75
|
+
user?: string;
|
|
76
|
+
action?: string;
|
|
77
|
+
objectName?: string;
|
|
78
|
+
field?: string;
|
|
79
|
+
oldValue?: string;
|
|
80
|
+
newValue?: string;
|
|
81
|
+
modifiedBy?: string;
|
|
82
|
+
}
|
|
83
|
+
export type TAGResponseType = {
|
|
84
|
+
_id: string;
|
|
85
|
+
rfidCode: string | null;
|
|
86
|
+
nfcCode: string | null;
|
|
87
|
+
qrCode: string | null;
|
|
88
|
+
tagType: string;
|
|
89
|
+
rfidSku: string | null;
|
|
90
|
+
nfcSku: string | null;
|
|
91
|
+
type: string;
|
|
92
|
+
status: string;
|
|
93
|
+
lastScanned: string;
|
|
94
|
+
};
|
|
95
|
+
export type NotPairedYetCounts = {
|
|
96
|
+
rfid: {
|
|
97
|
+
available: number;
|
|
98
|
+
damagedMissing: number;
|
|
99
|
+
};
|
|
100
|
+
nfc: {
|
|
101
|
+
available: number;
|
|
102
|
+
damagedMissing: number;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export type NotPairedModule = 'RFID' | 'NFC';
|
|
106
|
+
export type AuditTAGDetailResponse = FetchResponse & {
|
|
107
|
+
data: AuditTAGDetail;
|
|
108
|
+
};
|
|
109
|
+
export type NotPairedYetCountsResponse = FetchResponse & {
|
|
110
|
+
data: NotPairedYetCounts;
|
|
111
|
+
};
|
|
112
|
+
export type AuditTAGDetail = {
|
|
113
|
+
found: {
|
|
114
|
+
total: number;
|
|
115
|
+
qr: number;
|
|
116
|
+
rfid: number;
|
|
117
|
+
nfc: number;
|
|
118
|
+
rfidNfc: number;
|
|
119
|
+
rfidQr: number;
|
|
120
|
+
nfcQr: number;
|
|
121
|
+
rfidNfcQr: number;
|
|
122
|
+
};
|
|
123
|
+
notFound: {
|
|
124
|
+
total: number;
|
|
125
|
+
qr: number;
|
|
126
|
+
rfid: number;
|
|
127
|
+
nfc: number;
|
|
128
|
+
rfidNfc: number;
|
|
129
|
+
rfidQr: number;
|
|
130
|
+
nfcQr: number;
|
|
131
|
+
rfidNfcQr: number;
|
|
132
|
+
};
|
|
133
|
+
};
|