@studyportals/sp-hs-misc
Version:
Miscellaneous code used in HouseStark's projects
61 lines (60 loc) • 2.51 kB
TypeScript
import * as superagent from "superagent";
import { BaseSuperAgentRequestFactory } from "../requests/base-super-agent-request-factory.class";
import { ISignedSuperAgentRequestFactory } from "../requests/interfaces/i-signed-super-agent-request-factory.interface";
import { IUserSessionOperationsProvider } from "../security/interfaces/i-user-session-operations-provider.interface";
/**
* A basic implementation of the ISignedSuperAgentRequestFactory interface.
*
* @deprecated Use the SessionTokenRequestSigner instead.
*/
declare class SignedSuperAgentRequestFactory extends BaseSuperAgentRequestFactory implements ISignedSuperAgentRequestFactory {
private _userSessionOperationsProvider;
/**
* Initializes a new SignedSuperAgentRequestFactory instance.
*
* @param userSessionOperationsProvider The IUserSessionOperationsProvider object used by the new instance.
*/
constructor(userSessionOperationsProvider: IUserSessionOperationsProvider);
/**
* Gets the IUserSessionOperationsProvider object used by the current instance.
*/
protected get userSessionOperationsProvider(): IUserSessionOperationsProvider;
/**
* Creates a GET request to the specified path.
*
* Configures the request in such a way that the receiving party
* will be able to recognise the user's identity.
*/
getSigned(path: string): superagent.SuperAgentRequest;
/**
* Creates a POST request to the specified path.
*
* Configures the request in such a way that the receiving party
* will be able to recognise the user's identity.
*/
postSigned(path: string): superagent.SuperAgentRequest;
/**
* Creates a PUT request to the specified path.
*
* Configures the request in such a way that the receiving party
* will be able to recognise the user's identity.
*/
putSigned(path: string): superagent.SuperAgentRequest;
/**
* Creates a DELETE request to the specified path.
*
* Configures the request in such a way that the receiving party
* will be able to recognise the user's identity.
*/
deleteSigned(path: string): superagent.SuperAgentRequest;
/**
* Configures the request in such a way that the receiving party
* will be able to recognise the user's identity.
*
* Returns the configured request.
*
* @param request The request that is to be signed.
*/
private signRequest;
}
export { SignedSuperAgentRequestFactory };