@stackfactor/client-api 1.0.59 → 1.0.61

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.
@@ -4,7 +4,7 @@ import utils from "./utils.js";
4
4
 
5
5
  const baseUrl = utils.getBaseUrl();
6
6
 
7
- export const client = axios.create({
7
+ const client = axios.create({
8
8
  baseURL: baseUrl,
9
9
  httpsAgent: new https.Agent({
10
10
  rejectUnauthorized: false,
@@ -15,7 +15,7 @@ export const client = axios.create({
15
15
  * Returns the error as a string
16
16
  * @param {Object} error
17
17
  */
18
- export const errorToString = (error) => {
18
+ const errorToString = (error) => {
19
19
  if (error != null) {
20
20
  if (error?.response?.data) {
21
21
  let asString = "";
@@ -44,7 +44,7 @@ export const errorToString = (error) => {
44
44
  * @param {Object} error
45
45
  * @returns {Number} The error code
46
46
  */
47
- export const getErrorType = (error) => {
47
+ const getErrorType = (error) => {
48
48
  if (error?.response?.status) {
49
49
  return error.response.status;
50
50
  } else return responseType.SERVICE_UNAVAILABLE;
@@ -55,7 +55,7 @@ export const getErrorType = (error) => {
55
55
  * @param {Object} error
56
56
  * @returns Object
57
57
  */
58
- export const getErrorInformation = (error) => {
58
+ const getErrorInformation = (error) => {
59
59
  return {
60
60
  status: getErrorType(error),
61
61
  message: errorToString(error),
@@ -67,7 +67,7 @@ export const getErrorInformation = (error) => {
67
67
  * @param {Boolean} returnAllExceptions - If set true all exceptions will be passed
68
68
  * @param {Object} error - The error returned by the server
69
69
  */
70
- export const shouldReturnError = (returnAllExceptions, error) => {
70
+ const shouldReturnError = (returnAllExceptions, error) => {
71
71
  if (getErrorType(error) === responseType.UNAUTHORIZED) {
72
72
  return returnAllExceptions;
73
73
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {