hik-iot-sdk 1.0.0
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/README.md +467 -0
- package/dist/core/__tests__/crypto.test.d.ts +1 -0
- package/dist/core/__tests__/crypto.test.js +68 -0
- package/dist/core/auth.d.ts +51 -0
- package/dist/core/auth.js +292 -0
- package/dist/core/config.d.ts +31 -0
- package/dist/core/config.js +11 -0
- package/dist/core/crypto.d.ts +12 -0
- package/dist/core/crypto.js +88 -0
- package/dist/core/errors.d.ts +45 -0
- package/dist/core/errors.js +61 -0
- package/dist/core/http.d.ts +29 -0
- package/dist/core/http.js +134 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +10 -0
- package/dist/modules/access/access.schema.d.ts +2307 -0
- package/dist/modules/access/access.schema.js +353 -0
- package/dist/modules/access/access.service.d.ts +55 -0
- package/dist/modules/access/access.service.js +145 -0
- package/dist/modules/access/access.types.d.ts +307 -0
- package/dist/modules/access/access.types.js +3 -0
- package/dist/modules/access/index.d.ts +2 -0
- package/dist/modules/access/index.js +20 -0
- package/dist/modules/card/card.schema.d.ts +27 -0
- package/dist/modules/card/card.schema.js +12 -0
- package/dist/modules/card/card.service.d.ts +10 -0
- package/dist/modules/card/card.service.js +50 -0
- package/dist/modules/card/card.types.d.ts +18 -0
- package/dist/modules/card/card.types.js +2 -0
- package/dist/modules/device/device.schema.d.ts +258 -0
- package/dist/modules/device/device.schema.js +44 -0
- package/dist/modules/device/device.service.d.ts +14 -0
- package/dist/modules/device/device.service.js +69 -0
- package/dist/modules/device/device.types.d.ts +46 -0
- package/dist/modules/device/device.types.js +2 -0
- package/dist/modules/face/face.schema.d.ts +27 -0
- package/dist/modules/face/face.schema.js +12 -0
- package/dist/modules/face/face.service.d.ts +9 -0
- package/dist/modules/face/face.service.js +42 -0
- package/dist/modules/face/face.types.d.ts +17 -0
- package/dist/modules/face/face.types.js +2 -0
- package/dist/modules/person/person.schema.d.ts +270 -0
- package/dist/modules/person/person.schema.js +42 -0
- package/dist/modules/person/person.service.d.ts +16 -0
- package/dist/modules/person/person.service.js +88 -0
- package/dist/modules/person/person.types.d.ts +65 -0
- package/dist/modules/person/person.types.js +2 -0
- package/dist/sdk.d.ts +60 -0
- package/dist/sdk.js +106 -0
- package/package.json +29 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HolidayGroupDetailResponseSchema = exports.HolidayGroupListResponseSchema = exports.TimePlanDetailResponseSchema = exports.TimePlanListResponseSchema = exports.AuthPicUrlResponseSchema = exports.AccessEventDetailResponseSchema = exports.AccessEventPageResponseSchema = exports.IssueResponseSchema = exports.PasswordListResponseSchema = exports.WaitIssueInfoResponseSchema = exports.PersonDeviceDetailResponseSchema = exports.PersonDevicePageResponseSchema = exports.DeviceGroupPageResponseSchema = exports.DeviceGroupDetailResponseSchema = exports.AuthorityConfigPageResponseSchema = exports.AuthorityConfigDetailResponseSchema = exports.AuthorityConfigAddResponseSchema = exports.StringDataResponseSchema = exports.SimpleResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// 通用响应
|
|
6
|
+
exports.SimpleResponseSchema = zod_1.z.object({
|
|
7
|
+
code: zod_1.z.number(),
|
|
8
|
+
msg: zod_1.z.string(),
|
|
9
|
+
});
|
|
10
|
+
exports.StringDataResponseSchema = zod_1.z.object({
|
|
11
|
+
code: zod_1.z.number(),
|
|
12
|
+
msg: zod_1.z.string(),
|
|
13
|
+
data: zod_1.z.string().nullable().optional(),
|
|
14
|
+
});
|
|
15
|
+
// 权限配置响应
|
|
16
|
+
exports.AuthorityConfigAddResponseSchema = zod_1.z.object({
|
|
17
|
+
code: zod_1.z.number(),
|
|
18
|
+
msg: zod_1.z.string(),
|
|
19
|
+
data: zod_1.z.string(),
|
|
20
|
+
});
|
|
21
|
+
exports.AuthorityConfigDetailResponseSchema = zod_1.z.object({
|
|
22
|
+
code: zod_1.z.number(),
|
|
23
|
+
msg: zod_1.z.string(),
|
|
24
|
+
data: zod_1.z.object({
|
|
25
|
+
id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform(String),
|
|
26
|
+
timePlanId: zod_1.z.number(),
|
|
27
|
+
timePlanName: zod_1.z.string().nullable().optional(),
|
|
28
|
+
teamNo: zod_1.z.string(),
|
|
29
|
+
configName: zod_1.z.string(),
|
|
30
|
+
configDesc: zod_1.z.string(),
|
|
31
|
+
isValid: zod_1.z.number(),
|
|
32
|
+
isDefault: zod_1.z.number(),
|
|
33
|
+
gmtCreate: zod_1.z.string(),
|
|
34
|
+
selectSubjectType: zod_1.z.number(),
|
|
35
|
+
timePlanWorkdayDetailVOList: zod_1.z.array(zod_1.z.object({
|
|
36
|
+
workdayWeekdayList: zod_1.z.array(zod_1.z.number()),
|
|
37
|
+
workdayPeriodList: zod_1.z.array(zod_1.z.object({
|
|
38
|
+
startTime: zod_1.z.string(),
|
|
39
|
+
endTime: zod_1.z.string(),
|
|
40
|
+
})),
|
|
41
|
+
})).optional(),
|
|
42
|
+
timePlanHolidayId: zod_1.z.number().optional(),
|
|
43
|
+
timePlanHolidayName: zod_1.z.string().optional(),
|
|
44
|
+
personResponseVOList: zod_1.z.array(zod_1.z.object({
|
|
45
|
+
selectType: zod_1.z.number(),
|
|
46
|
+
subjectNo: zod_1.z.string(),
|
|
47
|
+
personNo: zod_1.z.string().optional(),
|
|
48
|
+
personName: zod_1.z.string().optional(),
|
|
49
|
+
avatarUrl: zod_1.z.string().optional(),
|
|
50
|
+
pathName: zod_1.z.string().optional(),
|
|
51
|
+
})).optional(),
|
|
52
|
+
deviceResponseVOList: zod_1.z.array(zod_1.z.object({
|
|
53
|
+
selectType: zod_1.z.number(),
|
|
54
|
+
deviceSerial: zod_1.z.string().nullable().optional(),
|
|
55
|
+
groupNo: zod_1.z.string().nullable().optional(),
|
|
56
|
+
deviceGroupName: zod_1.z.string().nullable().optional(),
|
|
57
|
+
deviceGroupDesc: zod_1.z.string().nullable().optional(),
|
|
58
|
+
deviceSerialList: zod_1.z.array(zod_1.z.string()).optional(),
|
|
59
|
+
deviceName: zod_1.z.string().optional(),
|
|
60
|
+
iconUrl: zod_1.z.string().optional(),
|
|
61
|
+
resourceId: zod_1.z.number().optional(),
|
|
62
|
+
resourceName: zod_1.z.string().optional(),
|
|
63
|
+
})).optional(),
|
|
64
|
+
personNames: zod_1.z.array(zod_1.z.string()).optional(),
|
|
65
|
+
deviceNames: zod_1.z.array(zod_1.z.string()).optional(),
|
|
66
|
+
}),
|
|
67
|
+
});
|
|
68
|
+
exports.AuthorityConfigPageResponseSchema = zod_1.z.object({
|
|
69
|
+
code: zod_1.z.number(),
|
|
70
|
+
msg: zod_1.z.string(),
|
|
71
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
72
|
+
id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform(String),
|
|
73
|
+
timePlanId: zod_1.z.number(),
|
|
74
|
+
timePlanName: zod_1.z.string().nullable().optional(),
|
|
75
|
+
teamNo: zod_1.z.string(),
|
|
76
|
+
configName: zod_1.z.string(),
|
|
77
|
+
configDesc: zod_1.z.string(),
|
|
78
|
+
isValid: zod_1.z.number(),
|
|
79
|
+
isDefault: zod_1.z.number(),
|
|
80
|
+
gmtCreate: zod_1.z.string(),
|
|
81
|
+
selectSubjectType: zod_1.z.number(),
|
|
82
|
+
personResponseVOList: zod_1.z.array(zod_1.z.object({
|
|
83
|
+
selectType: zod_1.z.number(),
|
|
84
|
+
subjectNo: zod_1.z.string(),
|
|
85
|
+
})).optional(),
|
|
86
|
+
deviceResponseVOList: zod_1.z.array(zod_1.z.object({
|
|
87
|
+
selectType: zod_1.z.number(),
|
|
88
|
+
deviceSerial: zod_1.z.string().nullable().optional(),
|
|
89
|
+
subjectNo: zod_1.z.string().optional(),
|
|
90
|
+
deviceGroupName: zod_1.z.string().optional(),
|
|
91
|
+
deviceGroupDesc: zod_1.z.string().optional(),
|
|
92
|
+
})).optional(),
|
|
93
|
+
})),
|
|
94
|
+
count: zod_1.z.number(),
|
|
95
|
+
});
|
|
96
|
+
// 设备分组响应
|
|
97
|
+
exports.DeviceGroupDetailResponseSchema = zod_1.z.object({
|
|
98
|
+
code: zod_1.z.number(),
|
|
99
|
+
msg: zod_1.z.string(),
|
|
100
|
+
data: zod_1.z.object({
|
|
101
|
+
id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform(String),
|
|
102
|
+
teamNo: zod_1.z.string(),
|
|
103
|
+
appNo: zod_1.z.string(),
|
|
104
|
+
deviceGroupName: zod_1.z.string(),
|
|
105
|
+
deviceGroupNo: zod_1.z.string(),
|
|
106
|
+
deviceGroupDesc: zod_1.z.string().nullable().optional(),
|
|
107
|
+
isDefault: zod_1.z.number(),
|
|
108
|
+
isUsed: zod_1.z.number().optional(),
|
|
109
|
+
deviceSerialList: zod_1.z.array(zod_1.z.string()),
|
|
110
|
+
}),
|
|
111
|
+
});
|
|
112
|
+
exports.DeviceGroupPageResponseSchema = zod_1.z.object({
|
|
113
|
+
code: zod_1.z.number(),
|
|
114
|
+
msg: zod_1.z.string(),
|
|
115
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
116
|
+
id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform(String),
|
|
117
|
+
teamNo: zod_1.z.string(),
|
|
118
|
+
appNo: zod_1.z.string(),
|
|
119
|
+
deviceGroupName: zod_1.z.string(),
|
|
120
|
+
deviceGroupNo: zod_1.z.string(),
|
|
121
|
+
deviceGroupDesc: zod_1.z.string().nullable().optional(),
|
|
122
|
+
isDefault: zod_1.z.number(),
|
|
123
|
+
isUsed: zod_1.z.number().optional(),
|
|
124
|
+
deviceSerialList: zod_1.z.array(zod_1.z.string()),
|
|
125
|
+
})),
|
|
126
|
+
count: zod_1.z.number(),
|
|
127
|
+
});
|
|
128
|
+
// 通行权限响应
|
|
129
|
+
const InfoStatusSchema = zod_1.z.object({
|
|
130
|
+
id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform(String),
|
|
131
|
+
dataType: zod_1.z.number().optional(),
|
|
132
|
+
dataTypeDetail: zod_1.z.string().optional(),
|
|
133
|
+
teamNo: zod_1.z.string().optional(),
|
|
134
|
+
personDeviceId: zod_1.z.number().optional(),
|
|
135
|
+
infoStatus: zod_1.z.number(),
|
|
136
|
+
isSupport: zod_1.z.boolean(),
|
|
137
|
+
isSending: zod_1.z.boolean(),
|
|
138
|
+
waitIssue: zod_1.z.boolean().optional(),
|
|
139
|
+
lastFailedReason: zod_1.z.string().nullable().optional(),
|
|
140
|
+
}).nullable();
|
|
141
|
+
exports.PersonDevicePageResponseSchema = zod_1.z.object({
|
|
142
|
+
code: zod_1.z.number(),
|
|
143
|
+
msg: zod_1.z.string(),
|
|
144
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
145
|
+
id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform(String),
|
|
146
|
+
teamNo: zod_1.z.string(),
|
|
147
|
+
personNo: zod_1.z.string(),
|
|
148
|
+
personName: zod_1.z.string().optional(),
|
|
149
|
+
deviceSerial: zod_1.z.string(),
|
|
150
|
+
gmtCreate: zod_1.z.string(),
|
|
151
|
+
effectiveDateType: zod_1.z.number().optional(),
|
|
152
|
+
effectiveStartDate: zod_1.z.string().nullable().optional(),
|
|
153
|
+
effectiveEndDate: zod_1.z.string().nullable().optional(),
|
|
154
|
+
userVO: InfoStatusSchema.optional(),
|
|
155
|
+
faceVO: InfoStatusSchema.optional(),
|
|
156
|
+
fingerVO: InfoStatusSchema.optional(),
|
|
157
|
+
cardVO: InfoStatusSchema.optional(),
|
|
158
|
+
passwordVO: InfoStatusSchema.optional(),
|
|
159
|
+
doorVOList: zod_1.z.array(zod_1.z.object({
|
|
160
|
+
resourceSerial: zod_1.z.string(),
|
|
161
|
+
timePlanIds: zod_1.z.array(zod_1.z.number()),
|
|
162
|
+
})).optional(),
|
|
163
|
+
})),
|
|
164
|
+
count: zod_1.z.number(),
|
|
165
|
+
});
|
|
166
|
+
exports.PersonDeviceDetailResponseSchema = zod_1.z.object({
|
|
167
|
+
code: zod_1.z.number(),
|
|
168
|
+
msg: zod_1.z.string(),
|
|
169
|
+
data: zod_1.z.object({
|
|
170
|
+
id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform(String),
|
|
171
|
+
teamNo: zod_1.z.string(),
|
|
172
|
+
personNo: zod_1.z.string(),
|
|
173
|
+
personName: zod_1.z.string().optional(),
|
|
174
|
+
deviceSerial: zod_1.z.string(),
|
|
175
|
+
gmtCreate: zod_1.z.string(),
|
|
176
|
+
effectiveDateType: zod_1.z.number().optional(),
|
|
177
|
+
effectiveStartDate: zod_1.z.string().nullable().optional(),
|
|
178
|
+
effectiveEndDate: zod_1.z.string().nullable().optional(),
|
|
179
|
+
userVO: InfoStatusSchema.optional(),
|
|
180
|
+
faceVO: InfoStatusSchema.optional(),
|
|
181
|
+
fingerVO: InfoStatusSchema.optional(),
|
|
182
|
+
cardVO: InfoStatusSchema.optional(),
|
|
183
|
+
passwordVO: InfoStatusSchema.optional(),
|
|
184
|
+
doorVOList: zod_1.z.array(zod_1.z.object({
|
|
185
|
+
resourceSerial: zod_1.z.string(),
|
|
186
|
+
timePlanIds: zod_1.z.array(zod_1.z.number()),
|
|
187
|
+
})).optional(),
|
|
188
|
+
}),
|
|
189
|
+
});
|
|
190
|
+
exports.WaitIssueInfoResponseSchema = zod_1.z.object({
|
|
191
|
+
code: zod_1.z.number(),
|
|
192
|
+
msg: zod_1.z.string(),
|
|
193
|
+
data: zod_1.z.object({
|
|
194
|
+
userCount: zod_1.z.number(),
|
|
195
|
+
faceCount: zod_1.z.number(),
|
|
196
|
+
cardCount: zod_1.z.number(),
|
|
197
|
+
fingerCount: zod_1.z.number(),
|
|
198
|
+
doorCount: zod_1.z.number(),
|
|
199
|
+
passwordCount: zod_1.z.number(),
|
|
200
|
+
totalCount: zod_1.z.number(),
|
|
201
|
+
}),
|
|
202
|
+
});
|
|
203
|
+
exports.PasswordListResponseSchema = zod_1.z.object({
|
|
204
|
+
code: zod_1.z.number(),
|
|
205
|
+
msg: zod_1.z.string(),
|
|
206
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
207
|
+
resourceSerial: zod_1.z.string(),
|
|
208
|
+
password: zod_1.z.string(),
|
|
209
|
+
infoStatus: zod_1.z.number(),
|
|
210
|
+
})),
|
|
211
|
+
});
|
|
212
|
+
// 下发响应
|
|
213
|
+
exports.IssueResponseSchema = zod_1.z.object({
|
|
214
|
+
code: zod_1.z.number(),
|
|
215
|
+
msg: zod_1.z.string(),
|
|
216
|
+
data: zod_1.z.string().nullable().optional(),
|
|
217
|
+
});
|
|
218
|
+
// 开门记录响应
|
|
219
|
+
exports.AccessEventPageResponseSchema = zod_1.z.object({
|
|
220
|
+
code: zod_1.z.number(),
|
|
221
|
+
msg: zod_1.z.string(),
|
|
222
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
223
|
+
originId: zod_1.z.string(),
|
|
224
|
+
secMsgCode: zod_1.z.string().optional(),
|
|
225
|
+
title: zod_1.z.string().optional(),
|
|
226
|
+
subTitle: zod_1.z.string().optional(),
|
|
227
|
+
personName: zod_1.z.string().nullable().optional(),
|
|
228
|
+
employeeNo: zod_1.z.string().nullable().optional(),
|
|
229
|
+
personNo: zod_1.z.string().nullable().optional(),
|
|
230
|
+
departmentName: zod_1.z.string().nullable().optional(),
|
|
231
|
+
gmtCreate: zod_1.z.string(),
|
|
232
|
+
gwDeviceSerial: zod_1.z.string().optional(),
|
|
233
|
+
deviceSerial: zod_1.z.string(),
|
|
234
|
+
resourceName: zod_1.z.string().optional(),
|
|
235
|
+
accessTypeMsg: zod_1.z.string().optional(),
|
|
236
|
+
authResultMsg: zod_1.z.string().optional(),
|
|
237
|
+
temperatureType: zod_1.z.number().optional(),
|
|
238
|
+
personType: zod_1.z.number().optional(),
|
|
239
|
+
portraitUrl: zod_1.z.string().nullable().optional(),
|
|
240
|
+
deviceName: zod_1.z.string().optional(),
|
|
241
|
+
accessType: zod_1.z.number().optional(),
|
|
242
|
+
authResult: zod_1.z.number().optional(),
|
|
243
|
+
isContainsFaceChannel: zod_1.z.boolean().optional(),
|
|
244
|
+
isFromLink: zod_1.z.boolean().optional(),
|
|
245
|
+
cardType: zod_1.z.number().nullable().optional(),
|
|
246
|
+
cardNo: zod_1.z.string().nullable().optional(),
|
|
247
|
+
picUrl: zod_1.z.string().nullable().optional(),
|
|
248
|
+
})),
|
|
249
|
+
count: zod_1.z.number(),
|
|
250
|
+
});
|
|
251
|
+
exports.AccessEventDetailResponseSchema = zod_1.z.object({
|
|
252
|
+
code: zod_1.z.number(),
|
|
253
|
+
msg: zod_1.z.string(),
|
|
254
|
+
data: zod_1.z.object({
|
|
255
|
+
originId: zod_1.z.string(),
|
|
256
|
+
secMsgCode: zod_1.z.string().optional(),
|
|
257
|
+
title: zod_1.z.string().optional(),
|
|
258
|
+
subTitle: zod_1.z.string().optional(),
|
|
259
|
+
personName: zod_1.z.string().nullable().optional(),
|
|
260
|
+
employeeNo: zod_1.z.string().nullable().optional(),
|
|
261
|
+
personNo: zod_1.z.string().nullable().optional(),
|
|
262
|
+
departmentName: zod_1.z.string().nullable().optional(),
|
|
263
|
+
gmtCreate: zod_1.z.string(),
|
|
264
|
+
gwDeviceSerial: zod_1.z.string().optional(),
|
|
265
|
+
deviceSerial: zod_1.z.string(),
|
|
266
|
+
resourceName: zod_1.z.string().optional(),
|
|
267
|
+
accessTypeMsg: zod_1.z.string().optional(),
|
|
268
|
+
authResultMsg: zod_1.z.string().optional(),
|
|
269
|
+
temperatureType: zod_1.z.number().optional(),
|
|
270
|
+
personType: zod_1.z.number().optional(),
|
|
271
|
+
portraitUrl: zod_1.z.string().nullable().optional(),
|
|
272
|
+
deviceName: zod_1.z.string().optional(),
|
|
273
|
+
accessType: zod_1.z.number().optional(),
|
|
274
|
+
authResult: zod_1.z.number().optional(),
|
|
275
|
+
isContainsFaceChannel: zod_1.z.boolean().optional(),
|
|
276
|
+
isFromLink: zod_1.z.boolean().optional(),
|
|
277
|
+
cardType: zod_1.z.number().nullable().optional(),
|
|
278
|
+
cardNo: zod_1.z.string().nullable().optional(),
|
|
279
|
+
picUrl: zod_1.z.string().nullable().optional(),
|
|
280
|
+
receiverNo: zod_1.z.string().optional(),
|
|
281
|
+
zoneName: zod_1.z.string().nullable().optional(),
|
|
282
|
+
serialNo: zod_1.z.number().nullable().optional(),
|
|
283
|
+
resourceZone: zod_1.z.string().nullable().optional(),
|
|
284
|
+
currTemperature: zod_1.z.number().nullable().optional(),
|
|
285
|
+
isAbnormalTemperature: zod_1.z.boolean().nullable().optional(),
|
|
286
|
+
healthCode: zod_1.z.number().nullable().optional(),
|
|
287
|
+
cardReaderType: zod_1.z.string().nullable().optional(),
|
|
288
|
+
}),
|
|
289
|
+
});
|
|
290
|
+
exports.AuthPicUrlResponseSchema = zod_1.z.object({
|
|
291
|
+
code: zod_1.z.number(),
|
|
292
|
+
msg: zod_1.z.string(),
|
|
293
|
+
data: zod_1.z.object({
|
|
294
|
+
originId: zod_1.z.string(),
|
|
295
|
+
teamNo: zod_1.z.string(),
|
|
296
|
+
authPicUrl: zod_1.z.string(),
|
|
297
|
+
}),
|
|
298
|
+
});
|
|
299
|
+
// 时间计划响应
|
|
300
|
+
exports.TimePlanListResponseSchema = zod_1.z.object({
|
|
301
|
+
code: zod_1.z.number(),
|
|
302
|
+
msg: zod_1.z.string(),
|
|
303
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
304
|
+
id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform(String),
|
|
305
|
+
timePlanName: zod_1.z.string(),
|
|
306
|
+
timePlanDesc: zod_1.z.string().nullable().optional(),
|
|
307
|
+
isDefault: zod_1.z.number().optional().default(0),
|
|
308
|
+
})),
|
|
309
|
+
});
|
|
310
|
+
exports.TimePlanDetailResponseSchema = zod_1.z.object({
|
|
311
|
+
code: zod_1.z.number(),
|
|
312
|
+
msg: zod_1.z.string(),
|
|
313
|
+
data: zod_1.z.object({
|
|
314
|
+
id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform(String),
|
|
315
|
+
timePlanName: zod_1.z.string(),
|
|
316
|
+
timePlanDesc: zod_1.z.string().nullable().optional(),
|
|
317
|
+
holidayGroupId: zod_1.z.number().optional(),
|
|
318
|
+
holidayGroupName: zod_1.z.string().optional(),
|
|
319
|
+
workdayDetailList: zod_1.z.array(zod_1.z.object({
|
|
320
|
+
workdayWeekdayList: zod_1.z.array(zod_1.z.number()),
|
|
321
|
+
workdayPeriodList: zod_1.z.array(zod_1.z.object({
|
|
322
|
+
startTime: zod_1.z.string(),
|
|
323
|
+
endTime: zod_1.z.string(),
|
|
324
|
+
})),
|
|
325
|
+
})),
|
|
326
|
+
isDefault: zod_1.z.number(),
|
|
327
|
+
}),
|
|
328
|
+
});
|
|
329
|
+
exports.HolidayGroupListResponseSchema = zod_1.z.object({
|
|
330
|
+
code: zod_1.z.number(),
|
|
331
|
+
msg: zod_1.z.string(),
|
|
332
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
333
|
+
id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform(String),
|
|
334
|
+
holidayGroupName: zod_1.z.string(),
|
|
335
|
+
holidayGroupDesc: zod_1.z.string().nullable().optional(),
|
|
336
|
+
})),
|
|
337
|
+
});
|
|
338
|
+
exports.HolidayGroupDetailResponseSchema = zod_1.z.object({
|
|
339
|
+
code: zod_1.z.number(),
|
|
340
|
+
msg: zod_1.z.string(),
|
|
341
|
+
data: zod_1.z.object({
|
|
342
|
+
id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform(String),
|
|
343
|
+
holidayGroupName: zod_1.z.string(),
|
|
344
|
+
holidayGroupDesc: zod_1.z.string().nullable().optional(),
|
|
345
|
+
holidayList: zod_1.z.array(zod_1.z.object({
|
|
346
|
+
holidayDate: zod_1.z.string(),
|
|
347
|
+
holidayPeriodList: zod_1.z.array(zod_1.z.object({
|
|
348
|
+
startTime: zod_1.z.string(),
|
|
349
|
+
endTime: zod_1.z.string(),
|
|
350
|
+
})),
|
|
351
|
+
})),
|
|
352
|
+
}),
|
|
353
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { HttpClient } from '../../core/http';
|
|
2
|
+
import type { AddAuthorityConfigInput, UpdateAuthorityConfigInput, AuthorityConfigDetail, AuthorityConfigListItem, SaveDeviceGroupInput, DeviceGroupDetail, PersonDevicePageInput, PersonDeviceItem, WaitIssueInfo, PasswordInfo, ManualIssueInput, SelectIssueInput, CoverIssueInput, AccessEventPageInput, AccessEventItem, AuthPicUrlInput, AuthPicUrlResult, HolidayGroupInput, UpdateHolidayGroupInput, HolidayGroupDetail, TimePlanInput, UpdateTimePlanInput, TimePlanDetail } from './access.types';
|
|
3
|
+
export declare class AccessService {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
addAuthorityConfig(input: AddAuthorityConfigInput): Promise<string>;
|
|
7
|
+
updateAuthorityConfig(input: UpdateAuthorityConfigInput): Promise<void>;
|
|
8
|
+
deleteAuthorityConfig(id: number | string): Promise<void>;
|
|
9
|
+
getAuthorityConfigDetail(id: number | string): Promise<AuthorityConfigDetail>;
|
|
10
|
+
getAuthorityConfigPage(appNo: string, page?: number, size?: number): Promise<{
|
|
11
|
+
data: AuthorityConfigListItem[];
|
|
12
|
+
count: number;
|
|
13
|
+
}>;
|
|
14
|
+
saveDeviceGroup(input: SaveDeviceGroupInput): Promise<void>;
|
|
15
|
+
deleteDeviceGroup(deviceGroupNo: string): Promise<void>;
|
|
16
|
+
getDeviceGroupDetail(deviceGroupNo: string): Promise<DeviceGroupDetail>;
|
|
17
|
+
getDeviceGroupPage(page?: number, size?: number, containsDefault?: boolean): Promise<{
|
|
18
|
+
data: DeviceGroupDetail[];
|
|
19
|
+
count: number;
|
|
20
|
+
}>;
|
|
21
|
+
getPersonDevicePage(input?: PersonDevicePageInput): Promise<{
|
|
22
|
+
data: PersonDeviceItem[];
|
|
23
|
+
count: number;
|
|
24
|
+
}>;
|
|
25
|
+
getPersonDeviceDetail(id: number | string): Promise<PersonDeviceItem>;
|
|
26
|
+
getWaitIssueInfo(deviceSerial?: string): Promise<WaitIssueInfo>;
|
|
27
|
+
listPassword(): Promise<PasswordInfo[]>;
|
|
28
|
+
manualIssue(input?: ManualIssueInput): Promise<string | null>;
|
|
29
|
+
selectIssue(input: SelectIssueInput): Promise<string | null>;
|
|
30
|
+
coverIssue(input: CoverIssueInput): Promise<string | null>;
|
|
31
|
+
getAccessEventPage(input?: AccessEventPageInput): Promise<{
|
|
32
|
+
data: AccessEventItem[];
|
|
33
|
+
count: number;
|
|
34
|
+
}>;
|
|
35
|
+
getAccessEventDetail(originId: string): Promise<AccessEventItem>;
|
|
36
|
+
getAuthPicUrl(input: AuthPicUrlInput): Promise<AuthPicUrlResult>;
|
|
37
|
+
remoteOpenDoor(resourceSerial: string): Promise<void>;
|
|
38
|
+
getTimePlanList(): Promise<{
|
|
39
|
+
id: string;
|
|
40
|
+
timePlanName: string;
|
|
41
|
+
isDefault: number;
|
|
42
|
+
}[]>;
|
|
43
|
+
getTimePlanDetail(timePlanId: number | string): Promise<TimePlanDetail>;
|
|
44
|
+
addTimePlan(input: TimePlanInput): Promise<void>;
|
|
45
|
+
updateTimePlan(input: UpdateTimePlanInput): Promise<void>;
|
|
46
|
+
deleteTimePlan(timePlanId: number | string): Promise<void>;
|
|
47
|
+
getHolidayGroupList(): Promise<{
|
|
48
|
+
id: string;
|
|
49
|
+
holidayGroupName: string;
|
|
50
|
+
}[]>;
|
|
51
|
+
getHolidayGroupDetail(holidayGroupId: number | string): Promise<HolidayGroupDetail>;
|
|
52
|
+
addHolidayGroup(input: HolidayGroupInput): Promise<void>;
|
|
53
|
+
updateHolidayGroup(input: UpdateHolidayGroupInput): Promise<void>;
|
|
54
|
+
deleteHolidayGroup(holidayGroupId: number | string): Promise<void>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccessService = void 0;
|
|
4
|
+
const access_schema_1 = require("./access.schema");
|
|
5
|
+
class AccessService {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
// ============ 权限配置 ============
|
|
10
|
+
async addAuthorityConfig(input) {
|
|
11
|
+
const response = await this.http.post('/issue/v1/authorityConfig/add', input, access_schema_1.AuthorityConfigAddResponseSchema);
|
|
12
|
+
return response.data;
|
|
13
|
+
}
|
|
14
|
+
async updateAuthorityConfig(input) {
|
|
15
|
+
await this.http.post('/issue/v1/authorityConfig/update', input, access_schema_1.SimpleResponseSchema);
|
|
16
|
+
}
|
|
17
|
+
async deleteAuthorityConfig(id) {
|
|
18
|
+
await this.http.get('/issue/v1/authorityConfig/delete', { params: { id: String(id) } }, access_schema_1.SimpleResponseSchema);
|
|
19
|
+
}
|
|
20
|
+
async getAuthorityConfigDetail(id) {
|
|
21
|
+
const response = await this.http.get('/issue/v1/authorityConfig/detail', { params: { id: String(id) } }, access_schema_1.AuthorityConfigDetailResponseSchema);
|
|
22
|
+
return response.data;
|
|
23
|
+
}
|
|
24
|
+
async getAuthorityConfigPage(appNo, page = 1, size = 20) {
|
|
25
|
+
const response = await this.http.get('/issue/v1/authorityConfig/page', { params: { appNo, page, size } }, access_schema_1.AuthorityConfigPageResponseSchema);
|
|
26
|
+
return {
|
|
27
|
+
data: response.data,
|
|
28
|
+
count: response.count,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// ============ 设备分组 ============
|
|
32
|
+
async saveDeviceGroup(input) {
|
|
33
|
+
await this.http.post('/issue/v1/deviceGroup/save', { appNo: 'SBZ', ...input }, access_schema_1.SimpleResponseSchema);
|
|
34
|
+
}
|
|
35
|
+
async deleteDeviceGroup(deviceGroupNo) {
|
|
36
|
+
await this.http.post('/issue/v1/deviceGroup/delete', { deviceGroupNo }, access_schema_1.SimpleResponseSchema);
|
|
37
|
+
}
|
|
38
|
+
async getDeviceGroupDetail(deviceGroupNo) {
|
|
39
|
+
const response = await this.http.get('/issue/v1/deviceGroup/detail', { params: { deviceGroupNo } }, access_schema_1.DeviceGroupDetailResponseSchema);
|
|
40
|
+
return response.data;
|
|
41
|
+
}
|
|
42
|
+
async getDeviceGroupPage(page = 1, size = 20, containsDefault = true) {
|
|
43
|
+
const response = await this.http.get('/issue/v1/deviceGroup/page', { params: { page, size, containsDefault: String(containsDefault) } }, access_schema_1.DeviceGroupPageResponseSchema);
|
|
44
|
+
return {
|
|
45
|
+
data: response.data,
|
|
46
|
+
count: response.count,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
// ============ 通行权限查询 ============
|
|
50
|
+
async getPersonDevicePage(input = {}) {
|
|
51
|
+
const response = await this.http.post('/issue/v1/personDevice/page', { page: 1, size: 20, ...input }, access_schema_1.PersonDevicePageResponseSchema);
|
|
52
|
+
return {
|
|
53
|
+
data: response.data,
|
|
54
|
+
count: response.count,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async getPersonDeviceDetail(id) {
|
|
58
|
+
const response = await this.http.get('/issue/v1/personDevice/detail', { params: { id: String(id) } }, access_schema_1.PersonDeviceDetailResponseSchema);
|
|
59
|
+
return response.data;
|
|
60
|
+
}
|
|
61
|
+
async getWaitIssueInfo(deviceSerial) {
|
|
62
|
+
const response = await this.http.get('/issue/v1/personDevice/waitIssueInfo', deviceSerial ? { params: { deviceSerial } } : undefined, access_schema_1.WaitIssueInfoResponseSchema);
|
|
63
|
+
return response.data;
|
|
64
|
+
}
|
|
65
|
+
async listPassword() {
|
|
66
|
+
const response = await this.http.get('/issue/v1/personDevice/listPassword', undefined, access_schema_1.PasswordListResponseSchema);
|
|
67
|
+
return response.data;
|
|
68
|
+
}
|
|
69
|
+
// ============ 下发 ============
|
|
70
|
+
async manualIssue(input = {}) {
|
|
71
|
+
const response = await this.http.post('/issue/v1/issuedJob/manualIssue', input, access_schema_1.IssueResponseSchema);
|
|
72
|
+
return response.data ?? null;
|
|
73
|
+
}
|
|
74
|
+
async selectIssue(input) {
|
|
75
|
+
const response = await this.http.post('/issue/v1/issuedJob/selectIssue', input, access_schema_1.IssueResponseSchema);
|
|
76
|
+
return response.data ?? null;
|
|
77
|
+
}
|
|
78
|
+
async coverIssue(input) {
|
|
79
|
+
const response = await this.http.post('/issue/v1/issuedJob/coverIssue', input, access_schema_1.IssueResponseSchema);
|
|
80
|
+
return response.data ?? null;
|
|
81
|
+
}
|
|
82
|
+
// ============ 开门记录 ============
|
|
83
|
+
async getAccessEventPage(input = {}) {
|
|
84
|
+
const response = await this.http.post('/issue/v1/event/person/page', { page: 1, size: 20, ...input }, access_schema_1.AccessEventPageResponseSchema);
|
|
85
|
+
return {
|
|
86
|
+
data: response.data,
|
|
87
|
+
count: response.count,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
async getAccessEventDetail(originId) {
|
|
91
|
+
const response = await this.http.get('/issue/v1/event/person/detail', { params: { originId } }, access_schema_1.AccessEventDetailResponseSchema);
|
|
92
|
+
return response.data;
|
|
93
|
+
}
|
|
94
|
+
async getAuthPicUrl(input) {
|
|
95
|
+
const response = await this.http.post('/issue/v1/event/person/authPicUrl', input, access_schema_1.AuthPicUrlResponseSchema);
|
|
96
|
+
return response.data;
|
|
97
|
+
}
|
|
98
|
+
async remoteOpenDoor(resourceSerial) {
|
|
99
|
+
await this.http.get('/issue/v1/device/openDoor', { params: { resourceSerial } }, access_schema_1.SimpleResponseSchema);
|
|
100
|
+
}
|
|
101
|
+
// ============ 时间计划 ============
|
|
102
|
+
async getTimePlanList() {
|
|
103
|
+
const response = await this.http.get('/time/v1/plan/list', undefined, access_schema_1.TimePlanListResponseSchema);
|
|
104
|
+
return response.data.map(item => ({
|
|
105
|
+
id: String(item.id),
|
|
106
|
+
timePlanName: item.timePlanName,
|
|
107
|
+
isDefault: item.isDefault ?? 0,
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
async getTimePlanDetail(timePlanId) {
|
|
111
|
+
const response = await this.http.get('/time/v1/plan/detail', { params: { timePlanId: String(timePlanId) } }, access_schema_1.TimePlanDetailResponseSchema);
|
|
112
|
+
return response.data;
|
|
113
|
+
}
|
|
114
|
+
async addTimePlan(input) {
|
|
115
|
+
await this.http.post('/time/v1/plan/add', input, access_schema_1.SimpleResponseSchema);
|
|
116
|
+
}
|
|
117
|
+
async updateTimePlan(input) {
|
|
118
|
+
await this.http.post('/time/v1/plan/update', input, access_schema_1.SimpleResponseSchema);
|
|
119
|
+
}
|
|
120
|
+
async deleteTimePlan(timePlanId) {
|
|
121
|
+
await this.http.get('/time/v1/plan/del', { params: { timePlanId: String(timePlanId) } }, access_schema_1.SimpleResponseSchema);
|
|
122
|
+
}
|
|
123
|
+
// ============ 节假日组 ============
|
|
124
|
+
async getHolidayGroupList() {
|
|
125
|
+
const response = await this.http.get('/time/v1/plan/holiday/group/list', undefined, access_schema_1.HolidayGroupListResponseSchema);
|
|
126
|
+
return response.data.map(item => ({
|
|
127
|
+
id: String(item.id),
|
|
128
|
+
holidayGroupName: item.holidayGroupName,
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
async getHolidayGroupDetail(holidayGroupId) {
|
|
132
|
+
const response = await this.http.get('/time/v1/plan/holiday/group/detail', { params: { holidayGroupId: String(holidayGroupId) } }, access_schema_1.HolidayGroupDetailResponseSchema);
|
|
133
|
+
return response.data;
|
|
134
|
+
}
|
|
135
|
+
async addHolidayGroup(input) {
|
|
136
|
+
await this.http.post('/time/v1/plan/holiday/group/add', input, access_schema_1.SimpleResponseSchema);
|
|
137
|
+
}
|
|
138
|
+
async updateHolidayGroup(input) {
|
|
139
|
+
await this.http.post('/time/v1/plan/holiday/group/update', input, access_schema_1.SimpleResponseSchema);
|
|
140
|
+
}
|
|
141
|
+
async deleteHolidayGroup(holidayGroupId) {
|
|
142
|
+
await this.http.get('/time/v1/plan/holiday/group/del', { params: { holidayGroupId: String(holidayGroupId) } }, access_schema_1.SimpleResponseSchema);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
exports.AccessService = AccessService;
|