import { HTTPRequestHeader } from "../common/Common.model"; import ConfigUserProvider from "../common/ConfigUserProvider"; import { GetRequestIdRequest, GetClientInfoRequest } from "./PublicService.model"; export declare class PublicService { private config; constructor(configUserProvider: ConfigUserProvider); /** * Each and every proccesses starts with requestId, it is an entry point to login or register. For getting the requestId, call **getRequestId()**. * @example * ```js * // To get requestId using default configured settings, run the function without parameter * cidaasPublicService.getRequestId().then(function (response) { * // the response will give you request id. * }).catch(function(ex) { * // your failure code here * }); * * // To get requestId using custom settings, run the function with custom setting(s) inside option parameter. Example below will only override client_id & redirect_uri * const option: GetRequestIdRequest = { * 'client_id': 'your client id', * 'redirect_uri': 'your redirect url', * } * cidaasPublicService.getRequestId(option).then(function (response) { * // the response will give you request id. * }).catch(function(ex) { * // your failure code here * }); * ``` */ getRequestId(option?: GetRequestIdRequest): Promise; /** * To get the tenant basic information, call **getTenantInfo()**. This will return the basic tenant details such as tenant name and allowed login with types (Email, Mobile, Username). * @example * ```js * cidaasPublicService.getTenantInfo().then(function (response) { * // the response will give you tenant details * }).catch(function(ex) { * // your failure code here * }); * ``` */ getTenantInfo(): Promise; /** * To get the client basic information, call **getClientInfo()**. This will return the basic client details such as client name and its details. * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/dc8a6cfb28abb-public-page-information for more details. * @example * ```js * cidaasPublicService.getClientInfo({ * requestId: 'your requestId', * }).then(function (resp) { * // the response will give you client info. * }).catch(function(ex) { * // your failure code here * }); * ``` */ getClientInfo(options: GetClientInfoRequest): Promise; /** * Fetches missing fields for progressive registration from the public trackinfo API. * Use when `requestId` is available (social registration flow); otherwise use `TokenService.getMissingFields(trackId)`. * Maps to `GET /public-srv/public/trackinfo/{requestId}/{trackId}`. * @param requestId - Request id from cidaas * @param trackId - Track id for the registration flow * * @example * ```js * const requestId = 'request id from cidaas'; * const trackId = 'your track id'; * cidaasPublicService.getMissingFields(requestId, trackId).then(function (resp) { * // your success code * }).catch(function(ex) { * // your failure code * }); * ``` */ getMissingFields(requestId: string, trackId: string, headers?: HTTPRequestHeader): Promise; }