@syngrisi/core-api
Advanced tools
Comparing version 2.1.24-alpha.0 to 2.1.25-alpha.0
@@ -161,3 +161,3 @@ "use strict"; | ||
catch (e) { | ||
log.error(`❌ Error getting if baseline exist data, error: '${e.stack || e}'`); | ||
log.error(`❌ Error getting if baseline exist, params: ${JSON.stringify(params)} data, error: '${e.stack || e}'`); | ||
if (e.response) | ||
@@ -168,2 +168,32 @@ (0, utils_1.printErrorResponseBody)(e); | ||
} | ||
async getBaselines(params) { | ||
try { | ||
const filter = JSON.stringify({ ...params, apikey: (0, hasha_1.default)(this.config.apiKey) }); | ||
const url = `${this.config.url}v1/client/baselines?filter=${filter}`; | ||
const result = await got_cjs_1.default.get(url) | ||
.json(); | ||
return result; | ||
} | ||
catch (e) { | ||
log.error(`❌ Error getting baselines, params: ${JSON.stringify(params)} data, error: '${e.stack || e}'`); | ||
if (e.response) | ||
(0, utils_1.printErrorResponseBody)(e); | ||
return (0, utils_1.errorObject)(e); | ||
} | ||
} | ||
async getSnapshots(params) { | ||
try { | ||
const filter = JSON.stringify({ ...params, apikey: (0, hasha_1.default)(this.config.apiKey) }); | ||
const url = `${this.config.url}v1/client/snapshots?filter=${filter}`; | ||
const result = await got_cjs_1.default.get(url) | ||
.json(); | ||
return result; | ||
} | ||
catch (e) { | ||
log.error(`❌ Error getting snapshots, params: ${JSON.stringify(params)} data, error: '${e.stack || e}'`); | ||
if (e.response) | ||
(0, utils_1.printErrorResponseBody)(e); | ||
return (0, utils_1.errorObject)(e); | ||
} | ||
} | ||
} | ||
@@ -170,0 +200,0 @@ exports.SyngrisiApi = SyngrisiApi; |
{ | ||
"name": "@syngrisi/core-api", | ||
"version": "2.1.24-alpha.0", | ||
"version": "2.1.25-alpha.0", | ||
"description": "Syngrisi Core JS client", | ||
@@ -51,3 +51,3 @@ "main": "dist/SyngrisiApi.js", | ||
}, | ||
"gitHead": "57cc6c9db7b28c4b6a7e0847747abaae254b9103" | ||
"gitHead": "8cce731290e41604b8066467971ddd7fe5ecc014" | ||
} |
@@ -5,4 +5,4 @@ # Syngrisi core js api client | ||
`SYNGRISI_LOG_LEVEL` - logging level (`0 | 4 | 2 | 1 | 3 | 5 | "trace" | "debug" | "info" | "warn" | "error" `) | ||
`SYNGRISI_LOG_LEVEL` - logging level (`"trace" | "debug" | "info" | "warn" | "error"`) | ||
TODO: complete documentation |
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
97779
366