@harvest-profit/api
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -28,20 +28,5 @@ 'use strict'; | ||
/* | ||
eslint no-underscore-dangle: ["error", { | ||
"allow": [ | ||
"_delete", | ||
"_deleteAuthenticated", | ||
"_get", | ||
"_getAuthenticated", | ||
"_post", | ||
"_postAuthenticated", | ||
"_put", | ||
"_putAuthenticated", | ||
"_setInteceptor"] | ||
}] | ||
*/ | ||
/** | ||
* This class is used to make API requests to the main app server. | ||
* Re-Authentication is handled exclusively by this class. | ||
* api class is used to make apiCore requests to the main app server. | ||
* Re-Authentication is handled exclusively by api class. | ||
*/ | ||
@@ -53,3 +38,3 @@ | ||
this.baseUrl = process.env.API_URL || 'http://localhost:3000/api/v3'; | ||
this.baseUrl = process.env.apiCore_URL || 'http://localhost:3000/apiCore/v3'; | ||
} | ||
@@ -71,4 +56,5 @@ | ||
var api = new _apiCore2['default'](this.baseUrl, this.getAuthCookie()); | ||
return api.get(url, params); | ||
var api = new Api(); | ||
var apiCore = new _apiCore2['default'](api.baseUrl, Api.getAuthCookie()); | ||
return apiCore.get(url, params); | ||
} | ||
@@ -93,4 +79,5 @@ | ||
var api = new _apiCore2['default'](this.baseUrl, this.getAuthCookie()); | ||
return api.getAuthenticated(url, params); | ||
var api = new Api(); | ||
var apiCore = new _apiCore2['default'](api.baseUrl, Api.getAuthCookie()); | ||
return apiCore.getAuthenticated(url, params); | ||
} | ||
@@ -114,4 +101,5 @@ | ||
var api = new _apiCore2['default'](this.baseUrl, this.getAuthCookie()); | ||
return api.post(url, data); | ||
var api = new Api(); | ||
var apiCore = new _apiCore2['default'](api.baseUrl, Api.getAuthCookie()); | ||
return apiCore.post(url, data); | ||
} | ||
@@ -136,4 +124,5 @@ | ||
var api = new _apiCore2['default'](this.baseUrl, this.getAuthCookie()); | ||
return api.postAuthenticated(url, data); | ||
var api = new Api(); | ||
var apiCore = new _apiCore2['default'](api.baseUrl, Api.getAuthCookie()); | ||
return apiCore.postAuthenticated(url, data); | ||
} | ||
@@ -157,4 +146,5 @@ | ||
var api = new _apiCore2['default'](this.baseUrl, this.getAuthCookie()); | ||
return api.put(url, data); | ||
var api = new Api(); | ||
var apiCore = new _apiCore2['default'](api.baseUrl, Api.getAuthCookie()); | ||
return apiCore.put(url, data); | ||
} | ||
@@ -179,4 +169,5 @@ | ||
var api = new _apiCore2['default'](this.baseUrl, this.getAuthCookie()); | ||
return api.putAuthenticated(url, data); | ||
var api = new Api(); | ||
var apiCore = new _apiCore2['default'](api.baseUrl, Api.getAuthCookie()); | ||
return apiCore.putAuthenticated(url, data); | ||
} | ||
@@ -200,4 +191,5 @@ | ||
var api = new _apiCore2['default'](this.baseUrl, this.getAuthCookie()); | ||
return api['delete'](url, params); | ||
var api = new Api(); | ||
var apiCore = new _apiCore2['default'](api.baseUrl, Api.getAuthCookie()); | ||
return apiCore['delete'](url, params); | ||
} | ||
@@ -222,4 +214,5 @@ | ||
var api = new _apiCore2['default'](this.baseUrl, this.getAuthCookie()); | ||
return api.deleteAuthenticated(url, params); | ||
var api = new Api(); | ||
var apiCore = new _apiCore2['default'](api.baseUrl, Api.getAuthCookie()); | ||
return apiCore.deleteAuthenticated(url, params); | ||
} | ||
@@ -226,0 +219,0 @@ |
{ | ||
"name": "@harvest-profit/api", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Adds authentication to api requests and manages cookie.", | ||
@@ -5,0 +5,0 @@ "main": "dist/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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
18816
208