@tagsamurai/fats-api-services 2.0.0-alpha.16 → 2.0.0-alpha.18
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,123 @@
|
|
|
1
|
+
import { Tab } from '../types/hardware.type';
|
|
2
|
+
import { TableParams } from './dataTable.dto';
|
|
3
|
+
export interface HandheldFilterRaw extends TableParams {
|
|
4
|
+
tab?: Tab;
|
|
5
|
+
deviceName?: string[];
|
|
6
|
+
type?: string[];
|
|
7
|
+
status?: string[];
|
|
8
|
+
sku?: string[];
|
|
9
|
+
group?: string[];
|
|
10
|
+
reportedBy?: string[];
|
|
11
|
+
reportedAt?: number[];
|
|
12
|
+
}
|
|
13
|
+
export interface HandheldOptions {
|
|
14
|
+
tab?: Tab;
|
|
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
|
+
tab?: Tab;
|
|
49
|
+
deviceNameOptions?: boolean;
|
|
50
|
+
skuOptions?: boolean;
|
|
51
|
+
brandOptions?: boolean;
|
|
52
|
+
modelOptions?: boolean;
|
|
53
|
+
typeOptions?: boolean;
|
|
54
|
+
reportedByOptions?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface TabletFilterRaw extends TableParams {
|
|
57
|
+
tab?: Tab;
|
|
58
|
+
deviceName?: string[];
|
|
59
|
+
status?: string[];
|
|
60
|
+
group?: string[];
|
|
61
|
+
reader?: string[];
|
|
62
|
+
registeredAt?: number[];
|
|
63
|
+
reportedBy?: string[];
|
|
64
|
+
reportedAt?: number[];
|
|
65
|
+
}
|
|
66
|
+
export interface TabletOptions {
|
|
67
|
+
tab?: Tab;
|
|
68
|
+
statusOptions?: boolean;
|
|
69
|
+
deviceNameOptions?: boolean;
|
|
70
|
+
readerOptions?: boolean;
|
|
71
|
+
reportedByOptions?: boolean;
|
|
72
|
+
}
|
|
73
|
+
export interface PutEditAliasName {
|
|
74
|
+
aliasName: string | null;
|
|
75
|
+
}
|
|
76
|
+
export interface PostActivateHardware {
|
|
77
|
+
serialNumber: string;
|
|
78
|
+
licenseKey: string;
|
|
79
|
+
hardwareId: string;
|
|
80
|
+
}
|
|
81
|
+
export interface DeleteHardware {
|
|
82
|
+
ids: string[];
|
|
83
|
+
}
|
|
84
|
+
export interface PutEditReaderGroup {
|
|
85
|
+
fixedAssetGroup?: string;
|
|
86
|
+
supplyAssetGroup?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface PutEditSmartFixedReader {
|
|
89
|
+
antennaPower: number[];
|
|
90
|
+
rssi: number;
|
|
91
|
+
}
|
|
92
|
+
export interface SmartFixedReaderBody extends PutEditSmartFixedReader {
|
|
93
|
+
type: 'Smart Fixed Reader';
|
|
94
|
+
smartFixedReaderGroup?: SmartFixedReaderGroup;
|
|
95
|
+
portGroup?: SmartFixedReaderGroup[];
|
|
96
|
+
}
|
|
97
|
+
export interface AssetControlBody extends PutEditSmartFixedReader {
|
|
98
|
+
type: 'Asset Control';
|
|
99
|
+
assetControlSize: 'Small' | 'Medium' | 'Large';
|
|
100
|
+
assetControlReaderGroup: AssetControlReaderGroup;
|
|
101
|
+
portDirection: string[];
|
|
102
|
+
}
|
|
103
|
+
interface AssetControlReaderGroup {
|
|
104
|
+
fixedAsset?: FixedAsset;
|
|
105
|
+
supplyAsset?: FixedAsset;
|
|
106
|
+
}
|
|
107
|
+
interface FixedAsset {
|
|
108
|
+
group?: string;
|
|
109
|
+
isRoleRestricted: boolean;
|
|
110
|
+
receivingGroups: string[];
|
|
111
|
+
}
|
|
112
|
+
export interface SmartFixedReaderGroup {
|
|
113
|
+
fixedAsset?: string;
|
|
114
|
+
supplyAsset?: string;
|
|
115
|
+
}
|
|
116
|
+
export interface PostPingReadersBody {
|
|
117
|
+
ids: string[];
|
|
118
|
+
}
|
|
119
|
+
export interface PutHardwareStatusBody {
|
|
120
|
+
status: 'Missing' | 'Damaged' | 'Available';
|
|
121
|
+
}
|
|
122
|
+
export type HardwareFormType = PutEditAliasName | PutHardwareStatusBody | PutEditReaderGroup;
|
|
123
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
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, 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) => Promise<AxiosResponse<{
|
|
9
|
+
data: FetchOptionResponse<HandheldOptions>;
|
|
10
|
+
}>>;
|
|
11
|
+
putHardwareStatus: (moduleTab: "smart-fixed-readers" | "handheld-readers" | "tablets", ids: string[], body: PutHardwareStatusBody) => Promise<AxiosResponse>;
|
|
12
|
+
postPingReaders: (body: PostPingReadersBody) => Promise<AxiosResponse<ShortFetchListResponse<PingSmartFixed>>>;
|
|
13
|
+
putEditReaderGroup: (moduleTab: "smart-fixed-readers" | "handheld-readers", body: PutEditReaderGroup, hardwareId?: string) => Promise<AxiosResponse>;
|
|
14
|
+
putEditAliasName: (moduleTab: "smart-fixed-readers" | "handheld-readers", body: PutEditAliasName, hardwareId?: string) => Promise<AxiosResponse>;
|
|
15
|
+
postActivateHardware: (moduleTab: "smart-fixed-readers" | "handheld-readers", body: PostActivateHardware) => Promise<AxiosResponse>;
|
|
16
|
+
deleteHardware: (moduleTab: "smart-fixed-readers" | "handheld-readers" | "tablets", params?: DeleteHardware) => Promise<AxiosResponse>;
|
|
17
|
+
getSmartFixedReader: (params?: FilterQuery<SmartFixedFilterRaw>) => Promise<AxiosResponse<FetchListResponse<SmartFixedDataType>>>;
|
|
18
|
+
getSmartFixedReaderDetail: (smartFixedId?: string) => Promise<AxiosResponse<FetchDetailResponse<SmartFixedDetailDataType>>>;
|
|
19
|
+
getSmartFixedReaderOptions: (params?: SmartFixedOptions) => Promise<AxiosResponse<{
|
|
20
|
+
data: FetchOptionResponse<SmartFixedOptions>;
|
|
21
|
+
}>>;
|
|
22
|
+
putEditSmartFixedReader: (id: string, body: SmartFixedReaderBody | AssetControlBody) => Promise<AxiosResponse>;
|
|
23
|
+
getTablet: (params?: FilterQuery<TabletFilterRaw>) => Promise<AxiosResponse<FetchListResponse<Tablet>>>;
|
|
24
|
+
getTabletOptions: (params?: TabletOptions) => Promise<AxiosResponse<{
|
|
25
|
+
data: FetchOptionResponse<TabletOptions>;
|
|
26
|
+
}>>;
|
|
27
|
+
};
|
|
28
|
+
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,140 @@
|
|
|
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 | null;
|
|
9
|
+
deviceName: string;
|
|
10
|
+
sku: string;
|
|
11
|
+
serialNumber: string;
|
|
12
|
+
aliasName: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface HandheldDetailDataType extends HardwareDetailDataType {
|
|
15
|
+
type: string;
|
|
16
|
+
status: string;
|
|
17
|
+
group: ReaderGroup;
|
|
18
|
+
}
|
|
19
|
+
export interface HandheldDataType extends HandheldDetailDataType {
|
|
20
|
+
reportedBy: string | null;
|
|
21
|
+
reportedAt: Date | null;
|
|
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 SmartFixedDetailDataType extends HardwareDetailDataType {
|
|
47
|
+
activePort: string;
|
|
48
|
+
networkStatus: string;
|
|
49
|
+
brand: string;
|
|
50
|
+
model: string;
|
|
51
|
+
type: string;
|
|
52
|
+
readerGroup: SmartFixedGroup;
|
|
53
|
+
rssi: string;
|
|
54
|
+
}
|
|
55
|
+
export interface SmartFixedDataType extends Omit<SmartFixedDetailDataType, 'rssi'> {
|
|
56
|
+
connectedTablet: number;
|
|
57
|
+
status: string;
|
|
58
|
+
portGroup: SmartFixedGroupList;
|
|
59
|
+
reportedBy: string | null;
|
|
60
|
+
reportedAt: Date | null;
|
|
61
|
+
}
|
|
62
|
+
export interface Tablet {
|
|
63
|
+
_id: string;
|
|
64
|
+
deviceName: string;
|
|
65
|
+
deviceId: string;
|
|
66
|
+
status: string;
|
|
67
|
+
group: ReaderGroup;
|
|
68
|
+
reader: string | null;
|
|
69
|
+
aliasName: string | null;
|
|
70
|
+
registeredAt: Date;
|
|
71
|
+
reportedBy: string | null;
|
|
72
|
+
reportedAt: Date | null;
|
|
73
|
+
}
|
|
74
|
+
export interface PingSmartFixed {
|
|
75
|
+
_id: string;
|
|
76
|
+
isOnline: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface HardwareDetailUserActivity {
|
|
79
|
+
_id: string;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
userFullName?: string;
|
|
82
|
+
user?: string;
|
|
83
|
+
action?: string;
|
|
84
|
+
objectName?: string;
|
|
85
|
+
field?: string;
|
|
86
|
+
oldValue?: string;
|
|
87
|
+
newValue?: string;
|
|
88
|
+
modifiedBy?: string;
|
|
89
|
+
}
|
|
90
|
+
export type TAGResponseType = {
|
|
91
|
+
_id: string;
|
|
92
|
+
rfidCode: string | null;
|
|
93
|
+
nfcCode: string | null;
|
|
94
|
+
qrCode: string | null;
|
|
95
|
+
tagType: string;
|
|
96
|
+
rfidSku: string | null;
|
|
97
|
+
nfcSku: string | null;
|
|
98
|
+
type: string;
|
|
99
|
+
status: string;
|
|
100
|
+
lastScanned: string;
|
|
101
|
+
};
|
|
102
|
+
export type NotPairedYetCounts = {
|
|
103
|
+
rfid: {
|
|
104
|
+
available: number;
|
|
105
|
+
damagedMissing: number;
|
|
106
|
+
};
|
|
107
|
+
nfc: {
|
|
108
|
+
available: number;
|
|
109
|
+
damagedMissing: number;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export type NotPairedModule = 'RFID' | 'NFC';
|
|
113
|
+
export type AuditTAGDetailResponse = FetchResponse & {
|
|
114
|
+
data: AuditTAGDetail;
|
|
115
|
+
};
|
|
116
|
+
export type NotPairedYetCountsResponse = FetchResponse & {
|
|
117
|
+
data: NotPairedYetCounts;
|
|
118
|
+
};
|
|
119
|
+
export type AuditTAGDetail = {
|
|
120
|
+
found: {
|
|
121
|
+
total: number;
|
|
122
|
+
qr: number;
|
|
123
|
+
rfid: number;
|
|
124
|
+
nfc: number;
|
|
125
|
+
rfidNfc: number;
|
|
126
|
+
rfidQr: number;
|
|
127
|
+
nfcQr: number;
|
|
128
|
+
rfidNfcQr: number;
|
|
129
|
+
};
|
|
130
|
+
notFound: {
|
|
131
|
+
total: number;
|
|
132
|
+
qr: number;
|
|
133
|
+
rfid: number;
|
|
134
|
+
nfc: number;
|
|
135
|
+
rfidNfc: number;
|
|
136
|
+
rfidQr: number;
|
|
137
|
+
nfcQr: number;
|
|
138
|
+
rfidNfcQr: number;
|
|
139
|
+
};
|
|
140
|
+
};
|