@tagsamurai/fats-api-services 2.0.0-alpha.17 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "2.0.0-alpha.17",
3
+ "version": "2.0.0-alpha.18",
4
4
  "type": "module",
5
5
  "author": "Tagsamurai",
6
6
  "description": "Fixed Asset Tagsamurai API Services",
@@ -1,6 +1,5 @@
1
1
  import { Tab } from '../types/hardware.type';
2
2
  import { TableParams } from './dataTable.dto';
3
- type TAG = 'RFID' | 'NFC';
4
3
  export interface HandheldFilterRaw extends TableParams {
5
4
  tab?: Tab;
6
5
  deviceName?: string[];
@@ -12,6 +11,7 @@ export interface HandheldFilterRaw extends TableParams {
12
11
  reportedAt?: number[];
13
12
  }
14
13
  export interface HandheldOptions {
14
+ tab?: Tab;
15
15
  deviceNameOptions?: boolean;
16
16
  skuOptions?: boolean;
17
17
  reportedByOptions?: boolean;
@@ -45,6 +45,7 @@ export interface SmartFixedFilterRaw extends TableParams {
45
45
  reportedAt?: number[];
46
46
  }
47
47
  export interface SmartFixedOptions {
48
+ tab?: Tab;
48
49
  deviceNameOptions?: boolean;
49
50
  skuOptions?: boolean;
50
51
  brandOptions?: boolean;
@@ -53,11 +54,20 @@ export interface SmartFixedOptions {
53
54
  reportedByOptions?: boolean;
54
55
  }
55
56
  export interface TabletFilterRaw extends TableParams {
56
- deviceName: string[];
57
+ tab?: Tab;
58
+ deviceName?: string[];
59
+ status?: string[];
60
+ group?: string[];
61
+ reader?: string[];
62
+ registeredAt?: number[];
63
+ reportedBy?: string[];
64
+ reportedAt?: number[];
57
65
  }
58
66
  export interface TabletOptions {
67
+ tab?: Tab;
68
+ statusOptions?: boolean;
59
69
  deviceNameOptions?: boolean;
60
- skuOptions?: boolean;
70
+ readerOptions?: boolean;
61
71
  reportedByOptions?: boolean;
62
72
  }
63
73
  export interface PutEditAliasName {
@@ -110,48 +120,4 @@ export interface PutHardwareStatusBody {
110
120
  status: 'Missing' | 'Damaged' | 'Available';
111
121
  }
112
122
  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
123
  export {};
@@ -1,13 +1,11 @@
1
1
  import { AxiosResponse } from 'axios';
2
2
  import { FetchDetailResponse, FetchListResponse, FetchOptionResponse, FilterQuery, ShortFetchListResponse } from '../types/fetchResponse.type';
3
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';
4
+ import { HandheldDataType, HandheldDetailDataType, PingSmartFixed, SmartFixedDataType, SmartFixedDetailDataType, Tablet } from '../types/hardware.type';
5
5
  declare const HardwareServices: {
6
6
  getHandheldReader: (params?: FilterQuery<HandheldFilterRaw>) => Promise<AxiosResponse<FetchListResponse<HandheldDataType>>>;
7
7
  getHandheldReaderDetail: (handheldId?: string) => Promise<AxiosResponse<FetchDetailResponse<HandheldDetailDataType>>>;
8
- getHandheldReaderOptions: (body?: HandheldOptions & {
9
- tab?: Tab;
10
- }) => Promise<AxiosResponse<{
8
+ getHandheldReaderOptions: (body?: HandheldOptions) => Promise<AxiosResponse<{
11
9
  data: FetchOptionResponse<HandheldOptions>;
12
10
  }>>;
13
11
  putHardwareStatus: (moduleTab: "smart-fixed-readers" | "handheld-readers" | "tablets", ids: string[], body: PutHardwareStatusBody) => Promise<AxiosResponse>;
@@ -18,16 +16,13 @@ declare const HardwareServices: {
18
16
  deleteHardware: (moduleTab: "smart-fixed-readers" | "handheld-readers" | "tablets", params?: DeleteHardware) => Promise<AxiosResponse>;
19
17
  getSmartFixedReader: (params?: FilterQuery<SmartFixedFilterRaw>) => Promise<AxiosResponse<FetchListResponse<SmartFixedDataType>>>;
20
18
  getSmartFixedReaderDetail: (smartFixedId?: string) => Promise<AxiosResponse<FetchDetailResponse<SmartFixedDetailDataType>>>;
21
- getSmartFixedReaderOptions: (params?: SmartFixedOptions & {
22
- tab?: Tab;
23
- }) => Promise<AxiosResponse<{
19
+ getSmartFixedReaderOptions: (params?: SmartFixedOptions) => Promise<AxiosResponse<{
24
20
  data: FetchOptionResponse<SmartFixedOptions>;
25
21
  }>>;
26
22
  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<{
23
+ getTablet: (params?: FilterQuery<TabletFilterRaw>) => Promise<AxiosResponse<FetchListResponse<Tablet>>>;
24
+ getTabletOptions: (params?: TabletOptions) => Promise<AxiosResponse<{
29
25
  data: FetchOptionResponse<TabletOptions>;
30
26
  }>>;
31
- disconnectTablet: (id: string, body?: DeleteHardware) => Promise<AxiosResponse>;
32
27
  };
33
28
  export default HardwareServices;
@@ -5,21 +5,21 @@ export type ModuleType = 'fixedAsset' | 'supplyAsset';
5
5
  export type Tab = 'Available' | 'Damaged/Missing';
6
6
  export interface HardwareDetailDataType {
7
7
  _id: string;
8
- image?: string;
8
+ image: string | null;
9
9
  deviceName: string;
10
10
  sku: string;
11
11
  serialNumber: string;
12
- aliasName?: string;
13
- }
14
- export interface HandheldDataType extends HandheldDetailDataType {
15
- reportedBy?: string;
16
- reportedAt?: Date;
12
+ aliasName: string | null;
17
13
  }
18
14
  export interface HandheldDetailDataType extends HardwareDetailDataType {
19
15
  type: string;
20
16
  status: string;
21
17
  group: ReaderGroup;
22
18
  }
19
+ export interface HandheldDataType extends HandheldDetailDataType {
20
+ reportedBy: string | null;
21
+ reportedAt: Date | null;
22
+ }
23
23
  export interface ReaderGroup {
24
24
  fixedAsset?: {
25
25
  _id: string;
@@ -43,13 +43,6 @@ export interface SmartFixedGroupList {
43
43
  fixedAsset: (string | null)[];
44
44
  supplyAsset: (string | null)[];
45
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
46
  export interface SmartFixedDetailDataType extends HardwareDetailDataType {
54
47
  activePort: string;
55
48
  networkStatus: string;
@@ -59,10 +52,24 @@ export interface SmartFixedDetailDataType extends HardwareDetailDataType {
59
52
  readerGroup: SmartFixedGroup;
60
53
  rssi: string;
61
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
62
  export interface Tablet {
63
63
  _id: string;
64
64
  deviceName: string;
65
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;
66
73
  }
67
74
  export interface PingSmartFixed {
68
75
  _id: string;