@tagsamurai/fats-api-services 1.0.3-alpha.19 → 1.0.3-alpha.20

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": "1.0.3-alpha.19",
3
+ "version": "1.0.3-alpha.20",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Fixed Asset Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -0,0 +1,63 @@
1
+ import { BaseFilterQueryParams } from './settingsAssetName.dto';
2
+ export interface GetIOTReaderListQueryParams extends BaseFilterQueryParams {
3
+ deviceName?: string[];
4
+ group?: number[];
5
+ status?: string[];
6
+ iotReaderId?: string;
7
+ iotReaderIds?: string[];
8
+ brand?: string[];
9
+ model?: string[];
10
+ reportedDate?: number[];
11
+ manager?: string[];
12
+ networkStatus?: string[];
13
+ antennaGroup?: number[];
14
+ assetControl?: string;
15
+ }
16
+ export interface GetIOTPortListQueryParams extends BaseFilterQueryParams {
17
+ group?: number[];
18
+ networkStatus?: string[];
19
+ activeStatus?: string[];
20
+ }
21
+ export interface GetIOTReaderListOptionsQueryParams {
22
+ deviceNameOptions?: boolean;
23
+ groupOptions?: boolean;
24
+ brandOptions?: boolean;
25
+ modelOptions?: boolean;
26
+ managerOptions?: boolean;
27
+ antennaGroupOptions?: boolean;
28
+ }
29
+ export interface SetIOTAliasNameBody {
30
+ aliasName: string;
31
+ id: string[];
32
+ }
33
+ export interface SetIOTPortGroupBody {
34
+ group: string[];
35
+ }
36
+ export interface SetGroupIOTBody {
37
+ reader: string[];
38
+ group: string;
39
+ }
40
+ type IOTStatus = 'Available' | 'Damaged' | 'Repaired' | 'Missing' | 'Found';
41
+ export interface UpdateReaderBody {
42
+ status: IOTStatus;
43
+ }
44
+ export interface UpdateReaderStatusBody {
45
+ reader: string[];
46
+ status: IOTStatus;
47
+ }
48
+ export type UpdateAntennaStatusBody = Omit<UpdateReaderStatusBody, 'reader'> & {
49
+ antenna: string[];
50
+ };
51
+ export interface SetIOTAntennaPowerBulkBody {
52
+ power: number[];
53
+ }
54
+ export type PingIOTBulkBody = Pick<UpdateReaderStatusBody, 'reader'>;
55
+ export interface GetIOTAntennaListQueryParams extends BaseFilterQueryParams {
56
+ anntenta?: string[];
57
+ brand?: string[];
58
+ model?: string[];
59
+ status?: string[];
60
+ manager?: string[];
61
+ reportedDate?: number[];
62
+ }
63
+ export {};
@@ -0,0 +1,26 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { ChangeLogOptionParams, ChangeLogParams, IOTAntennaList, IOTCheckManager, IOTDetail, IOTPortList, IOTReaderList, IOTReaderListOptions, PingIOTBulk, PingIOTSingle, UpdateReader } from '../types/iot.type';
3
+ import { FetchDetailResponse, FetchListResponse, FetchResponse, ShortFetchListResponse } from '../types/fetchResponse.type';
4
+ import { GetIOTAntennaListQueryParams, GetIOTPortListQueryParams, GetIOTReaderListOptionsQueryParams, GetIOTReaderListQueryParams, PingIOTBulkBody, SetGroupIOTBody, SetIOTAliasNameBody, SetIOTAntennaPowerBulkBody, SetIOTPortGroupBody, UpdateAntennaStatusBody, UpdateReaderBody, UpdateReaderStatusBody } from '../dto/iot.dto';
5
+ declare const IOTService: {
6
+ getIOTAntennaList: (params?: GetIOTAntennaListQueryParams) => Promise<AxiosResponse<FetchListResponse<IOTAntennaList>>>;
7
+ getIOTReaderList: (params: GetIOTReaderListQueryParams) => Promise<AxiosResponse<FetchListResponse<IOTReaderList>>>;
8
+ getIOTReaderListOptions: (params: GetIOTReaderListOptionsQueryParams) => Promise<AxiosResponse<FetchDetailResponse<IOTReaderListOptions>>>;
9
+ setIOTAliasName: (body: SetIOTAliasNameBody) => Promise<AxiosResponse<FetchResponse>>;
10
+ pingIOTSingle: (id: string) => Promise<AxiosResponse<FetchDetailResponse<PingIOTSingle>>>;
11
+ pingIOTBulk: (body: PingIOTBulkBody) => Promise<AxiosResponse<ShortFetchListResponse<PingIOTBulk>>>;
12
+ setIOTAntennaPowerBulk: (id: string, body: SetIOTAntennaPowerBulkBody) => Promise<FetchResponse>;
13
+ getIOTPortList: (id: string, params?: GetIOTPortListQueryParams) => Promise<AxiosResponse<FetchListResponse<IOTPortList>>>;
14
+ getIOTDetail: (id: string) => Promise<AxiosResponse<FetchDetailResponse<IOTDetail>>>;
15
+ getIOTCheckManager: () => Promise<AxiosResponse<FetchDetailResponse<IOTCheckManager>>>;
16
+ updateReader: (id: string, body: UpdateReaderBody) => Promise<AxiosResponse<FetchDetailResponse<UpdateReader>>>;
17
+ updateReaderStatus: (body: UpdateReaderStatusBody) => Promise<AxiosResponse<FetchResponse>>;
18
+ updateAntennaStatus: (body: UpdateAntennaStatusBody) => Promise<AxiosResponse<FetchResponse>>;
19
+ setIOTPortGroup: (id: string, body: SetIOTPortGroupBody) => Promise<AxiosResponse<FetchResponse>>;
20
+ setGroupIOT: (body: SetGroupIOTBody) => Promise<AxiosResponse<FetchResponse>>;
21
+ getDataById: (id: string) => Promise<AxiosResponse>;
22
+ getChangeLog: (params: ChangeLogParams) => Promise<AxiosResponse>;
23
+ getChangeLogOptions: (params: ChangeLogOptionParams) => Promise<AxiosResponse>;
24
+ putData: (id: string, body: object) => Promise<AxiosResponse>;
25
+ };
26
+ export default IOTService;
@@ -0,0 +1,149 @@
1
+ import { Option } from './options.type';
2
+ export type QueryParams = {
3
+ reportedDate?: number[];
4
+ manager?: number[];
5
+ group?: number[];
6
+ qrCode?: string;
7
+ status?: string;
8
+ deviceName?: number[];
9
+ sortOrder?: number;
10
+ sortBy?: string;
11
+ limit?: number;
12
+ page?: number;
13
+ search?: string;
14
+ readerId?: string;
15
+ type?: string;
16
+ activity?: string;
17
+ };
18
+ interface BaseEntity {
19
+ _id: string;
20
+ name: string;
21
+ key: number;
22
+ }
23
+ interface NameEntity extends BaseEntity {
24
+ nameWithSequence: string;
25
+ nameNumber: number;
26
+ }
27
+ interface ManagerEntity {
28
+ _id: string;
29
+ key: number;
30
+ fullName: string;
31
+ }
32
+ interface AssetControl {
33
+ active: boolean;
34
+ roleRestricted: boolean;
35
+ inFrom: BaseEntity[] | null;
36
+ outTo: BaseEntity[] | null;
37
+ }
38
+ interface CRUDPermissions {
39
+ create: boolean;
40
+ view: boolean;
41
+ delete: boolean;
42
+ update: boolean;
43
+ }
44
+ interface HasSystemRoles {
45
+ iotReader: CRUDPermissions;
46
+ }
47
+ export type OptionParams = {
48
+ status?: string;
49
+ deviceNameOptions?: string;
50
+ activityOptions?: string;
51
+ managerOptions?: string;
52
+ assetNameOptions?: string;
53
+ };
54
+ export interface IOTReaderList {
55
+ _id: string;
56
+ image: string | null;
57
+ aliasName: string | null;
58
+ name: NameEntity;
59
+ group: BaseEntity;
60
+ brand: BaseEntity;
61
+ model: BaseEntity;
62
+ manager: ManagerEntity;
63
+ status: string;
64
+ networkStatus: string;
65
+ assetControl: AssetControl;
66
+ hasSystemRoles: HasSystemRoles;
67
+ allPort: number;
68
+ activePort: number;
69
+ antennaGroups: BaseEntity[];
70
+ connectedAntenna: string;
71
+ }
72
+ export type ChangeLogParams = {
73
+ id: string;
74
+ manager?: string[];
75
+ activity?: string[];
76
+ createdAt?: string[];
77
+ sortOrder?: number;
78
+ sortBy?: string;
79
+ limit?: number;
80
+ page?: number;
81
+ search?: string;
82
+ };
83
+ export type ChangeLogOptionParams = {
84
+ id: string;
85
+ managerOptions?: boolean;
86
+ };
87
+ export interface IOTReaderListOptions {
88
+ deviceNameOptions: Option[];
89
+ groupOptions: Option[];
90
+ brandOptions: Option[];
91
+ modelOptions: Option[];
92
+ managerOptions: Option[];
93
+ antennaGroupOptions: Option[];
94
+ }
95
+ export interface IOTPortList {
96
+ networkStatus: string;
97
+ _id: number;
98
+ isActive: boolean;
99
+ port: string;
100
+ group: BaseEntity;
101
+ antennaPower: string;
102
+ hasEditAccess: boolean;
103
+ }
104
+ export interface IOTCheckManager {
105
+ hasTaggedManager: boolean;
106
+ oneOfUser: string;
107
+ }
108
+ export interface IOTDetail {
109
+ _id: string;
110
+ image: string | null;
111
+ name: NameEntity;
112
+ totalPort: number;
113
+ group: BaseEntity;
114
+ brand: BaseEntity;
115
+ model: BaseEntity;
116
+ networkStatus: 'Online' | 'Offline';
117
+ assetControl: AssetControl;
118
+ }
119
+ export interface UpdateReader {
120
+ name: BaseEntity & {
121
+ nameWithSequence: string;
122
+ };
123
+ group: BaseEntity;
124
+ _id: string;
125
+ serialNumber: string;
126
+ status: string;
127
+ }
128
+ export interface PingIOTSingle {
129
+ status: string;
130
+ }
131
+ export interface PingIOTBulk {
132
+ reader: string;
133
+ networkStatus: string;
134
+ }
135
+ export interface IOTAntennaList {
136
+ _id: string;
137
+ imageSmall: string;
138
+ imageMedium: string;
139
+ imageBig: string;
140
+ brand: BaseEntity;
141
+ model: BaseEntity;
142
+ reportedDate: string | Date | null;
143
+ status: string;
144
+ antenna: BaseEntity & {
145
+ nameWithSequence: string;
146
+ nameNumber: number;
147
+ };
148
+ }
149
+ export {};