feat: better exports for requests

This commit is contained in:
janishutz committed 2026-09-22 08:07:43 +02:00
1 parent f0ed64d0de
commit f39a0dfb45
2 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -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": {
+4 -4
View File
@@ -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;
}; };