mirror of
https://github.com/janishutz/oidc-login-sdk.git
synced 2026-10-08 17:36:20 +02:00
feat: better exports for requests
This commit is contained in:
1 parent
f0ed64d0de
commit
f39a0dfb45
2 files changed
+5
-5
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@janishutz/oidc-login-sdk-browser",
|
||||
"version": "1.3.1",
|
||||
"version": "1.3.2",
|
||||
"description": "SDK to communicate with and log into a backend running express-openid-connect",
|
||||
"homepage": "https://github.com/janishutz/oidc-login-sdk#readme",
|
||||
"bugs": {
|
||||
|
||||
@@ -16,7 +16,7 @@ export class UnownedError extends Error {}
|
||||
* @param authErrorResolution - The mean of authentication error resolution
|
||||
* @returns The reponse
|
||||
*/
|
||||
const get = async ( url: string, authErrorResolution?: AuthErrorResolution ): Promise<Response> => {
|
||||
export const get = async ( url: string, authErrorResolution?: AuthErrorResolution ): Promise<Response> => {
|
||||
return await wrapper( url, {
|
||||
'credentials': 'include'
|
||||
}, authErrorResolution );
|
||||
@@ -30,7 +30,7 @@ const get = async ( url: string, authErrorResolution?: AuthErrorResolution ): Pr
|
||||
* @param authErrorResolution - The mean of authentication error resolution
|
||||
* @returns The response
|
||||
*/
|
||||
const post = async ( url: string, payload: string, mime: string = 'application/json', authErrorResolution?: AuthErrorResolution ): Promise<Response> => {
|
||||
export const post = async ( url: string, payload: string, mime: string = 'application/json', authErrorResolution?: AuthErrorResolution ): Promise<Response> => {
|
||||
return await wrapper( url, {
|
||||
'credentials': 'include',
|
||||
'body': payload,
|
||||
@@ -47,7 +47,7 @@ const post = async ( url: string, payload: string, mime: string = 'application/j
|
||||
* @param authErrorResolution - The mean of authentication error resolution
|
||||
* @returns The response
|
||||
*/
|
||||
const deleteRequest = async ( url: string, authErrorResolution?: AuthErrorResolution ): Promise<Response> => {
|
||||
export const deleteRequest = async ( url: string, authErrorResolution?: AuthErrorResolution ): Promise<Response> => {
|
||||
return await wrapper( url, {
|
||||
'credentials': 'include',
|
||||
'method': 'delete'
|
||||
@@ -58,7 +58,7 @@ const deleteRequest = async ( url: string, authErrorResolution?: AuthErrorResolu
|
||||
* Retrieve the configured backend URL
|
||||
* @returns The URL to the backend
|
||||
*/
|
||||
const getBackendURL = () => {
|
||||
export const getBackendURL = () => {
|
||||
return config.get().backendURL;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user