npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

stash-connector

v0.0.4

Published

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

Downloads

6

Readme

Atlassian Stash Connector - BETA -

Version Total Downloads Downloads/Month Issues Known Vulnerabilities Code Size License

Atlassian Stash Connector is a library to work, handle and manage all features and options from any Atlassian Stash project or repository. Developed in TypeScipts to make it more robuts and easy to use.

The library is designed to make this use really easy. All endpoints and operations are grouped and named to make it more semantic and easy to understand.

To learn and get more information about the Stash Connector library, all its features and how to use any operation, go to the Official Stash Connector Documentation.

Atlassian Stash Connector implement all REST API Endpoints to has a full controls of the Stash Projects, including peronal projects. To see all Atlassian Stash endpoints and operations, visit the Oficial Stash REST API Documentation

This is not an Official Atlassian Project but use and work with the Atlassian Official REST API developed for Stash.

Now Stil in BETA Version because is not fully tested.

Usage

// Import Stash Connector package
import { StashConnector } from 'stash-connector';

// Instance the connector with the Stash URL and User credentials
const connector = new StashConnector({
    user: '<StashUserName>',
    password: '<StashPassword>',
    host: '<StashURLHost>',
});

// Use the connector...
connector.admin...
connector.projects...
connector.groups...
connector.users...
connector.markup...

Paginated API

The Stash API Rest work with paginated results, this means that the most of list commands return a Page<T> whith a collection of values of the requested data types. For example, when retrieve projects, get a Page<Project> with the paginated values.

The Page<T> object has the page data, size, limit and next page start among other data to use the paginated API.

export class Page<T> {
    size: number = 0;               // The page size
    limit: number = 0;              // The page limit
    isLastPage: boolean = true;     // True if is the last page, false in otherwise
    values: T[] = [];               // Returned values collection.
    start: number = 0;              // First page record
    filter?: any;                   // Page filter
    nextPageStart?: number = 0;     // First record of the next page
}

IMPORTANT: If more than one page exists (i.e. the response contains "isLastPage": false), the response object will also contain a nextPageStart attribute which must be used by the client as the start parameter on the next request. Identifiers of adjacent objects in a page may not be contiguous, so the start of the next page is not necessarily the start of the last page plus the last page's size. A client should always use nextPageStart to avoid unexpected results from a paged API.

All operations that support pagination, has a PageOptions object as input to set the page options to the method execution and get the desired results. (In many cases, the PageOptions is a property of another input data object with more data).

export interface PageOptions {
    limit?: number;     // Indicates how many results to return per page 
    start?: number;     // Indicates which item should be used as the first item in the page of results
}

Endpoints and Features

Below you can see the main endpoints and operations that have the Stash REST API with a description of the feature or group. To get more information about all operations from Stash Connector, go to the Official Stash Connector Documentation.

All endpoints are grouped based on resource root, for example, all routes from /rest/api/1.0/admin/ are grouped on Administration section or the routes from /rest/api/1.0/projects are grouped on Projects Section.

Administration

Section with all endpoints and operation from /rest/api/1.0/admin/*.

This group contains all administration related tasks like Create groups or users, grant or revoke general permissions, get or update de license, manage the mail server or see the Stash clusters

Application Properties

Section with all endpoints and operation from /rest/api/1.0/application-properties/*.

Group with operations to get the Application Properties

Groups

Section with all endpoints and operation from /rest/api/1.0/groups/*.

Gorup with operations to search groups on Stash. To create or manage groups use the Admin groups operations.

Hooks

Section with all endpoints and operation from /rest/api/1.0/hooks/*.

Group to work with Hook's avatars. o work with Hooks (list, update...) use the Project Repo settings operations

Logs

Section with all endpoints and operation from /rest/api/1.0/logs/*.

This group contains all operations related with Stash Logs like get or change log leves from any logger, including root logger.

Markup

Section with all endpoints and operation from /rest/api/1.0/markup/*.

Group with operations to preview Markdown content as HTML.

Profile

Section with all endpoints and operation from /rest/api/1.0/profile/*.

In this group can found operations to get the recently viewed repositories

Projects

Section with all endpoints and operation from /rest/api/1.0/projects/*.

The bigger group of Stash Connector because contains all operations to work with the Stash Projects. You can create, update delete... any project, can work with project repositories, make pull request to any branch for any repository, list commits, changes, handle project and repository permissions and to much more. Also can work with personal repositories

Repos

Section with all endpoints and operation from /rest/api/1.0/repos/*.

Group with operations to search stash repositories. To work with repositories, use Project Repository operations.

Tasks

Section with all endpoints and operation from /rest/api/1.0/tasks/*.

The group with the operations to work with Tasks like create, update, list or delete any task.

Users

Section with all endpoints and operation from /rest/api/1.0/users/*.

Group with all operations related to the users (and the logged user). List or search users or update information about the logged user like details or avatar.