Constructor
new Inventory()
Inventory default constructor.
Methods
(static) deserialize(xmlData) → {Inventory|null}
Create a new Inventory instance from a serialized one.
Parameters:
Name | Type | Description |
---|---|---|
xmlData |
Serialized Inventory (xml format). |
Returns:
Deserialized Inventory. Or null if the serialized data is invalid.
- Type
- Inventory | null
getAccessType() → {AccessType}
Returns:
Type of access which allowed this scan (manual, badge, fingerprint...).
- Type
- AccessType
getCreationDate() → {Date}
Returns:
Date and time when the scan for this inventory was complete.
- Type
- Date
getDoorNumber() → {number}
Get the number of the door which was closed before the inventory started
Returns:
Number of the door (0 for Master door, 1 for Slave door, -1 by default).
- Type
- number
getId() → {number}
- Deprecated:
- Internal usage [DEPRECATED] Provide the unique identifier of the inventory.
Returns:
Unique identifier of the Inventory.
- Type
- number
getNumberAdded() → {number}
Returns:
Number of tags added in the device.
- Type
- number
getNumberPresent() → {number}
Returns:
Number of tags already present in the device.
- Type
- number
getNumberRemoved() → {number}
Returns:
Number of tags removed from the device.
- Type
- number
getNumberTotal() → {number}
Returns:
Number of tags physically in the device ("added" AND "present").
- Type
- number
getTagsAdded() → {Array.<string>}
Returns:
Tags added in the device, compared with previous inventory.
- Type
- Array.<string>
getTagsAll() → {Array.<string>}
Returns:
All tags "added" an "present" in the inventory.
- Type
- Array.<string>
getTagsPresent() → {Array.<string>}
Returns:
Tags still present in the device, compared with previous inventory.
- Type
- Array.<string>
getTagsRemoved() → {Array.<string>}
Returns:
Tags removed from the device, compared with previous inventory.
- Type
- Array.<string>
getUsername() → {string}
Returns:
Username of the user responsible for the scan.
- Type
- string
serialize() → {string}
Format the internal data as an XML string and encode it with base64.
Returns:
The base64 encoded XML Inventory.
- Type
- string