UNPKG

baasic-sdk-javascript

Version:

JavaScript SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).

55 lines (54 loc) 2.99 kB
/** * @module userSocialLoginClient * @description User Social Login Client provides an easy way to consume User REST API end-points. In order to obtain needed routes `userSocialLoginClient` uses `userSocialLoginRoute`. */ import { IQueryModel } from '../../common/contracts'; import { ApiClient, IHttpResponse } from '../../httpApi'; import { UserSocialLoginRoute } from './'; import { IUserSocialLogin } from './contracts'; export declare class UserSocialLoginClient { protected userSocialLoginRoute: UserSocialLoginRoute; protected apiClient: ApiClient; /** * Provides direct access to `userSocialLoginRoute`. * @method * @example userSocialLoginClient.routeDefinition.get().expand(expandObject); **/ readonly routeDefinition: UserSocialLoginRoute; constructor(userSocialLoginRoute: UserSocialLoginRoute, apiClient: ApiClient); /** * Returns a promise that is resolved once the get action has been performed. Success response returns a list user resource connected social login providers. * @param username A username or id which uniquely identifies user resource whose social login connections need to be retrieved. * @returns A promise that is resolved once the get action has been performed. * @method * @example userSocialLoginClient.get('<username>') .then(function (collection) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ get(username: string): PromiseLike<IHttpResponse<IQueryModel<IUserSocialLogin>>>; /** * Returns a promise that is resolved once the remove action has been performed. This action removes the user resource social login connection from the specified provider. * @param username A username or id which uniquely identifies user resource whose social login connection needs to be removed. * @param provider A value which uniquely identifies provider from which the user resource needs to be disconnected. * @returns A promise that is resolved once the remove action has been performed. * @method * @example userSocialLoginClient.remove('<username>', '<provider>') .then(function (collection) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ remove(username: string, provider: any): PromiseLike<IHttpResponse<void>>; } /** * @overview ***Notes:** - Refer to the [Baasic REST API](http://dev.baasic.com/api/reference/home) for detailed information about available Baasic REST API end-points. - All end-point objects are transformed by the associated route definition. */