
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
youtrack-client
Advanced tools
JavaScript client library for accessing the youtrack REST and Widget API
npm install youtrack-client --save
or
yarn add youtrack-client
YouTrack API client based on fetch:
import { YouTrack } from "youtrack-client"
const baseUrl = "http://example.myjetbrains.com"
const token = "perm:your-token"
const yt = YouTrack.client(baseUrl, token)
yt.Users.getCurrentUserProfile({
// fields in FieldsSchema format
fields: ["login", "avatarUrl", "email", "fullName"]
}).then((user) => {
// typeof user
// { login: string, avatarUrl: string, email: string, fullName: string }
console.log(user)
})
yt.Tags.getTags({
// fields in string format
fields: "id,name,owner(login)",
$top: 5
}).then((tags) => {
// typeof tags
// Array<{ id: string, name: string, owner: { login: string } }>
console.log(tags)
})
Axios can be used to make requests:
import { YouTrack } from "youtrack-client"
import axios from "axios"
const yt = YouTrack.axiosClient(axios, baseUrl, token)
import { YouTrack, DashboardApi, WidgetApi } from "youtrack-client"
DashboardAddons.registerWidget(async (dashboardApi: DashboardApi, widgetApi: WidgetApi) => {
const yt = await YouTrack.widget(dashboardApi)
const user = await yt.Users.getCurrentUserProfile({
fields: ["login", "avatarUrl", "email", "fullName"]
})
// typeof user
// { login: string, avatarUrl: string, email: string, fullName: string }
const tags = await yt.Tags.getTags({
fields: "id,name,owner(login)",
$top: 5
})
// typeof tags
// Array<{ id: string, name: string, owner: { login: string } }>
})
import { YouTrack, joinUrl, encodeBody, FetchFunc } from "youtrack-client"
const baseUrl = "http://example.myjetbrains.com"
const token = "perm:your-token"
const fetchFunc: FetchFunc = async (config) => {
// add base url to config.url
const url = joinUrl(baseUrl, config.url)
// add authorization to config.headers
const headers = {
Authorization: `Bearer ${token}`,
Accept: "application/json;charset=utf-8",
"Content-Type": "application/json",
...config.headers,
}
// encode body from config.data (object or FormData)
const body = encodeBody(config.data)
// fetch response via custom client
const response = await client[method](url, { body, headers })
// return parsed response
return response.data
}
const yt = new YouTrack(baseUrl, fetchFunc)
The following resources are avaliable in Youtrack instance:
interface YouTrack {
Agiles: ResourceApi.AgilesApi
Activities: ResourceApi.ActivitiesApi
Articles: ResourceApi.ArticlesApi
Commands: ResourceApi.CommandsApi
Groups: ResourceApi.GroupsApi
IssueLinkTypes: ResourceApi.IssueLinkTypesApi
Issues: ResourceApi.IssuesApi
IssueComments: ResourceApi.IssueCommentsApi
IssueLinks: ResourceApi.IssueLinksApi
IssueTags: ResourceApi.IssueTagsApi
IssueTimeTracking: ResourceApi.IssueTimeTrackingApi
IssueVcsChanges: ResourceApi.IssueVcsChangesApi
IssueAttachments: ResourceApi.IssueAttechmentsApi
SavedQueries: ResourceApi.SavedQueriesApi
Search: ResourceApi.SearchApi
Tags: ResourceApi.TagsApi
Users: ResourceApi.UsersApi
WorkItems: ResourceApi.WorkItemsApi
Admin: {
Projects: ResourceApi.ProjectsApi
BuildBundles: ResourceApi.BuildBundlesApi
EnumBundles: ResourceApi.EnumBundlesApi
OwnedBundles: ResourceApi.OwnedBundlesApi
StateBundles: ResourceApi.StateBundlesApi
UserBundles: ResourceApi.UserBundlesApi
VersionBundles: ResourceApi.VersionBundlesApi
CustomFields: ResourceApi.CustomFieldsApi
BackupFiles: ResourceApi.BackupFilesApi
DatabaseBackupSettings: ResourceApi.DatabaseBackupSettingsApi
GlobalSettings: ResourceApi.GlobalSettingsApi
TelemetryData: ResourceApi.TelemetryDataApi
GlobalTimeTrackingSettings: ResourceApi.GlobalTimeTrackingSettingsApi
Workflows: ResourceApi.WorkflowsApi
}
}
List of all method in resources can be found in "src/resources" folder.
When contributing, keep in mind that it is an objective of youtrack-client to have no package dependencies. This may change in the future, but for now, no new dependencies.
MIT
FAQs
Client library for accessing the YouTrack REST and Widget API
The npm package youtrack-client receives a total of 39 weekly downloads. As such, youtrack-client popularity was classified as not popular.
We found that youtrack-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.