@lucidtech/las-sdk-core
Advanced tools
Comparing version 1.2.10 to 1.2.11
@@ -70,4 +70,3 @@ "use strict"; | ||
Client.prototype.getProcesses = function (search) { | ||
var url = utils_1.buildURL('/processes', search); | ||
return this.makeGetRequest(url); | ||
return this.makeGetRequest('/processes', search); | ||
}; | ||
@@ -103,8 +102,3 @@ Client.prototype.postProcesses = function (stateMachineArn, inputData) { | ||
Client.prototype.makeGetRequest = function (path, query) { | ||
if (!!query) { | ||
return this.makeAuthorizedRequest(axios_1.default.get, path, query); | ||
} | ||
else { | ||
return this.makeAuthorizedRequest(axios_1.default.get, path); | ||
} | ||
return this.makeAuthorizedRequest(axios_1.default.get, utils_1.buildURL(path, query)); | ||
}; | ||
@@ -120,3 +114,3 @@ Client.prototype.makeDeleteRequest = function (path) { | ||
}; | ||
Client.prototype.makeAuthorizedRequest = function (axiosFn, path, body, query) { | ||
Client.prototype.makeAuthorizedRequest = function (axiosFn, path, body) { | ||
var _this = this; | ||
@@ -127,3 +121,5 @@ return new Promise(function (resolve, reject) { | ||
var config = { headers: headers }; | ||
var handle = body ? function () { return axiosFn(endpoint, body, config); } : query ? function () { return axiosFn(endpoint, query, config); } : function () { return axiosFn(endpoint, config); }; | ||
var handle = body | ||
? function () { return axiosFn(endpoint, body, config); } | ||
: function () { return axiosFn(endpoint, config); }; | ||
handle().then(function (response) { | ||
@@ -130,0 +126,0 @@ resolve(response.data); |
{ | ||
"name": "@lucidtech/las-sdk-core", | ||
"version": "1.2.10", | ||
"version": "1.2.11", | ||
"author": "Lucidtech AS <hello@lucidtech.ai>", | ||
@@ -23,3 +23,3 @@ "maintainers": [ | ||
}, | ||
"gitHead": "9494da0ef4ffa6768456568da094cba9aa79bff9" | ||
"gitHead": "19524e8edebfb94911969c49ff4c665bf4a55297" | ||
} |
@@ -74,4 +74,3 @@ import axios, { AxiosRequestConfig } from 'axios'; | ||
getProcesses(search?: { [key: string]: string|Array<string> }) { | ||
const url = buildURL('/processes', search); | ||
return this.makeGetRequest(url); | ||
return this.makeGetRequest('/processes', search); | ||
} | ||
@@ -115,8 +114,3 @@ | ||
makeGetRequest(path: string, query?: any) { | ||
if(!!query) { | ||
return this.makeAuthorizedRequest(axios.get, path, query); | ||
} | ||
else { | ||
return this.makeAuthorizedRequest(axios.get, path); | ||
} | ||
return this.makeAuthorizedRequest(axios.get, buildURL(path, query)); | ||
} | ||
@@ -136,3 +130,3 @@ | ||
private makeAuthorizedRequest(axiosFn: (url: string, body?: any, query?: any, config?: AxiosRequestConfig) => Promise<any>, path: string, body?: any, query?: any) { | ||
private makeAuthorizedRequest(axiosFn: (url: string, body?: any, config?: AxiosRequestConfig) => Promise<any>, path: string, body?: any) { | ||
return new Promise<any>((resolve, reject) => { | ||
@@ -142,3 +136,5 @@ const endpoint = `${this.apiEndpoint}${path}`; | ||
const config = { headers }; | ||
const handle = body ? () => axiosFn(endpoint, body, config) : query ? () => axiosFn(endpoint, query, config) : () => axiosFn(endpoint, config) | ||
const handle = body | ||
? () => axiosFn(endpoint, body, config) | ||
: () => axiosFn(endpoint, config); | ||
@@ -145,0 +141,0 @@ handle().then((response) => { |
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
37579
668