UNPKG

@esm-js/jira.js

Version:

A comprehensive JavaScript/TypeScript library designed for both Node.JS and browsers, facilitating seamless interaction with the Atlassian Jira API.

39 lines (35 loc) 1.24 kB
import type * as Models from './models'; import type * as Parameters from './parameters'; import type { Client } from '../clients'; import type { Callback } from '../callback'; import type { RequestConfig } from '../requestConfig'; export class Labels { constructor(private client: Client) {} /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * labels. */ async getAllLabels<T = Models.PageString>( parameters: Parameters.GetAllLabels | undefined, callback: Callback<T>, ): Promise<void>; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * labels. */ async getAllLabels<T = Models.PageString>(parameters?: Parameters.GetAllLabels, callback?: never): Promise<T>; async getAllLabels<T = Models.PageString>( parameters?: Parameters.GetAllLabels, callback?: Callback<T>, ): Promise<void | T> { const config: RequestConfig = { url: '/rest/api/2/label', method: 'GET', params: { startAt: parameters?.startAt, maxResults: parameters?.maxResults, }, }; return this.client.sendRequest(config, callback); } }