synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
15 lines • 918 B
TypeScript
import { TwoFactorAuthErrorResponse } from '@sage-bionetworks/synapse-client/generated/models/TwoFactorAuthErrorResponse';
export declare function isOutsideSynapseOrg(): boolean;
/**
* Invokes a function that makes a request to Synapse and returns null if the server responds with a 404.
* @param fn a function that may throw a SynapseClientError when encountering an HTTP Error Code
* @returns The result of the function call, or null if the result is a 404 "Not Found" error.
*/
export declare function allowNotFoundError<T>(fn: () => Promise<T>): Promise<T | null>;
/**
* If the asynchronous request returns a TwoFactorAuthErrorResponse, return that error instead of throwing it. Other
* types of errors will still be thrown.
* @param fn
*/
export declare function returnIfTwoFactorAuthError<T>(fn: () => Promise<T>): Promise<T | TwoFactorAuthErrorResponse>;
//# sourceMappingURL=SynapseClientUtils.d.ts.map