@clearroad/api
Advanced tools
Comparing version 3.3.8 to 3.3.9
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="3.3.9"></a> | ||
## [3.3.9](https://github.com/clearroad/clearroad-api/compare/v3.3.8...v3.3.9) (2024-05-16) | ||
<a name="3.3.8"></a> | ||
@@ -7,0 +12,0 @@ ## [3.3.8](https://github.com/clearroad/clearroad-api/compare/v3.3.7...v3.3.8) (2024-05-15) |
@@ -932,4 +932,23 @@ "use strict"; | ||
}; | ||
ClearRoad.prototype.isConnected = function () { | ||
var _this = this; | ||
return new Promise(function (resolve, _reject) { | ||
_this.reportStorage.allDocs({ | ||
query: 'limit: 1', | ||
}).then(function (response) { | ||
if (response && response.data && response.data.rows && response.data.rows.length > 0) { | ||
resolve(true); | ||
} | ||
else { | ||
resolve(false); | ||
} | ||
}).catch(function (error) { | ||
// Error handling if the query fails | ||
console.error('Connection check failed:', error); | ||
resolve(false); | ||
}); | ||
}); | ||
}; | ||
return ClearRoad; | ||
}()); | ||
exports.ClearRoad = ClearRoad; |
@@ -408,2 +408,3 @@ import { postData } from './definitions/interfaces'; | ||
getReport(reference: string): IQueue<any>; | ||
isConnected(): Promise<{}>; | ||
} |
@@ -900,3 +900,21 @@ const Rusha = require('rusha'); | ||
} | ||
isConnected() { | ||
return new Promise((resolve, _reject) => { | ||
this.reportStorage.allDocs({ | ||
query: 'limit: 1', | ||
}).then(response => { | ||
if (response && response.data && response.data.rows && response.data.rows.length > 0) { | ||
resolve(true); | ||
} | ||
else { | ||
resolve(false); | ||
} | ||
}).catch(error => { | ||
// Error handling if the query fails | ||
console.error('Connection check failed:', error); | ||
resolve(false); | ||
}); | ||
}); | ||
} | ||
} | ||
//# sourceMappingURL=clearroad.js.map |
{ | ||
"name": "@clearroad/api", | ||
"version": "3.3.8", | ||
"version": "3.3.9", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/commonjs/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
242694
4649