forked from MrRefactoring/jira.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauditRecords.ts
79 lines (76 loc) · 2.91 KB
/
auditRecords.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { RequestConfig } from '../requestConfig';
export class AuditRecords {
constructor(private client: Client) {}
/**
* Returns a list of audit records. The list can be filtered to include items:
*
* - Where each item in `filter` has at least one match in any of these fields:
*
* - `summary`
* - `category`
* - `eventSource`
* - `objectItem.name` If the object is a user, account ID is available to filter.
* - `objectItem.parentName`
* - `objectItem.typeName`
* - `changedValues.changedFrom`
* - `changedValues.changedTo`
* - `remoteAddress`
*
* For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and
* `"category": "group management"` is returned.
* - Created on or after a date and time.
* - Created on or before a date and time.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async getAuditRecords<T = Models.AuditRecords>(
parameters: Parameters.GetAuditRecords | undefined,
callback: Callback<T>,
): Promise<void>;
/**
* Returns a list of audit records. The list can be filtered to include items:
*
* - Where each item in `filter` has at least one match in any of these fields:
*
* - `summary`
* - `category`
* - `eventSource`
* - `objectItem.name` If the object is a user, account ID is available to filter.
* - `objectItem.parentName`
* - `objectItem.typeName`
* - `changedValues.changedFrom`
* - `changedValues.changedTo`
* - `remoteAddress`
*
* For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and
* `"category": "group management"` is returned.
* - Created on or after a date and time.
* - Created on or before a date and time.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async getAuditRecords<T = Models.AuditRecords>(parameters?: Parameters.GetAuditRecords, callback?: never): Promise<T>;
async getAuditRecords<T = Models.AuditRecords>(
parameters?: Parameters.GetAuditRecords,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: '/rest/api/3/auditing/record',
method: 'GET',
params: {
offset: parameters?.offset,
limit: parameters?.limit,
filter: parameters?.filter,
from: parameters?.from,
to: parameters?.to,
},
};
return this.client.sendRequest(config, callback);
}
}