@@ -5,30 +5,35 @@ import { Callback } from '../callback';
5
5
import { RequestConfig } from '../requestConfig' ;
6
6
7
7
export class Audit {
8
- constructor ( private client : Client ) { }
8
+ constructor ( private client : Client ) { }
9
9
10
10
/**
11
- * Returns all records in the audit log, optionally for a certain date range.
12
- * This contains information about events like space exports, group membership
13
- * changes, app installations, etc. For more information, see
14
- * [Audit log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html)
15
- * in the Confluence administrator's guide.
11
+ * Returns all records in the audit log, optionally for a certain date range. This contains information about events
12
+ * like space exports, group membership changes, app installations, etc. For more information, see [Audit
13
+ * log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the Confluence administrator's guide.
16
14
*
17
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
18
- * 'Confluence Administrator' global permission. */
19
- async getAuditRecords < T = Models . AuditRecordArray > ( parameters : Parameters . GetAuditRecords | undefined , callback : Callback < T > ) : Promise < void > ;
15
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
16
+ */
17
+ async getAuditRecords < T = Models . AuditRecordArray > (
18
+ parameters : Parameters . GetAuditRecords | undefined ,
19
+ callback : Callback < T >
20
+ ) : Promise < void > ;
20
21
/**
21
- * Returns all records in the audit log, optionally for a certain date range.
22
- * This contains information about events like space exports, group membership
23
- * changes, app installations, etc. For more information, see
24
- * [Audit log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html)
25
- * in the Confluence administrator's guide.
22
+ * Returns all records in the audit log, optionally for a certain date range. This contains information about events
23
+ * like space exports, group membership changes, app installations, etc. For more information, see [Audit
24
+ * log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the Confluence administrator's guide.
26
25
*
27
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
28
- * 'Confluence Administrator' global permission. */
29
- async getAuditRecords < T = Models . AuditRecordArray > ( parameters ?: Parameters . GetAuditRecords , callback ?: never ) : Promise < T > ;
30
- async getAuditRecords < T = Models . AuditRecordArray > ( parameters ?: Parameters . GetAuditRecords , callback ?: Callback < T > ) : Promise < void | T > {
31
- const config = {
26
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
27
+ */
28
+ async getAuditRecords < T = Models . AuditRecordArray > (
29
+ parameters ?: Parameters . GetAuditRecords ,
30
+ callback ?: never
31
+ ) : Promise < T > ;
32
+ async getAuditRecords < T = Models . AuditRecordArray > (
33
+ parameters ?: Parameters . GetAuditRecords ,
34
+ callback ?: Callback < T > ,
35
+ ) : Promise < void | T > {
36
+ const config : RequestConfig = {
32
37
url : '/api/audit' ,
33
38
method : 'GET' ,
34
39
params : {
@@ -38,25 +43,34 @@ export class Audit {
38
43
start : parameters ?. start ,
39
44
limit : parameters ?. limit ,
40
45
} ,
41
- } as RequestConfig ;
46
+ } ;
42
47
43
48
return this . client . sendRequest ( config , callback , { methodName : 'getAuditRecords' } ) ;
44
49
}
45
50
46
51
/**
47
52
* Creates a record in the audit log.
48
53
*
49
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
50
- * 'Confluence Administrator' global permission. */
51
- async createAuditRecord < T = Models . AuditRecord > ( parameters : Parameters . CreateAuditRecord | undefined , callback : Callback < T > ) : Promise < void > ;
54
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
55
+ */
56
+ async createAuditRecord < T = Models . AuditRecord > (
57
+ parameters : Parameters . CreateAuditRecord | undefined ,
58
+ callback : Callback < T >
59
+ ) : Promise < void > ;
52
60
/**
53
61
* Creates a record in the audit log.
54
62
*
55
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
56
- * 'Confluence Administrator' global permission. */
57
- async createAuditRecord < T = Models . AuditRecord > ( parameters ?: Parameters . CreateAuditRecord , callback ?: never ) : Promise < T > ;
58
- async createAuditRecord < T = Models . AuditRecord > ( parameters ?: Parameters . CreateAuditRecord , callback ?: Callback < T > ) : Promise < void | T > {
59
- const config = {
63
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
64
+ */
65
+ async createAuditRecord < T = Models . AuditRecord > (
66
+ parameters ?: Parameters . CreateAuditRecord ,
67
+ callback ?: never
68
+ ) : Promise < T > ;
69
+ async createAuditRecord < T = Models . AuditRecord > (
70
+ parameters ?: Parameters . CreateAuditRecord ,
71
+ callback ?: Callback < T > ,
72
+ ) : Promise < void | T > {
73
+ const config : RequestConfig = {
60
74
url : '/api/audit' ,
61
75
method : 'POST' ,
62
76
data : {
@@ -71,25 +85,31 @@ export class Audit {
71
85
changedValues : parameters ?. changedValues ,
72
86
associatedObjects : parameters ?. associatedObjects ,
73
87
} ,
74
- } as RequestConfig ;
88
+ } ;
75
89
76
90
return this . client . sendRequest ( config , callback , { methodName : 'createAuditRecord' } ) ;
77
91
}
78
92
79
93
/**
80
94
* Exports audit records as a CSV file or ZIP file.
81
95
*
82
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
83
- * 'Confluence Administrator' global permission. */
84
- async exportAuditRecords < T = unknown > ( parameters : Parameters . ExportAuditRecords | undefined , callback : Callback < T > ) : Promise < void > ;
96
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
97
+ */
98
+ async exportAuditRecords < T = unknown > (
99
+ parameters : Parameters . ExportAuditRecords | undefined ,
100
+ callback : Callback < T >
101
+ ) : Promise < void > ;
85
102
/**
86
103
* Exports audit records as a CSV file or ZIP file.
87
104
*
88
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
89
- * 'Confluence Administrator' global permission. * /
105
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
106
+ */
90
107
async exportAuditRecords < T = unknown > ( parameters ?: Parameters . ExportAuditRecords , callback ?: never ) : Promise < T > ;
91
- async exportAuditRecords < T = unknown > ( parameters ?: Parameters . ExportAuditRecords , callback ?: Callback < T > ) : Promise < void | T > {
92
- const config = {
108
+ async exportAuditRecords < T = unknown > (
109
+ parameters ?: Parameters . ExportAuditRecords ,
110
+ callback ?: Callback < T > ,
111
+ ) : Promise < void | T > {
112
+ const config : RequestConfig = {
93
113
url : '/api/audit/export' ,
94
114
method : 'GET' ,
95
115
params : {
@@ -98,89 +118,101 @@ export class Audit {
98
118
searchString : parameters ?. searchString ,
99
119
format : parameters ?. format ,
100
120
} ,
101
- } as RequestConfig ;
121
+ } ;
102
122
103
123
return this . client . sendRequest ( config , callback , { methodName : 'exportAuditRecords' } ) ;
104
124
}
105
125
106
126
/**
107
- * Returns the retention period for records in the audit log. The retention
108
- * period is how long an audit record is kept for, from creation date until
109
- * it is deleted.
127
+ * Returns the retention period for records in the audit log. The retention period is how long an audit record is kept
128
+ * for, from creation date until it is deleted.
110
129
*
111
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
112
- * 'Confluence Administrator' global permission. * /
130
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
131
+ */
113
132
async getRetentionPeriod < T = Models . RetentionPeriod > ( callback : Callback < T > ) : Promise < void > ;
114
133
/**
115
- * Returns the retention period for records in the audit log. The retention
116
- * period is how long an audit record is kept for, from creation date until
117
- * it is deleted.
134
+ * Returns the retention period for records in the audit log. The retention period is how long an audit record is kept
135
+ * for, from creation date until it is deleted.
118
136
*
119
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
120
- * 'Confluence Administrator' global permission. * /
137
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
138
+ */
121
139
async getRetentionPeriod < T = Models . RetentionPeriod > ( callback ?: never ) : Promise < T > ;
122
140
async getRetentionPeriod < T = Models . RetentionPeriod > ( callback ?: Callback < T > ) : Promise < void | T > {
123
- const config = {
141
+ const config : RequestConfig = {
124
142
url : '/api/audit/retention' ,
125
143
method : 'GET' ,
126
- } as RequestConfig ;
144
+ } ;
127
145
128
146
return this . client . sendRequest ( config , callback , { methodName : 'getRetentionPeriod' } ) ;
129
147
}
130
148
131
149
/**
132
- * Sets the retention period for records in the audit log. The retention period
133
- * can be set to a maximum of 20 years.
150
+ * Sets the retention period for records in the audit log. The retention period can be set to a maximum of 20 years.
134
151
*
135
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
136
- * 'Confluence Administrator' global permission. */
137
- async setRetentionPeriod < T = Models . RetentionPeriod > ( parameters : Parameters . SetRetentionPeriod | undefined , callback : Callback < T > ) : Promise < void > ;
152
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
153
+ */
154
+ async setRetentionPeriod < T = Models . RetentionPeriod > (
155
+ parameters : Parameters . SetRetentionPeriod | undefined ,
156
+ callback : Callback < T >
157
+ ) : Promise < void > ;
138
158
/**
139
- * Sets the retention period for records in the audit log. The retention period
140
- * can be set to a maximum of 20 years.
159
+ * Sets the retention period for records in the audit log. The retention period can be set to a maximum of 20 years.
141
160
*
142
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
143
- * 'Confluence Administrator' global permission. */
144
- async setRetentionPeriod < T = Models . RetentionPeriod > ( parameters ?: Parameters . SetRetentionPeriod , callback ?: never ) : Promise < T > ;
145
- async setRetentionPeriod < T = Models . RetentionPeriod > ( parameters ?: Parameters . SetRetentionPeriod , callback ?: Callback < T > ) : Promise < void | T > {
146
- const config = {
161
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
162
+ */
163
+ async setRetentionPeriod < T = Models . RetentionPeriod > (
164
+ parameters ?: Parameters . SetRetentionPeriod ,
165
+ callback ?: never
166
+ ) : Promise < T > ;
167
+ async setRetentionPeriod < T = Models . RetentionPeriod > (
168
+ parameters ?: Parameters . SetRetentionPeriod ,
169
+ callback ?: Callback < T > ,
170
+ ) : Promise < void | T > {
171
+ const config : RequestConfig = {
147
172
url : '/api/audit/retention' ,
148
173
method : 'PUT' ,
149
174
data : {
150
175
number : parameters ?. number ,
151
176
units : parameters ?. units ,
152
177
} ,
153
- } as RequestConfig ;
178
+ } ;
154
179
155
180
return this . client . sendRequest ( config , callback , { methodName : 'setRetentionPeriod' } ) ;
156
181
}
157
182
158
183
/**
159
- * Returns records from the audit log, for a time period back from the current
160
- * date. For example, you can use this method to get the last 3 months of records.
184
+ * Returns records from the audit log, for a time period back from the current date. For example, you can use this
185
+ * method to get the last 3 months of records.
161
186
*
162
- * This contains information about events like space exports, group membership
163
- * changes, app installations, etc. For more information, see
164
- * [Audit log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html)
165
- * in the Confluence administrator's guide.
187
+ * This contains information about events like space exports, group membership changes, app installations, etc. For
188
+ * more information, see [Audit log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the
189
+ * Confluence administrator's guide.
166
190
*
167
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
168
- * 'Confluence Administrator' global permission. */
169
- async getAuditRecordsForTimePeriod < T = Models . AuditRecordArray > ( parameters : Parameters . GetAuditRecordsForTimePeriod | undefined , callback : Callback < T > ) : Promise < void > ;
191
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
192
+ */
193
+ async getAuditRecordsForTimePeriod < T = Models . AuditRecordArray > (
194
+ parameters : Parameters . GetAuditRecordsForTimePeriod | undefined ,
195
+ callback : Callback < T >
196
+ ) : Promise < void > ;
170
197
/**
171
- * Returns records from the audit log, for a time period back from the current
172
- * date. For example, you can use this method to get the last 3 months of records.
198
+ * Returns records from the audit log, for a time period back from the current date. For example, you can use this
199
+ * method to get the last 3 months of records.
173
200
*
174
- * This contains information about events like space exports, group membership
175
- * changes, app installations, etc. For more information, see
176
- * [Audit log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html)
177
- * in the Confluence administrator's guide.
201
+ * This contains information about events like space exports, group membership changes, app installations, etc. For
202
+ * more information, see [Audit log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the
203
+ * Confluence administrator's guide.
178
204
*
179
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
180
- * 'Confluence Administrator' global permission. */
181
- async getAuditRecordsForTimePeriod < T = Models . AuditRecordArray > ( parameters ?: Parameters . GetAuditRecordsForTimePeriod , callback ?: never ) : Promise < T > ;
182
- async getAuditRecordsForTimePeriod < T = Models . AuditRecordArray > ( parameters ?: Parameters . GetAuditRecordsForTimePeriod , callback ?: Callback < T > ) : Promise < void | T > {
183
- const config = {
205
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
206
+ */
207
+ async getAuditRecordsForTimePeriod < T = Models . AuditRecordArray > (
208
+ parameters ?: Parameters . GetAuditRecordsForTimePeriod ,
209
+ callback ?: never
210
+ ) : Promise < T > ;
211
+ async getAuditRecordsForTimePeriod < T = Models . AuditRecordArray > (
212
+ parameters ?: Parameters . GetAuditRecordsForTimePeriod ,
213
+ callback ?: Callback < T > ,
214
+ ) : Promise < void | T > {
215
+ const config : RequestConfig = {
184
216
url : '/api/audit/since' ,
185
217
method : 'GET' ,
186
218
params : {
@@ -190,7 +222,7 @@ export class Audit {
190
222
start : parameters ?. start ,
191
223
limit : parameters ?. limit ,
192
224
} ,
193
- } as RequestConfig ;
225
+ } ;
194
226
195
227
return this . client . sendRequest ( config , callback , { methodName : 'getAuditRecordsForTimePeriod' } ) ;
196
228
}
0 commit comments