@steffesgroup/steffes-auth
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -58,2 +58,4 @@ import { AxiosInstance, AxiosRequestConfig, AxiosResponse, CancelToken } from 'axios'; | ||
get(): Promise<UserDTO>; | ||
getRecentUserSearches(): Promise<string[]>; | ||
getPopularSearches(): Promise<string[]>; | ||
getById(id: string): Promise<UserDTO>; | ||
@@ -75,2 +77,6 @@ createUser(createUserDTO: CreateUserDTO): Promise<FileResponse>; | ||
protected processGet(response: AxiosResponse): Promise<UserDTO>; | ||
getRecentUserSearches(cancelToken?: CancelToken | undefined): Promise<string[]>; | ||
protected processGetRecentUserSearches(response: AxiosResponse): Promise<string[]>; | ||
getPopularSearches(cancelToken?: CancelToken | undefined): Promise<string[]>; | ||
protected processGetPopularSearches(response: AxiosResponse): Promise<string[]>; | ||
getById(id: string, cancelToken?: CancelToken | undefined): Promise<UserDTO>; | ||
@@ -77,0 +83,0 @@ protected processGetById(response: AxiosResponse): Promise<UserDTO>; |
108
dist/api.js
@@ -656,2 +656,110 @@ "use strict"; | ||
} | ||
getRecentUserSearches(cancelToken) { | ||
let url_ = this.baseUrl + "/api/v1/User/Get/Searches"; | ||
url_ = url_.replace(/[?&]$/, ""); | ||
let options_ = { | ||
method: "GET", | ||
url: url_, | ||
headers: { | ||
"Accept": "application/json" | ||
}, | ||
cancelToken | ||
}; | ||
return this.transformOptions(options_).then(transformedOptions_ => { | ||
return this.instance.request(transformedOptions_); | ||
}).catch((_error) => { | ||
if (isAxiosError(_error) && _error.response) { | ||
return _error.response; | ||
} | ||
else { | ||
throw _error; | ||
} | ||
}).then((_response) => { | ||
return this.processGetRecentUserSearches(_response); | ||
}); | ||
} | ||
processGetRecentUserSearches(response) { | ||
const status = response.status; | ||
let _headers = {}; | ||
if (response.headers && typeof response.headers === "object") { | ||
for (let k in response.headers) { | ||
if (response.headers.hasOwnProperty(k)) { | ||
_headers[k] = response.headers[k]; | ||
} | ||
} | ||
} | ||
if (status === 200) { | ||
const _responseText = response.data; | ||
let result200 = null; | ||
let resultData200 = _responseText; | ||
if (Array.isArray(resultData200)) { | ||
result200 = []; | ||
for (let item of resultData200) | ||
result200.push(item); | ||
} | ||
else { | ||
result200 = null; | ||
} | ||
return result200; | ||
} | ||
else if (status !== 200 && status !== 204) { | ||
const _responseText = response.data; | ||
return throwException("An unexpected server error occurred.", status, _responseText, _headers); | ||
} | ||
return Promise.resolve(null); | ||
} | ||
getPopularSearches(cancelToken) { | ||
let url_ = this.baseUrl + "/api/v1/User/Get/Searches/Popular"; | ||
url_ = url_.replace(/[?&]$/, ""); | ||
let options_ = { | ||
method: "GET", | ||
url: url_, | ||
headers: { | ||
"Accept": "application/json" | ||
}, | ||
cancelToken | ||
}; | ||
return this.transformOptions(options_).then(transformedOptions_ => { | ||
return this.instance.request(transformedOptions_); | ||
}).catch((_error) => { | ||
if (isAxiosError(_error) && _error.response) { | ||
return _error.response; | ||
} | ||
else { | ||
throw _error; | ||
} | ||
}).then((_response) => { | ||
return this.processGetPopularSearches(_response); | ||
}); | ||
} | ||
processGetPopularSearches(response) { | ||
const status = response.status; | ||
let _headers = {}; | ||
if (response.headers && typeof response.headers === "object") { | ||
for (let k in response.headers) { | ||
if (response.headers.hasOwnProperty(k)) { | ||
_headers[k] = response.headers[k]; | ||
} | ||
} | ||
} | ||
if (status === 200) { | ||
const _responseText = response.data; | ||
let result200 = null; | ||
let resultData200 = _responseText; | ||
if (Array.isArray(resultData200)) { | ||
result200 = []; | ||
for (let item of resultData200) | ||
result200.push(item); | ||
} | ||
else { | ||
result200 = null; | ||
} | ||
return result200; | ||
} | ||
else if (status !== 200 && status !== 204) { | ||
const _responseText = response.data; | ||
return throwException("An unexpected server error occurred.", status, _responseText, _headers); | ||
} | ||
return Promise.resolve(null); | ||
} | ||
getById(id, cancelToken) { | ||
@@ -658,0 +766,0 @@ let url_ = this.baseUrl + "/api/v1/User/Get/{Id}"; |
{ | ||
"name": "@steffesgroup/steffes-auth", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "Steffes Auth", | ||
@@ -5,0 +5,0 @@ "main": "dist/api.js", |
77675
2041