fastcomments-sdk
Version:
FastComments API Client - A SDK for interacting with the FastComments API
63 lines • 1.88 kB
TypeScript
import { SecureSSOUserData, SimpleSSOUserData, SSOConfig, CompleteSSOConfig, SecureSSOPayload } from './types';
/**
* Main FastComments SSO class that provides both secure and simple SSO functionality
*/
export declare class FastCommentsSSO {
private config;
private secureSSOPayload?;
private simpleSSOUserData?;
private cachedToken?;
/**
* Constructor for secure SSO
*/
constructor(secureSSOPayload: SecureSSOPayload, config?: SSOConfig);
/**
* Constructor for simple SSO
*/
constructor(simpleSSOUserData: SimpleSSOUserData, config?: SSOConfig);
/**
* Static factory method for creating secure SSO
*/
static createSecure(apiKey: string, userData: SecureSSOUserData, config?: SSOConfig): FastCommentsSSO;
/**
* Static factory method for creating simple SSO
*/
static createSimple(userData: SimpleSSOUserData, config?: SSOConfig): FastCommentsSSO;
/**
* Type guard to check if payload is SecureSSOPayload
*/
private isSecureSSOPayload;
/**
* Generates the SSO token for transmission (secure SSO)
*/
prepareToSend(): CompleteSSOConfig;
/**
* Creates JSON token from payload data (simple SSO)
*/
createToken(): string;
/**
* Creates a token suitable for use with the API (either secure or simple)
*/
getToken(): string | CompleteSSOConfig;
/**
* Clears cached token
*/
resetToken(): void;
/**
* Updates the SSO configuration
*/
updateConfig(config: Partial<SSOConfig>): void;
/**
* Gets the current configuration
*/
getConfig(): SSOConfig;
/**
* Checks if this is a secure SSO instance
*/
isSecure(): boolean;
/**
* Checks if this is a simple SSO instance
*/
isSimple(): boolean;
}
//# sourceMappingURL=FastCommentsSSO.d.ts.map