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

st-client2

v1.0.0

Published

Yandex StarTrek API Client

Downloads

1

Readme


Внимание!

Репозиторий переехал в монорепозиторий фронтенда и заморожен.


StarTrek API Client Build Status

Клент для API стартрека. Легкий, простой, прозрачный. Постороен на основе Promise.

Описание API.

Install

npm install st-client --registry=http://npm.yandex-team.ru

Usage

var client = require('st-client').init({ token: '<token>' });

client.getIssue('WEATHER-3300')
  .then(function (issue) {
    console.log('%s – %s', issue.key, issue.summary)
  });

client.issues({ query: 'Queue: WEATHER Key: WEATHER-3300, WEATHER-3301, WEATHER-3302' })
  .then(function (issues) {
    issues.forEach(function (issue) {
      console.log('[%s] %s – %s', issue.status.key, issue.key, issue.summary);
    })
  });

API

init(options)

Создает клиента.

options

Объект с опциями

options.token

Type: String

OAuth токен. Подробнее в вики.

options.sessionId

Type: String

Значение куки Session_id. Подробнее в вики.

options.tvm

Type: Object

Значение сервисного и клиетского tvm2-тикетов. Объект вида { serviceTicket, clientTicket }. Подробнее в вики.

options.lang

Type: String Default: ru-RU, ru

Язык. Подробнее в вики.

options.endpoint

Type: String Default: http://st-api.yandex-team.ru/v2

Адрес API.

options.clientOptions

Type: object

Опции для http-клиента got. Позволяют переопределить, например, таймаут или настройки резолвинга.

Список методов

Методы повторяют структуру API, поэтому описание смотрите на вики

  1. Работа с тикетами

    • client.issues(params)
    • client.getIssue(id, params)
    • client.createIssue(data)
    • client.updateIssue(id, data)
    1. Воркфлоу

      • client.issueTransitions(issueId)
      • client.executeTransition(issueId, transitionId, data)
    2. Комментарии

      • client.issueComments(issueId)
      • client.createIssueComment(issueId, data)
      • client.getIssueComment(issueId, commentId)
      • client.updateIssueComment(issueId, commentId, data)
      • client.deleteIssueComment(issueId, commentId)
    3. Связи

      • client.issueLinks(issueId)
      • client.createIssueLink(issueId, data)
      • client.getIssueLink(issueId, linkId)
      • client.updateIssueLink(issueId, linkId, data)
      • client.deleteIssueLink(issueId, linkId)
    4. Связи с удаленными сервисами

      • client.issueRemoteLinks(issueId)
    5. Аттачи

      • client.uploadAttachment(data, query)
      • client.downloadAttachment(issueId, attachmentId, attachmentName)
      • client.issueAttachments(issueId)
    6. История изменений

      • client.issueChangelog(issueId, params)
  2. Аттрибуты тикета

    1. Типы тикетов

      • client.issueTypes()
      • client.getIssueType(id)
      • client.createIssueType(data)
      • client.updateIssueType(id, data)
    2. Приоритеты

      • client.priorities()
      • client.getPriority(id)
      • client.createPriority(data)
      • client.updatePriority(id, data)
    3. Статусы

      • client.statuses()
      • client.getStatus(id)
      • client.createStatus(data)
      • client.updateStatus(id, data)
    4. Резолюции

      • client.resolutions()
      • client.getResolution(id)
      • client.createResolution(data)
      • client.updateResolution(id, data)
    5. Пользователи

      • client.users()
      • client.getUser(login)
  3. Работа с очередями

    • client.queues(params)
    • client.getQueue(id, params)
    • client.createQueue(data)
    • client.updateQueue(id, data)
    • client.deleteQueue(id)
    1. Атрибуты очереди

      • client.queueComponents(queueId)
      • client.queueVersions(queueId)
      • client.queueProjects(queueId)
  4. Работа с досками

    • client.getBoard(id)
    1. Спринты

      • client.boardSprints(boardId)

Contribution

Пожалуйста, прочитайте contribution guide перед созданием issue или отправкой пулл-реквеста.

Tests

$ npm run lint
$ npm test