@forestadmin/forestadmin-client
Version:
This package contains the logic to use the ForestAdmin API inside an agent.
27 lines • 1.04 kB
TypeScript
/// <reference types="node" />
import { BaseClient } from 'openid-client';
import { ParsedUrlQuery } from 'querystring';
import { Tokens, UserInfo } from './types';
import { ForestAdminAuthServiceInterface, ForestAdminClientOptionsWithDefaults } from '../types';
export default class AuthService implements ForestAdminAuthServiceInterface {
private options;
protected client: BaseClient;
constructor(options: ForestAdminClientOptionsWithDefaults);
/**
* Initialize the authentication client upfront. This speeds up the first
* authentication request.
*/
init(): Promise<void>;
getUserInfo(renderingId: number, accessToken: string): Promise<UserInfo>;
generateAuthorizationUrl({ scope, state, }: {
scope: string;
state: string;
}): Promise<string>;
generateTokens({ query, state, }: {
query: ParsedUrlQuery;
state: string;
}): Promise<Tokens>;
protected createClient(): Promise<void>;
private handleError;
}
//# sourceMappingURL=index.d.ts.map