Optional
config: IRettiwtConfigThe config object for configuring the Rettiwt instance.
Private
Optional
Readonly
apiThe api key to use for authenticating against Twitter API as user.
Protected
Optional
Readonly
authThe URL to the proxy server to use only for authentication.
Private
Readonly
errorThe service used to handle HTTP and API errors
Private
Optional
Readonly
guestThe guest key to use for authenticating against Twitter API as guest.
Private
Optional
Readonly
proxyThe URL To the proxy server to use for all others.
Private
Readonly
timeoutThe max wait time for a response.
Protected
Optional
Readonly
userThe id of the authenticated user (if any).
Private
checkChecks the authorization status based on the requested resource.
The requested resource.
An error if not authorized to access the requested resource.
Private
getPrivate
getMakes an HTTP request according to the given parameters.
The type of the returned response data.
The requested resource.
The raw data response received.
Fetching the raw details of a user with username 'user1'
import { FetcherService, EResourceType } from 'rettiwt-api';
// Creating a new FetcherService instance using the given 'API_KEY'
const fetcher = new FetcherService({ apiKey: API_KEY });
// Fetching the details of the User with username 'user1'
fetcher.request(EResourceType.USER_DETAILS_BY_USERNAME, { id: 'user1' })
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
})
Private
validateValidates the given args against the given resource.
The resource against which validation is to be done.
The args to be validated.
The validated args.
Generated using TypeDoc
The base service that handles all HTTP requests.