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",
|
"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",
|
"description": "SDK to communicate with and log into a backend running express-openid-connect",
|
||||||
"homepage": "https://github.com/janishutz/oidc-login-sdk#readme",
|
"homepage": "https://github.com/janishutz/oidc-login-sdk#readme",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export class UnownedError extends Error {}
|
|||||||
* @param authErrorResolution - The mean of authentication error resolution
|
* @param authErrorResolution - The mean of authentication error resolution
|
||||||
* @returns The reponse
|
* @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, {
|
return await wrapper( url, {
|
||||||
'credentials': 'include'
|
'credentials': 'include'
|
||||||
}, authErrorResolution );
|
}, authErrorResolution );
|
||||||
@@ -30,7 +30,7 @@ const get = async ( url: string, authErrorResolution?: AuthErrorResolution ): Pr
|
|||||||
* @param authErrorResolution - The mean of authentication error resolution
|
* @param authErrorResolution - The mean of authentication error resolution
|
||||||
* @returns The response
|
* @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, {
|
return await wrapper( url, {
|
||||||
'credentials': 'include',
|
'credentials': 'include',
|
||||||
'body': payload,
|
'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
|
* @param authErrorResolution - The mean of authentication error resolution
|
||||||
* @returns The response
|
* @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, {
|
return await wrapper( url, {
|
||||||
'credentials': 'include',
|
'credentials': 'include',
|
||||||
'method': 'delete'
|
'method': 'delete'
|
||||||
@@ -58,7 +58,7 @@ const deleteRequest = async ( url: string, authErrorResolution?: AuthErrorResolu
|
|||||||
* Retrieve the configured backend URL
|
* Retrieve the configured backend URL
|
||||||
* @returns The URL to the backend
|
* @returns The URL to the backend
|
||||||
*/
|
*/
|
||||||
const getBackendURL = () => {
|
export const getBackendURL = () => {
|
||||||
return config.get().backendURL;
|
return config.get().backendURL;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user