UNPKG

tipi-services

Version:

Node.js library to access wrapping REST API of tipi backend services

113 lines (84 loc) 3.48 kB
const Service = require('../../../Service') const Endpoints = require('./Endpoints') class LockRemoteOperationsService extends Service { constructor (baseUrl) { super() this.endpoints = Endpoints(baseUrl) } async checkConnection (data) { return this.sendRequest({ endpoint: this.endpoints.checkConnection, body: data }) } async listGateways (data) { return this.sendRequest({ endpoint: this.endpoints.listGateways, body: data }) } async listGatewayLocks (data) { return this.sendRequest({ endpoint: this.endpoints.listGatewayLocks, body: data }) } async addLock (data) { return this.sendRequest({ endpoint: this.endpoints.addLock, body: data }) } async unlock (data) { return this.sendRequest({ endpoint: this.endpoints.unlock, body: data }) } async lock (data) { return this.sendRequest({ endpoint: this.endpoints.lock, body: data }) } async addPasscode (data) { return this.sendRequest({ endpoint: this.endpoints.addPasscode, body: data }) } async deletePasscode (data) { return this.sendRequest({ endpoint: this.endpoints.deletePasscode, body: data }) } async modifyPasscode (data) { return this.sendRequest({ endpoint: this.endpoints.modifyPasscode, body: data }) } async addIdentityCard (data) { return this.sendRequest({ endpoint: this.endpoints.addIdentityCard, body: data }) } async deleteIdentityCard (data) { return this.sendRequest({ endpoint: this.endpoints.deleteIdentityCard, body: data }) } async modifyIdentityCardPeriod (data) { return this.sendRequest({ endpoint: this.endpoints.modifyIdentityCardPeriod, body: data }) } async deleteFingerprint (data) { return this.sendRequest({ endpoint: this.endpoints.deleteFingerprint, body: data }) } async modifyFingerprintPeriod (data) { return this.sendRequest({ endpoint: this.endpoints.modifyFingerprintPeriod, body: data }) } async freezeLock (data) { return this.sendRequest({ endpoint: this.endpoints.freezeLock, body: data }) } async unfreezeLock (data) { return this.sendRequest({ endpoint: this.endpoints.unfreezeLock, body: data }) } async getLockFrozenStatus (data) { return this.sendRequest({ endpoint: this.endpoints.getLockFrozenStatus, body: data }) } async getLockDatetime (data) { return this.sendRequest({ endpoint: this.endpoints.getLockDatetime, body: data }) } async adjustLockDatetime (data) { return this.sendRequest({ endpoint: this.endpoints.adjustLockDatetime, body: data }) } async getLockElectricQuantity (data) { return this.sendRequest({ endpoint: this.endpoints.getLockElectricQuantity, body: data }) } async getLockOpenState (data) { return this.sendRequest({ endpoint: this.endpoints.getLockOpenState, body: data }) } async changeAdminPassword (data) { return this.sendRequest({ endpoint: this.endpoints.changeAdminPassword, body: data }) } async setAutoLockTime (data) { return this.sendRequest({ endpoint: this.endpoints.setAutoLockTime, body: data }) } async setPassageMode (data) { return this.sendRequest({ endpoint: this.endpoints.setPassageMode, body: data }) } async clearPassageMode (data) { return this.sendRequest({ endpoint: this.endpoints.clearPassageMode, body: data }) } } module.exports = LockRemoteOperationsService