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.51 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 ServiceRegistry { constructor(private client: Client) {} /** * Retrieve the attributes of given service registries. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only * Connect apps can make this request and the servicesIds belong to the tenant you are requesting */ async services<T = Models.ServiceRegistry[]>(parameters: Parameters.Services, callback: Callback<T>): Promise<void>; /** * Retrieve the attributes of given service registries. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only * Connect apps can make this request and the servicesIds belong to the tenant you are requesting */ async services<T = Models.ServiceRegistry[]>(parameters: Parameters.Services, callback?: never): Promise<T>; async services<T = Models.ServiceRegistry[]>( parameters: Parameters.Services, callback?: Callback<T>, ): Promise<void | T> { const config: RequestConfig = { url: '/rest/atlassian-connect/1/service-registry', method: 'GET', params: { serviceIds: parameters.serviceIds, }, }; return this.client.sendRequest(config, callback); } }