@gooddata/api-client-bear
Version:
API Client for the GoodData platform
47 lines • 2.07 kB
TypeScript
import { UserModule } from "../user.js";
import { IAccountSetting } from "@gooddata/api-model-bear";
import { CachingContext } from "./types.js";
import { ApiResponse } from "../xhr.js";
import { UserModuleDecorator } from "../decoratedModules/user.js";
export declare class UserModuleWithCaching extends UserModuleDecorator {
private readonly ctx;
constructor(decorated: UserModule, ctx: CachingContext);
/**
* This function provides an authentication entry point to the GD API. It is needed to authenticate
* by calling this function prior any other API calls. After providing valid credentials
* every subsequent API call in a current session will be authenticated.
*/
login(username: string, password: string): Promise<any>;
/**
* This function provides an authentication entry point to the GD API via SSO
* https://help.gooddata.com/display/developer/GoodData+PGP+Single+Sign-On
*
* @param encryptedClaims - PGP message
* @param ssoProvider - name of the SSO provider
* @param targetUrl - where to redirect after the SSO flow, set this to `/gdc/account/token`
*/
loginSso(encryptedClaims: string, ssoProvider: string, targetUrl: string): Promise<ApiResponse<any>>;
/**
* Logs out current user
*/
logout(): Promise<ApiResponse | void>;
/**
* Gets current user's profile
* Uses caching to prevent multiple calls.
* Cache is discarded during logout or next login.
* @returns Resolves with account setting object
*/
getCurrentProfile(): Promise<IAccountSetting>;
/**
* Updates user's profile settings
* @param profileId - User profile identifier
* @param profileSetting - the profile setting update payload
*/
updateProfileSettings(profileId: string, profileSetting: any): Promise<ApiResponse>;
}
/**
* @alpha
*/
export type UserModuleDecoratorFactory = (user: UserModule) => UserModule;
export declare function cachedUser(ctx: CachingContext): UserModuleDecoratorFactory;
//# sourceMappingURL=user.d.ts.map