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

78 lines 3.49 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.StashConnector = void 0; var admin_1 = require("./endpoints/admin"); var applicaton_1 = require("./endpoints/applicaton"); var groups_1 = require("./endpoints/groups"); var hooks_1 = require("./endpoints/hooks"); var logs_1 = require("./endpoints/logs"); var markup_1 = require("./endpoints/markup"); var projects_1 = require("./endpoints/projects"); var profile_1 = require("./endpoints/profile"); var types_1 = require("./types"); var repos_1 = require("./endpoints/repos"); var task_1 = require("./endpoints/task"); var users_1 = require("./endpoints/users"); __exportStar(require("./types"), exports); /** * Atlassian Stash Connector. * Class to manage the Entire API REST provided by Atlassian to work with the Stash Enterprise Repositories. * Its designed with very semantic use and easy to understand. * * Instance connector * const connector = new StashConnector({ * host: 'http://<stash-url-host>...', * user: '<stash-username>', * password: <stash-password> * }); * * For example, to list all projects from Stash (Endpoint (GET): /rest/api/1.0/projects): * connector.projects.list(); // Accept pagination options * * To create a new project: (Endpoint (POST): /rest/api/1.0/projects): * connector.projects.create(); * * To list all repository from a project: (Endpoint (GET): /rest/api/1.0/projects/{projectKey}/repos) * connector.projects.repos('<project-key>').list(); * * To get a specific repository data * connector.projects.repos('<project-key>').get('<repo-slug>'); * * And to much more methods and operations with the same use. * * See all available endpoints and operatios from Atlassian Stash API Rest: * https://docs.atlassian.com/DAC/rest/stash/3.11.3/stash-rest.html */ var StashConnector = /** @class */ (function () { /** * Instance new Stash Connector with user credentials and stash host. * @param {BasicAuth} auth Basic Authorization info and stash host */ function StashConnector(auth) { this.auth = new types_1.Basic(auth); this.admin = new admin_1.AdminEndpoint(this.auth); this.applicationProperties = new applicaton_1.ApplicationEndpoint(this.auth); this.groups = new groups_1.GroupsEndpoint(this.auth); this.hooks = new hooks_1.HooksEndpoint(this.auth); this.logs = new logs_1.LogsEndpoint(this.auth); this.markup = new markup_1.MarkupEndpoint(this.auth); this.profile = new profile_1.ProfileEndpoint(this.auth); this.projects = new projects_1.ProjectsEndpoint(this.auth); this.repos = new repos_1.ReposEndpoint(this.auth); this.tasks = new task_1.TasksEndpoint(this.auth); this.users = new users_1.UsersEndpoint(this.auth); } return StashConnector; }()); exports.StashConnector = StashConnector; //# sourceMappingURL=index.js.map