@@ -23,6 +23,7 @@ import { AuditEntryPaging } from '../model/auditEntryPaging';
23
23
import { BaseApi } from './base.api' ;
24
24
import { throwIfNotDefined } from '../../../assert' ;
25
25
import { buildCollectionParam } from '../../../alfrescoApiClient' ;
26
+ import { ContentFieldsQuery , ContentIncludeQuery , ContentPagingQuery } from './types' ;
26
27
27
28
/**
28
29
* Audit service.
@@ -64,7 +65,7 @@ You must have admin rights to delete audit information.
64
65
} ;
65
66
66
67
const queryParams = {
67
- 'where' : where
68
+ where
68
69
} ;
69
70
70
71
return this . delete ( {
@@ -167,21 +168,9 @@ You must have admin rights to access audit information.
167
168
* @param auditApplicationId The identifier of an audit application.
168
169
* @param auditEntryId The identifier of an audit entry.
169
170
* @param opts Optional parameters
170
- * @param opts.fields A list of field names.
171
-
172
- You can use this parameter to restrict the fields
173
- returned within a response if, for example, you want to save on overall bandwidth.
174
-
175
- The list applies to a returned individual
176
- entity or entries within a collection.
177
-
178
- If the API method also supports the **include**
179
- parameter, then the fields specified in the **include**
180
- parameter are returned in addition to those specified in the **fields** parameter.
181
-
182
171
* @return Promise<AuditEntryEntry>
183
172
*/
184
- getAuditEntry ( auditApplicationId : string , auditEntryId : string , opts ?: { fields ?: string [ ] } ) : Promise < AuditEntryEntry > {
173
+ getAuditEntry ( auditApplicationId : string , auditEntryId : string , opts ?: ContentFieldsQuery ) : Promise < AuditEntryEntry > {
185
174
throwIfNotDefined ( auditApplicationId , 'auditApplicationId' ) ;
186
175
throwIfNotDefined ( auditEntryId , 'auditEntryId' ) ;
187
176
@@ -240,7 +229,7 @@ parameter are returned in addition to those specified in the **fields** paramete
240
229
241
230
* @return Promise<AuditAppPaging>
242
231
*/
243
- listAuditApps ( opts ?: { skipCount ?: string ; maxItems ?: string ; fields ?: string [ ] } ) : Promise < AuditAppPaging > {
232
+ listAuditApps ( opts ?: ContentPagingQuery & ContentFieldsQuery ) : Promise < AuditAppPaging > {
244
233
const queryParams = {
245
234
skipCount : opts ?. skipCount ,
246
235
maxItems : opts ?. maxItems ,
@@ -279,9 +268,6 @@ You must have admin rights to retrieve audit information.
279
268
*
280
269
* @param auditApplicationId The identifier of an audit application.
281
270
* @param opts Optional parameters
282
- * @param opts.skipCount The number of entities that exist in the collection before those included in this list.
283
- If not supplied then the default value is 0.
284
- (default to 0)
285
271
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
286
272
sort the list by one or more fields.
287
273
@@ -290,9 +276,6 @@ above to check if any fields used in this method have a descending default searc
290
276
291
277
To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
292
278
293
- * @param opts.maxItems The maximum number of items to return in the list.
294
- If not supplied then the default value is 100.
295
- (default to 100)
296
279
* @param opts.where Optionally filter the list. Here are some examples:
297
280
298
281
* where=(createdByUser='jbloggs')
@@ -306,32 +289,12 @@ If not supplied then the default value is 100.
306
289
* where=(valuesKey='/alfresco-access/login/user')
307
290
308
291
* where=(valuesKey='/alfresco-access/transaction/action' and valuesValue='DELETE')
309
-
310
- * @param opts.include Returns additional information about the audit entry. The following optional fields can be requested:
311
- * values
312
-
313
- * @param opts.fields A list of field names.
314
-
315
- You can use this parameter to restrict the fields
316
- returned within a response if, for example, you want to save on overall bandwidth.
317
-
318
- The list applies to a returned individual
319
- entity or entries within a collection.
320
-
321
- If the API method also supports the **include**
322
- parameter, then the fields specified in the **include**
323
- parameter are returned in addition to those specified in the **fields** parameter.
324
-
325
292
* @return Promise<AuditEntryPaging>
326
293
*/
327
294
listAuditEntriesForAuditApp ( auditApplicationId : string , opts ?: {
328
- skipCount ?: number ;
329
- maxItems ?: number ;
330
295
where ?: string ;
331
296
orderBy ?: string [ ] ;
332
- include ?: string [ ] ;
333
- fields ?: string [ ] ;
334
- } ) : Promise < AuditEntryPaging > {
297
+ } & ContentPagingQuery & ContentFieldsQuery & ContentIncludeQuery ) : Promise < AuditEntryPaging > {
335
298
throwIfNotDefined ( auditApplicationId , 'auditApplicationId' ) ;
336
299
opts = opts || { } ;
337
300
@@ -340,12 +303,12 @@ parameter are returned in addition to those specified in the **fields** paramete
340
303
} ;
341
304
342
305
const queryParams = {
343
- 'skipCount' : opts [ ' skipCount' ] ,
344
- 'orderBy' : buildCollectionParam ( opts [ ' orderBy' ] , 'csv' ) ,
345
- 'maxItems' : opts [ ' maxItems' ] ,
346
- 'where' : opts [ ' where' ] ,
347
- 'include' : buildCollectionParam ( opts [ ' include' ] , 'csv' ) ,
348
- 'fields' : buildCollectionParam ( opts [ ' fields' ] , 'csv' )
306
+ 'skipCount' : opts ?. skipCount ,
307
+ 'orderBy' : buildCollectionParam ( opts ?. orderBy , 'csv' ) ,
308
+ 'maxItems' : opts ?. maxItems ,
309
+ 'where' : opts ?. where ,
310
+ 'include' : buildCollectionParam ( opts ?. include , 'csv' ) ,
311
+ 'fields' : buildCollectionParam ( opts ?. fields , 'csv' )
349
312
} ;
350
313
351
314
return this . get ( {
@@ -375,9 +338,6 @@ This relies on the pre-configured 'alfresco-access' audit application.
375
338
*
376
339
* @param nodeId The identifier of a node.
377
340
* @param opts Optional parameters
378
- * @param opts.skipCount The number of entities that exist in the collection before those included in this list.
379
- If not supplied then the default value is 0.
380
- (default to 0)
381
341
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
382
342
sort the list by one or more fields.
383
343
@@ -386,42 +346,19 @@ above to check if any fields used in this method have a descending default searc
386
346
387
347
To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
388
348
389
- * @param opts.maxItems The maximum number of items to return in the list.
390
- If not supplied then the default value is 100.
391
- (default to 100)
392
349
* @param opts.where Optionally filter the list. Here are some examples:
393
350
394
351
* where=(createdByUser='-me-')
395
352
396
353
* where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')
397
354
398
355
* where=(createdByUser='jbloggs' and createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')
399
-
400
- * @param opts.include Returns additional information about the audit entry. The following optional fields can be requested:
401
- * values
402
-
403
- * @param opts.fields A list of field names.
404
-
405
- You can use this parameter to restrict the fields
406
- returned within a response if, for example, you want to save on overall bandwidth.
407
-
408
- The list applies to a returned individual
409
- entity or entries within a collection.
410
-
411
- If the API method also supports the **include**
412
- parameter, then the fields specified in the **include**
413
- parameter are returned in addition to those specified in the **fields** parameter.
414
-
415
356
* @return Promise<AuditEntryPaging>
416
357
*/
417
358
listAuditEntriesForNode ( nodeId : string , opts ?: {
418
- skipCount ?: number ;
419
- maxItems ?: number ;
420
359
orderBy ?: string [ ] ;
421
360
where ?: string ;
422
- include ?: string [ ] ;
423
- fields ?: string [ ] ;
424
- } ) : Promise < AuditEntryPaging > {
361
+ } & ContentPagingQuery & ContentIncludeQuery & ContentFieldsQuery ) : Promise < AuditEntryPaging > {
425
362
throwIfNotDefined ( nodeId , 'nodeId' ) ;
426
363
opts = opts || { } ;
427
364
@@ -430,12 +367,12 @@ parameter are returned in addition to those specified in the **fields** paramete
430
367
} ;
431
368
432
369
const queryParams = {
433
- 'skipCount' : opts [ ' skipCount' ] ,
434
- 'orderBy' : buildCollectionParam ( opts [ ' orderBy' ] , 'csv' ) ,
435
- 'maxItems' : opts [ ' maxItems' ] ,
436
- 'where' : opts [ ' where' ] ,
437
- 'include' : buildCollectionParam ( opts [ ' include' ] , 'csv' ) ,
438
- 'fields' : buildCollectionParam ( opts [ ' fields' ] , 'csv' )
370
+ 'skipCount' : opts ?. skipCount ,
371
+ 'orderBy' : buildCollectionParam ( opts ?. orderBy , 'csv' ) ,
372
+ 'maxItems' : opts ?. maxItems ,
373
+ 'where' : opts ?. where ,
374
+ 'include' : buildCollectionParam ( opts ?. include , 'csv' ) ,
375
+ 'fields' : buildCollectionParam ( opts ?. fields , 'csv' )
439
376
} ;
440
377
441
378
return this . get ( {
@@ -464,21 +401,9 @@ You must have admin rights to update audit application.
464
401
* @param auditApplicationId The identifier of an audit application.
465
402
* @param auditAppBodyUpdate The audit application to update.
466
403
* @param opts Optional parameters
467
- * @param opts.fields A list of field names.
468
-
469
- You can use this parameter to restrict the fields
470
- returned within a response if, for example, you want to save on overall bandwidth.
471
-
472
- The list applies to a returned individual
473
- entity or entries within a collection.
474
-
475
- If the API method also supports the **include**
476
- parameter, then the fields specified in the **include**
477
- parameter are returned in addition to those specified in the **fields** parameter.
478
-
479
404
* @return Promise<AuditApp>
480
405
*/
481
- updateAuditApp ( auditApplicationId : string , auditAppBodyUpdate : AuditBodyUpdate , opts ?: { fields ?: string [ ] } ) : Promise < AuditApp > {
406
+ updateAuditApp ( auditApplicationId : string , auditAppBodyUpdate : AuditBodyUpdate , opts ?: ContentFieldsQuery ) : Promise < AuditApp > {
482
407
throwIfNotDefined ( auditApplicationId , 'auditApplicationId' ) ;
483
408
throwIfNotDefined ( auditAppBodyUpdate , 'auditAppBodyUpdate' ) ;
484
409
0 commit comments