UNPKG

stash-connector

Version:

Module to handle and work with Atlassian Stash projects and repositories throug REST API. Admin your repositories and projects in Stash easy. This project is not an Atlassian official project but use the Atlassian Stash REST API

85 lines (84 loc) 3.97 kB
import { Basic, ChangePasswordInput, DeleteAvatarOutput, EndpointService, Page, PageOptions, User } from "../types"; /** * Class to manage and expose all endpoits and operations below '/rest/api/1.0/users/{userSlug}/avatar.png' */ export declare class UserAvatarEndpoint extends EndpointService { constructor(auth: Basic, userSlug: string); /** * Update the avatar for the user with the supplied slug * @param {any} avatar The desired size of the image * @returns {Promise<void>} If not throw errors, operation finish susccesfully */ update(avatar: any): Promise<void>; /** * Delete the avatar associated to a user * @returns {Promise<DeleteAvatarOutput>} Return the deleted avatar path (href) data */ delete(): Promise<DeleteAvatarOutput>; } /** * Class to manage and expose all endpoits and operations below '/rest/api/1.0/users/{userSlug}/settings' */ export declare class UserSettingsEndpoint extends EndpointService { constructor(auth: Basic, userSlug: string); /** * Retrieve a map of user setting key values for a specific user identified by the user slug * @returns {Promise<{ [key: string]: any }>} Promise with user settings data */ get(): Promise<{ [key: string]: any; }>; /** * Update the entries of a map of user setting key/values for a specific user identified by the user slug * @param {{ [key: string]: any }} userSettings The desired size of the image * @returns {Promise<void>} If not throw errors, operation finish susccesfully */ update(userSettings: { [key: string]: any; }): Promise<void>; } /** * Class to manage and expose all endpoits and operations below '/rest/api/1.0/users/*' */ export declare class UsersEndpoint extends EndpointService { /** * Contains all operations related with user avatar * All paths and operations from '/rest/api/1.0/users/{userSlug}/avatar.png'. * @param {string} userSlug User slug * @returns {UserAvatarEndpoint} Get all operations about the user avatar */ avatar: (userSlug: string) => UserAvatarEndpoint; /** * Contains all operations related with user settings * All paths and operations from '/rest/api/1.0/users/{userSlug}/settings'. * @param {string} userSlug User slug * @returns {UserSettingsEndpoint} Get all operations about the user settings */ settings: (userSlug: string) => UserSettingsEndpoint; constructor(auth: Basic); /** * Retrieve a page of users, optionally run through provided filters * @param {string} [filter] Return only users, whose username, name or email address contain the filter value * @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page) * @returns {Promise<Page<User>>} Promise with the requested page data */ list(filter?: string, pageOptions?: PageOptions): Promise<Page<User>>; /** * Retrieve the user matching the supplied userSlug * @param {string} userSlug User slug to get user data * @returns {Promise<User>} Promise with the requested user data */ get(userSlug: string): Promise<User>; /** * Update the currently authenticated user's details. Note that the name attribute is ignored, the update will always be applied to the currently authenticated user. * @param {User} userInput User input data to update * @returns {Promise<User>} Promise with the updated user data */ update(userInput: User): Promise<User>; /** * Update the currently authenticated user's password * @param {ChangePasswordInput} changePasswordInput Change password input to update it * @returns {Promise<void>} If not throw errors, operation finish successfully */ changePassword(changePasswordInput: ChangePasswordInput): Promise<void>; }