-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathaudits.d.ts
294 lines (292 loc) · 11.3 KB
/
audits.d.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
import { A as ApiCallOptions } from './invoke-fetch-types-BXn-uSF5.js';
import './auth-types-PkN9CAF_.js';
type ArchiveItem = {
/** The type that content is encoded in, always "application/json". */
contentType?: string;
/** Additional information about the event's details. The structure depends on the type and version of the event. */
data?: unknown;
/** The event's unique identifier. */
eventId?: string;
/** The RFC3339 datetime when the event happened. */
eventTime?: string;
/** The type of event that describes committed action. */
eventType?: string;
/** The version of the event type. */
eventTypeVersion?: string;
/** The availability of the properties depends on the event and the context it was triggered in. */
extensions?: EventExtensions;
/** The source of the event message, usually the producing service. */
source?: string;
/** The ID of the tenant that owns the item. This is populated using the JWT. */
tenantId?: string;
/** The ID of the user who performed the action that triggered the event. */
userId?: string;
};
type ErrorResponse = {
errors?: {
code?: string;
detail?: string;
title?: string;
}[];
traceId?: string;
};
/**
* The availability of the properties depends on the event and the context it was triggered in.
*/
type EventExtensions = {
/** Specifies the entity performing the action on behalf of another party listed as triggering the action. */
actor?: {
/** Opaque value identifying impersonating entity. */
sub?: string;
/** The type of the impersonating entity. */
subType?: string;
};
/** Id of the owner of the resource affected by the eventContext. */
ownerId?: string;
/** Id of the space related to the action performed on the eventContext. */
spaceId?: string;
/** If the event originated from a sub resource the topLevelResourceId contains the id of the top level resource associated with the sub resource. */
topLevelResourceId?: string;
/** Might be present if the action is of type "updated" and should contain information about the changes made to the resource. */
updates?: unknown;
};
type GetArchiveResult = {
/** List of archived events. The structure of the events depend on their type and version. */
data?: ArchiveItem[];
};
type GetByIDResult = {
/** The type that content is encoded in, always "application/json". */
contentType?: string;
/** Additional information about the event's details. The structure depends on the type and version of the event. */
data?: unknown;
/** The event's unique identifier. */
eventId?: string;
/** The RFC3339 datetime when the event happened. */
eventTime?: string;
/** The type of event that describes committed action. */
eventType?: string;
/** The version of the event type. */
eventTypeVersion?: string;
/** The availability of the properties depends on the event and the context it was triggered in. */
extensions?: EventExtensions;
/** The resource item's unique identifier. */
id?: string;
links?: GetLinks;
/** The source of the event message, usually the producing service. */
source?: string;
/** The ID of the tenant that owns the item. This is populated using the JWT. */
tenantId?: string;
/** The ID of the user who performed the action that triggered the event. */
userId?: string;
};
type GetLinks = {
self?: Href;
};
type GetObjectsResult = {
/** List of requested resources. */
data?: string[];
links?: ListLinks;
};
type GetResult = {
/** List of audit items. */
data?: GetByIDResult[];
links?: ListLinks;
};
type GetSettingsResult = {
/** Server configuration options. */
data?: {
/** Is Long Term Storage archiving enabled?. */
ArchiveEnabled?: boolean;
/** The events TTL in seconds. */
EventTTL?: number;
};
};
type ListLinks = {
next?: Href;
prev?: Href;
self?: Href;
};
type Href = {
href?: string;
};
/**
* Retrieves list of events for subscribed services for your tenant. Stores events for 90 days, after which they can be accessed via `/v1/audits/archive`.
*
* @param query an object with query parameters
* @throws GetAuditsHttpError
*/
declare const getAudits: (query: {
/** The start/end time interval formatted in ISO 8601 to search by eventTime. For example, "?eventTime=2021-07-14T18:41:15.00Z/2021-07-14T18:41:15.99Z". */
eventTime?: string;
/** The case-sensitive string used to search by eventType. Retrieve a list of possible eventTypes with `/v1/audits/types`. */
eventType?: string;
/** The comma separated list of audit unique identifiers. */
id?: string;
/** The maximum number of resources to return for a request. */
limit?: number;
/** The cursor to the next page of resources. Provide either the next or prev cursor, but not both. */
next?: string;
/** The cursor to the previous page of resources. Provide either the next or prev cursor, but not both. */
prev?: string;
/** The property of a resource to sort on (default sort is -eventTime). The supported properties are source, eventType, and eventTime. A property must be prefixed by + or - to indicate ascending or descending sort order respectively. */
sort?: string;
/** The case-sensitive string used to search by source. Retrieve a list of possible sources with `/v1/audits/sources`. */
source?: string;
/** The case-sensitive string used to search by userId. */
userId?: string;
}, options?: ApiCallOptions) => Promise<GetAuditsHttpResponse>;
type GetAuditsHttpResponse = {
data: GetResult;
headers: Headers;
status: 200;
prev?: (options?: ApiCallOptions) => Promise<GetAuditsHttpResponse>;
next?: (options?: ApiCallOptions) => Promise<GetAuditsHttpResponse>;
};
type GetAuditsHttpError = {
data: ErrorResponse;
headers: Headers;
status: 400 | 401 | 500;
};
/**
* Retrieves audit events from long term storage. Finds and returns audit events from the archive, formatted as a JSON array, for the given date and tenant (in JWT). Archived events are not removed.
*
* @param query an object with query parameters
* @throws GetArchivedAuditsHttpError
*/
declare const getArchivedAudits: (query: {
/** Date to be used as filter and criteria during extraction. */
date?: string;
}, options?: ApiCallOptions) => Promise<GetArchivedAuditsHttpResponse>;
type GetArchivedAuditsHttpResponse = {
data: GetArchiveResult;
headers: Headers;
status: 200;
};
type GetArchivedAuditsHttpError = {
data: ErrorResponse;
headers: Headers;
status: 400 | 401 | 404 | 500;
};
/**
* Returns the server configuration options. It includes options that represent the server configuration state and parameters that were used to run the server with certain functionality.
*
* @throws GetAuditsSettingsHttpError
*/
declare const getAuditsSettings: (options?: ApiCallOptions) => Promise<GetAuditsSettingsHttpResponse>;
type GetAuditsSettingsHttpResponse = {
data: GetSettingsResult;
headers: Headers;
status: 200;
};
type GetAuditsSettingsHttpError = {
data: ErrorResponse;
headers: Headers;
status: 401 | 500;
};
/**
* Finds and returns the list of possible event sources for this tenant.
*
* @throws GetAuditSourcesHttpError
*/
declare const getAuditSources: (options?: ApiCallOptions) => Promise<GetAuditSourcesHttpResponse>;
type GetAuditSourcesHttpResponse = {
data: GetObjectsResult;
headers: Headers;
status: 200;
prev?: (options?: ApiCallOptions) => Promise<GetAuditSourcesHttpResponse>;
next?: (options?: ApiCallOptions) => Promise<GetAuditSourcesHttpResponse>;
};
type GetAuditSourcesHttpError = {
data: ErrorResponse;
headers: Headers;
status: 401 | 500;
};
/**
* Finds and returns the list of possible event types for this tenant.
*
* @throws GetAuditTypesHttpError
*/
declare const getAuditTypes: (options?: ApiCallOptions) => Promise<GetAuditTypesHttpResponse>;
type GetAuditTypesHttpResponse = {
data: GetObjectsResult;
headers: Headers;
status: 200;
prev?: (options?: ApiCallOptions) => Promise<GetAuditTypesHttpResponse>;
next?: (options?: ApiCallOptions) => Promise<GetAuditTypesHttpResponse>;
};
type GetAuditTypesHttpError = {
data: ErrorResponse;
headers: Headers;
status: 401 | 500;
};
/**
* Finds and returns a specific audit events for the given event ID.
*
* @param id The audit item's unique identifier.
* @throws GetAuditHttpError
*/
declare const getAudit: (id: string, options?: ApiCallOptions) => Promise<GetAuditHttpResponse>;
type GetAuditHttpResponse = {
data: GetByIDResult;
headers: Headers;
status: 200;
};
type GetAuditHttpError = {
data: ErrorResponse;
headers: Headers;
status: 400 | 401 | 404 | 500;
};
/**
* Clears the cache for audits api requests.
*/
declare function clearCache(): void;
interface AuditsAPI {
/**
* Retrieves list of events for subscribed services for your tenant. Stores events for 90 days, after which they can be accessed via `/v1/audits/archive`.
*
* @param query an object with query parameters
* @throws GetAuditsHttpError
*/
getAudits: typeof getAudits;
/**
* Retrieves audit events from long term storage. Finds and returns audit events from the archive, formatted as a JSON array, for the given date and tenant (in JWT). Archived events are not removed.
*
* @param query an object with query parameters
* @throws GetArchivedAuditsHttpError
*/
getArchivedAudits: typeof getArchivedAudits;
/**
* Returns the server configuration options. It includes options that represent the server configuration state and parameters that were used to run the server with certain functionality.
*
* @throws GetAuditsSettingsHttpError
*/
getAuditsSettings: typeof getAuditsSettings;
/**
* Finds and returns the list of possible event sources for this tenant.
*
* @throws GetAuditSourcesHttpError
*/
getAuditSources: typeof getAuditSources;
/**
* Finds and returns the list of possible event types for this tenant.
*
* @throws GetAuditTypesHttpError
*/
getAuditTypes: typeof getAuditTypes;
/**
* Finds and returns a specific audit events for the given event ID.
*
* @param id The audit item's unique identifier.
* @throws GetAuditHttpError
*/
getAudit: typeof getAudit;
/**
* Clears the cache for audits api requests.
*/
clearCache: typeof clearCache;
}
/**
* Functions for the audits api
*/
declare const auditsExport: AuditsAPI;
export { type ArchiveItem, type AuditsAPI, type ErrorResponse, type EventExtensions, type GetArchiveResult, type GetArchivedAuditsHttpError, type GetArchivedAuditsHttpResponse, type GetAuditHttpError, type GetAuditHttpResponse, type GetAuditSourcesHttpError, type GetAuditSourcesHttpResponse, type GetAuditTypesHttpError, type GetAuditTypesHttpResponse, type GetAuditsHttpError, type GetAuditsHttpResponse, type GetAuditsSettingsHttpError, type GetAuditsSettingsHttpResponse, type GetByIDResult, type GetLinks, type GetObjectsResult, type GetResult, type GetSettingsResult, type Href, type ListLinks, clearCache, auditsExport as default, getArchivedAudits, getAudit, getAuditSources, getAuditTypes, getAudits, getAuditsSettings };