Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit 03c641d

Browse files
authored
[ACS-5839] bump to 7.0.0, api enhancements (#1648)
* bump to 7.0.0 due to breaking changes * fix security marks, improve records api * improve records api * improve records api * improve content api typings * improve content api typings
1 parent 46246f9 commit 03c641d

33 files changed

+631
-2140
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alfresco/js-api",
3-
"version": "6.2.0",
3+
"version": "7.0.0",
44
"description": "JavaScript client library for the Alfresco REST API",
55
"author": "Hyland Software, Inc. and its affiliates",
66
"main": "index.js",

src/api/content-rest-api/api/actions.api.ts

Lines changed: 11 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { ActionExecResultEntry } from '../model/actionExecResultEntry';
2222
import { BaseApi } from './base.api';
2323
import { throwIfNotDefined } from '../../../assert';
2424
import { buildCollectionParam } from '../../../alfrescoApiClient';
25+
import { ContentFieldsQuery, ContentPagingQuery } from './types';
2526

2627
/**
2728
* Actions service.
@@ -129,42 +130,23 @@ pending execution. The ID may be used, for example to correlate an execution wit
129130
*
130131
*
131132
* @param opts Optional parameters
132-
* @param opts.skipCount The number of entities that exist in the collection before those included in this list.
133-
If not supplied then the default value is 0.
134-
(default to 0)
135-
* @param opts.maxItems The maximum number of items to return in the list.
136-
If not supplied then the default value is 100.
137-
(default to 100)
138133
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
139134
sort the list by one or more fields.
140135
141136
Each field has a default sort order, which is normally ascending order. Read the API method implementation notes
142137
above to check if any fields used in this method have a descending default search order.
143138
144139
To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
145-
146-
* @param opts.fields A list of field names.
147-
148-
You can use this parameter to restrict the fields
149-
returned within a response if, for example, you want to save on overall bandwidth.
150-
151-
The list applies to a returned individual
152-
entity or entries within a collection.
153-
154-
If the API method also supports the **include**
155-
parameter, then the fields specified in the **include**
156-
parameter are returned in addition to those specified in the **fields** parameter.
157-
158140
* @return Promise<ActionDefinitionList>
159141
*/
160-
listActions(opts?: { skipCount?: number; maxItems?: number; orderBy?: string[]; fields?: string[] }): Promise<ActionDefinitionList> {
142+
listActions(opts?: { orderBy?: string[] } & ContentPagingQuery & ContentFieldsQuery): Promise<ActionDefinitionList> {
161143
opts = opts || {};
162144

163145
const queryParams = {
164-
'skipCount': opts['skipCount'],
165-
'maxItems': opts['maxItems'],
166-
'orderBy': buildCollectionParam(opts['orderBy'], 'csv'),
167-
'fields': buildCollectionParam(opts['fields'], 'csv')
146+
skipCount: opts?.skipCount,
147+
maxItems: opts?.maxItems,
148+
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
149+
fields: buildCollectionParam(opts?.fields, 'csv')
168150
};
169151

170152
return this.get({
@@ -191,35 +173,16 @@ You can use any of the following fields to order the results:
191173
*
192174
* @param nodeId The identifier of a node.
193175
* @param opts Optional parameters
194-
* @param opts.skipCount The number of entities that exist in the collection before those included in this list.
195-
If not supplied then the default value is 0.
196-
(default to 0)
197-
* @param opts.maxItems The maximum number of items to return in the list.
198-
If not supplied then the default value is 100.
199-
(default to 100)
200176
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
201177
sort the list by one or more fields.
202178
203179
Each field has a default sort order, which is normally ascending order. Read the API method implementation notes
204180
above to check if any fields used in this method have a descending default search order.
205181
206182
To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
207-
208-
* @param opts.fields A list of field names.
209-
210-
You can use this parameter to restrict the fields
211-
returned within a response if, for example, you want to save on overall bandwidth.
212-
213-
The list applies to a returned individual
214-
entity or entries within a collection.
215-
216-
If the API method also supports the **include**
217-
parameter, then the fields specified in the **include**
218-
parameter are returned in addition to those specified in the **fields** parameter.
219-
220183
* @return Promise<ActionDefinitionList>
221184
*/
222-
nodeActions(nodeId: string, opts?: { skipCount?: number; maxItems?: number; orderBy?: string[]; fields?: string[] }): Promise<ActionDefinitionList> {
185+
nodeActions(nodeId: string, opts?: { orderBy?: string[]; } & ContentPagingQuery & ContentFieldsQuery): Promise<ActionDefinitionList> {
223186
throwIfNotDefined(nodeId, 'nodeId');
224187
opts = opts || {};
225188

@@ -228,10 +191,10 @@ parameter are returned in addition to those specified in the **fields** paramete
228191
};
229192

230193
const queryParams = {
231-
'skipCount': opts['skipCount'],
232-
'maxItems': opts['maxItems'],
233-
'orderBy': buildCollectionParam(opts['orderBy'], 'csv'),
234-
'fields': buildCollectionParam(opts['fields'], 'csv')
194+
skipCount: opts?.skipCount,
195+
maxItems: opts?.maxItems,
196+
orderBy: buildCollectionParam(opts?.orderBy, 'csv'),
197+
fields: buildCollectionParam(opts?.fields, 'csv')
235198
};
236199

237200
return this.get({

src/api/content-rest-api/api/activities.api.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { ActivityPaging } from '../model/activityPaging';
1919
import { BaseApi } from './base.api';
2020
import { throwIfNotDefined } from '../../../assert';
2121
import { buildCollectionParam } from '../../../alfrescoApiClient';
22+
import { ContentFieldsQuery, ContentPagingQuery } from './types';
2223

2324
/**
2425
* Activities service.
@@ -35,36 +36,14 @@ You can use the -me- string in place of <personId> to specify the currently auth
3536
*
3637
* @param personId The identifier of a person.
3738
* @param opts Optional parameters
38-
* @param opts.skipCount The number of entities that exist in the collection before those included in this list.
39-
If not supplied then the default value is 0.
40-
(default to 0)
41-
* @param opts.maxItems The maximum number of items to return in the list.
42-
If not supplied then the default value is 100.
43-
(default to 100)
4439
* @param opts.who A filter to include the user's activities only me, other user's activities only others'
45-
4640
* @param opts.siteId Include only activity feed entries relating to this site.
47-
* @param opts.fields A list of field names.
48-
49-
You can use this parameter to restrict the fields
50-
returned within a response if, for example, you want to save on overall bandwidth.
51-
52-
The list applies to a returned individual
53-
entity or entries within a collection.
54-
55-
If the API method also supports the **include**
56-
parameter, then the fields specified in the **include**
57-
parameter are returned in addition to those specified in the **fields** parameter.
58-
5941
* @return Promise<ActivityPaging>
6042
*/
6143
listActivitiesForPerson(personId: string, opts?: {
62-
skipCount?: number;
63-
maxItems?: number;
6444
who?: string;
6545
siteId?: string;
66-
fields?: string[];
67-
}): Promise<ActivityPaging> {
46+
} & ContentPagingQuery & ContentFieldsQuery): Promise<ActivityPaging> {
6847
throwIfNotDefined(personId, 'personId');
6948
opts = opts || {};
7049

src/api/content-rest-api/api/audit.api.ts

Lines changed: 19 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { AuditEntryPaging } from '../model/auditEntryPaging';
2323
import { BaseApi } from './base.api';
2424
import { throwIfNotDefined } from '../../../assert';
2525
import { buildCollectionParam } from '../../../alfrescoApiClient';
26+
import { ContentFieldsQuery, ContentIncludeQuery, ContentPagingQuery } from './types';
2627

2728
/**
2829
* Audit service.
@@ -64,7 +65,7 @@ You must have admin rights to delete audit information.
6465
};
6566

6667
const queryParams = {
67-
'where': where
68+
where
6869
};
6970

7071
return this.delete({
@@ -167,21 +168,9 @@ You must have admin rights to access audit information.
167168
* @param auditApplicationId The identifier of an audit application.
168169
* @param auditEntryId The identifier of an audit entry.
169170
* @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-
182171
* @return Promise<AuditEntryEntry>
183172
*/
184-
getAuditEntry(auditApplicationId: string, auditEntryId: string, opts?: { fields?: string[] }): Promise<AuditEntryEntry> {
173+
getAuditEntry(auditApplicationId: string, auditEntryId: string, opts?: ContentFieldsQuery): Promise<AuditEntryEntry> {
185174
throwIfNotDefined(auditApplicationId, 'auditApplicationId');
186175
throwIfNotDefined(auditEntryId, 'auditEntryId');
187176

@@ -240,7 +229,7 @@ parameter are returned in addition to those specified in the **fields** paramete
240229
241230
* @return Promise<AuditAppPaging>
242231
*/
243-
listAuditApps(opts?: { skipCount?: string; maxItems?: string; fields?: string[] }): Promise<AuditAppPaging> {
232+
listAuditApps(opts?: ContentPagingQuery & ContentFieldsQuery): Promise<AuditAppPaging> {
244233
const queryParams = {
245234
skipCount: opts?.skipCount,
246235
maxItems: opts?.maxItems,
@@ -279,9 +268,6 @@ You must have admin rights to retrieve audit information.
279268
*
280269
* @param auditApplicationId The identifier of an audit application.
281270
* @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)
285271
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
286272
sort the list by one or more fields.
287273
@@ -290,9 +276,6 @@ above to check if any fields used in this method have a descending default searc
290276
291277
To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
292278
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)
296279
* @param opts.where Optionally filter the list. Here are some examples:
297280
298281
* where=(createdByUser='jbloggs')
@@ -306,32 +289,12 @@ If not supplied then the default value is 100.
306289
* where=(valuesKey='/alfresco-access/login/user')
307290
308291
* 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-
325292
* @return Promise<AuditEntryPaging>
326293
*/
327294
listAuditEntriesForAuditApp(auditApplicationId: string, opts?: {
328-
skipCount?: number;
329-
maxItems?: number;
330295
where?: string;
331296
orderBy?: string[];
332-
include?: string[];
333-
fields?: string[];
334-
}): Promise<AuditEntryPaging> {
297+
} & ContentPagingQuery & ContentFieldsQuery & ContentIncludeQuery ): Promise<AuditEntryPaging> {
335298
throwIfNotDefined(auditApplicationId, 'auditApplicationId');
336299
opts = opts || {};
337300

@@ -340,12 +303,12 @@ parameter are returned in addition to those specified in the **fields** paramete
340303
};
341304

342305
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')
349312
};
350313

351314
return this.get({
@@ -375,9 +338,6 @@ This relies on the pre-configured 'alfresco-access' audit application.
375338
*
376339
* @param nodeId The identifier of a node.
377340
* @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)
381341
* @param opts.orderBy A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to
382342
sort the list by one or more fields.
383343
@@ -386,42 +346,19 @@ above to check if any fields used in this method have a descending default searc
386346
387347
To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
388348
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)
392349
* @param opts.where Optionally filter the list. Here are some examples:
393350
394351
* where=(createdByUser='-me-')
395352
396353
* where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')
397354
398355
* 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-
415356
* @return Promise<AuditEntryPaging>
416357
*/
417358
listAuditEntriesForNode(nodeId: string, opts?: {
418-
skipCount?: number;
419-
maxItems?: number;
420359
orderBy?: string[];
421360
where?: string;
422-
include?: string[];
423-
fields?: string[];
424-
}): Promise<AuditEntryPaging> {
361+
} & ContentPagingQuery & ContentIncludeQuery & ContentFieldsQuery): Promise<AuditEntryPaging> {
425362
throwIfNotDefined(nodeId, 'nodeId');
426363
opts = opts || {};
427364

@@ -430,12 +367,12 @@ parameter are returned in addition to those specified in the **fields** paramete
430367
};
431368

432369
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')
439376
};
440377

441378
return this.get({
@@ -464,21 +401,9 @@ You must have admin rights to update audit application.
464401
* @param auditApplicationId The identifier of an audit application.
465402
* @param auditAppBodyUpdate The audit application to update.
466403
* @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-
479404
* @return Promise<AuditApp>
480405
*/
481-
updateAuditApp(auditApplicationId: string, auditAppBodyUpdate: AuditBodyUpdate, opts?: { fields?: string[] }): Promise<AuditApp> {
406+
updateAuditApp(auditApplicationId: string, auditAppBodyUpdate: AuditBodyUpdate, opts?: ContentFieldsQuery): Promise<AuditApp> {
482407
throwIfNotDefined(auditApplicationId, 'auditApplicationId');
483408
throwIfNotDefined(auditAppBodyUpdate, 'auditAppBodyUpdate');
484409

0 commit comments

Comments
 (0)