forked from MrRefactoring/jira.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathknowledgeBase.ts
46 lines (43 loc) · 1.75 KB
/
knowledgeBase.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { RequestConfig } from '../requestConfig';
export class KnowledgeBase {
constructor(private client: Client) {}
/**
* Returns articles which match the given query string across all service desks.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**:
* Permission to access the [customer
* portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html).
*/
async getArticles<T = Models.PagedArticle>(parameters: Parameters.GetArticles, callback: Callback<T>): Promise<void>;
/**
* Returns articles which match the given query string across all service desks.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**:
* Permission to access the [customer
* portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html).
*/
async getArticles<T = Models.PagedArticle>(parameters: Parameters.GetArticles, callback?: never): Promise<T>;
async getArticles<T = Models.PagedArticle>(
parameters: Parameters.GetArticles,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: '/rest/servicedeskapi/knowledgebase/article',
method: 'GET',
headers: {
'X-ExperimentalApi': 'opt-in',
},
params: {
query: parameters.query,
highlight: parameters.highlight,
start: parameters.start,
limit: parameters.limit,
},
};
return this.client.sendRequest(config, callback);
}
}