zklib-ts 1.0.4-development → 1.0.4

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.
@@ -21,6 +21,36 @@ interface UDPHeader {
21
21
  interface TCPHeader extends UDPHeader {
22
22
  payloadSize: number;
23
23
  }
24
+ export type FreeSizes = {
25
+ /** Number of users */
26
+ userCounts: number;
27
+ /** Number of logs */
28
+ logCounts: number;
29
+ /** Number of fingerprints */
30
+ fingerCount: number;
31
+ /** Number of admins */
32
+ adminCount: number;
33
+ /** Number or opLogs, maybe access control events? */
34
+ opLogCount: number;
35
+ /** Capacity of logs in bytes */
36
+ logCapacity: number;
37
+ /** Capacity of fingerprints */
38
+ fingerCapacity: number;
39
+ /** Capacity of users */
40
+ userCapacity: number;
41
+ /** Capacity of oplog */
42
+ attLogCapacity: number;
43
+ /** Number of available finger templates */
44
+ fingerAvailable: number;
45
+ /** Number of available Users */
46
+ userAvailable: number;
47
+ /** Number of attendanceLog available */
48
+ attLogAvailable: number;
49
+ /** Number of faces */
50
+ faceCount: number;
51
+ /** Capacity of faces */
52
+ faceCapacity: number;
53
+ };
24
54
  export declare const createUDPHeader: (command: number, sessionId: number, replyId: number, data: any) => Buffer;
25
55
  export declare const createTCPHeader: (command: number, sessionId: number, replyId: number, data: any) => Buffer;
26
56
  export declare const removeTcpHeader: (buf: Buffer) => Buffer;
package/dist/index.cjs.js CHANGED
@@ -2755,7 +2755,7 @@ class Zklib {
2755
2755
  return this.functionWrapper(() => this.ztcp.restartDevice(), async () => { throw new Error('UDP restart device not supported'); }, 'RESTART_DEVICE');
2756
2756
  }
2757
2757
  async getSizes() {
2758
- return this.functionWrapper(() => this.ztcp.getSizes(), () => this.zudp.getInfo(), 'GET_SIZES');
2758
+ return this.functionWrapper(() => this.ztcp.getSizes(), () => { throw new Error('not implemented ofr UDP'); }, 'GET_SIZES');
2759
2759
  }
2760
2760
  async disconnect() {
2761
2761
  return this.functionWrapper(() => this.ztcp.disconnect(), () => this.zudp.disconnect(), 'DISCONNECT');
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { ZUDP } from './zudp';
3
3
  import { User } from './models/User';
4
4
  import { Finger } from './models/Finger';
5
5
  import { Attendance } from "./models/Attendance";
6
- import { RecordData16, UserData28, DeviceInfo } from "./helper/utils";
6
+ import { RecordData16, UserData28, DeviceInfo, FreeSizes } from "./helper/utils";
7
7
  export default class Zklib {
8
8
  set connectionType(value: "tcp" | "udp" | null);
9
9
  private _connectionType;
@@ -60,7 +60,7 @@ export default class Zklib {
60
60
  enrollUser(uid: number, temp_id: number, user_id: string): Promise<boolean>;
61
61
  verifyUser(uid: number): Promise<boolean>;
62
62
  restartDevice(): Promise<void>;
63
- getSizes(): Promise<DeviceInfo>;
63
+ getSizes(): Promise<FreeSizes>;
64
64
  disconnect(): Promise<void>;
65
65
  freeData(): Promise<boolean>;
66
66
  disableDevice(): Promise<boolean>;
package/dist/index.es.js CHANGED
@@ -2734,7 +2734,7 @@ class Zklib {
2734
2734
  return this.functionWrapper(() => this.ztcp.restartDevice(), async () => { throw new Error('UDP restart device not supported'); }, 'RESTART_DEVICE');
2735
2735
  }
2736
2736
  async getSizes() {
2737
- return this.functionWrapper(() => this.ztcp.getSizes(), () => this.zudp.getInfo(), 'GET_SIZES');
2737
+ return this.functionWrapper(() => this.ztcp.getSizes(), () => { throw new Error('not implemented ofr UDP'); }, 'GET_SIZES');
2738
2738
  }
2739
2739
  async disconnect() {
2740
2740
  return this.functionWrapper(() => this.ztcp.disconnect(), () => this.zudp.disconnect(), 'DISCONNECT');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklib-ts",
3
- "version": "1.0.4-development",
3
+ "version": "1.0.4",
4
4
  "description": "Unofficial zkteco library allows Node.js developers to easily interface with ZK BioMetric Fingerprint Attendance Devices",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -15,8 +15,7 @@
15
15
  "test": "jest",
16
16
  "build": "rollup -c",
17
17
  "watch": "rollup -c --watch",
18
- "prepare": "npm run build",
19
- "publish": "npm run publish --tag latest"
18
+ "prepare": "npm run build"
20
19
  },
21
20
  "repositoryUrl": "https://github.com/guspaz0/zklib-ts.git",
22
21
  "repository": {