[PRODENG-211] integrate JS-API with monorepo (part 1) (#9081)

* integrate JS-API with monorepo

* [ci:force] fix token issue

[ci:force] migrate docs folder

[ci:force] clean personal tokens

* [ci:force] gha workflow support

* [ci:force] npm publish target

* fix js-api test linting

* [ci:force] fix test linting, mocks, https scheme

* [ci:force] fix https scheme

* [ci:force] typescript mappings

* [ci:force] update scripts

* lint fixes

* linting fixes

* fix linting

* [ci:force] linting fixes

* linting fixes

* [ci:force] remove js-api upstream and corresponding scripts

* [ci:force] jsdoc fixes

* fix jsdoc linting

* [ci:force] jsdoc fixes

* [ci:force] jsdoc fixes

* jsdoc fixes

* jsdoc fixes

* jsdoc fixes

* [ci:force] fix jsdoc

* [ci:force] reduce code duplication

* replace 'chai' expect with node.js assert

* replace 'chai' expect with node.js assert

* [ci:force] remove chai and chai-spies for js-api testing

* [ci:force] cleanup and fix imports

* [ci:force] fix linting

* [ci:force] fix unit test

* [ci:force] fix sonar linting findings

* [ci:force] switch activiti api models to interfaces (-2.5% reduction of bundle)

* [ci:force] switch activiti api models to interfaces

* [ci:force] switch AGS api models to interfaces

* [ci:force] switch AGS api models to interfaces

* [ci:force] switch search api models to interfaces

* [ci:force] switch content api models to interfaces where applicable
This commit is contained in:
Denys Vuika
2023-11-21 10:27:51 +00:00
committed by GitHub
parent 804fa2ffd4
commit ea2c0ce229
1334 changed files with 82605 additions and 1068 deletions

View File

@@ -0,0 +1,272 @@
# ActionsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|---------------------------------|--------------------------------------------------|----------------------------------------------|
| [actionDetails](#actionDetails) | **GET** /action-definitions/{actionDefinitionId} | Retrieve the details of an action definition |
| [actionExec](#actionExec) | **POST** /action-executions | Execute an action |
| [listActions](#listActions) | **GET** /action-definitions | Retrieve list of available actions |
| [nodeActions](#nodeActions) | **GET** /nodes/{nodeId}/action-definitions | Retrieve actions for a node |
## actionDetails
Retrieve the details of an action definition
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|------------------------|--------|-----------------------------------------|
| **actionDefinitionId** | string | The identifier of an action definition. |
**Return type**: [ActionDefinitionEntry](#ActionDefinitionEntry)
**Example**
```javascript
import { AlfrescoApi, ActionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const actionsApi = new ActionsApi(alfrescoApi);
actionsApi.actionDetails(`<actionDefinitionId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## actionExec
Execute an action
> this endpoint is available in **Alfresco 5.2** and newer versions.
Executes an action
An action may be executed against a node specified by **targetId**. For example:
```json
{
"actionDefinitionId": "copy",
"targetId": "4c4b3c43-f18b-43ff-af84-751f16f1ddfd",
"params": {
"destination-folder": "34219f79-66fa-4ebf-b371-118598af898c"
}
}
```
Performing a POST with the request body shown above will result in the node identified by targetId
being copied to the destination folder specified in the params object by the key destination-folder.
**targetId** is optional, however, currently **targetId** must be a valid node ID.
In the future, actions may be executed against different entity types or
executed without the need for the context of an entity.
Parameters supplied to the action within the params object will be converted to the expected type,
where possible using the DefaultTypeConverter class. In addition:
* Node IDs may be supplied in their short form (implicit `workspace://SpacesStore` prefix)
* Aspect names may be supplied using their short form, e.g. `cm:versionable` or `cm:auditable`
In this example, we add the aspect `cm:versionable` to a node using the QName resolution mentioned above:
```json
{
"actionDefinitionId": "add-features",
"targetId": "16349e3f-2977-44d1-93f2-73c12b8083b5",
"params": {
"aspect-name": "cm:versionable"
}
}
```
The actionDefinitionId is the id of an action definition as returned by
the _list actions_ operations (e.g. `GET /action-definitions`).
The action will be executed **asynchronously** with a 202 HTTP response signifying that
the request has been accepted successfully. The response body contains the unique ID of the action
pending execution. The ID may be used, for example to correlate an execution with output in the server logs.
**Parameters**
| Name | Type | Description |
|----------------|-----------------------------------|--------------------------|
| actionBodyExec | [ActionBodyExec](#ActionBodyExec) | Action execution details |
**Return type**: [ActionExecResultEntry](#ActionExecResultEntry)
**Example**
```javascript
import { AlfrescoApi, ActionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const actionsApi = new ActionsApi(alfrescoApi);
const actionBodyExec = {};
actionsApi.actionExec(actionBodyExec).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listActions
Retrieve list of available actions
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
The default sort order for the returned list is for actions to be sorted by ascending name.
You can override the default by using the **orderBy** parameter.
You can use any of the following fields to order the results:
* name
* title
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [ActionDefinitionList](#ActionDefinitionList)
**Example**
```javascript
import { AlfrescoApi, ActionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const actionsApi = new ActionsApi(alfrescoApi);
const opts = {};
actionsApi.listActions(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## nodeActions
Retrieve actions for a node
> this endpoint is available in Alfresco 5.2 and newer versions.
The default sort order for the returned list is for actions to be sorted by ascending name.
You can override the default by using the **orderBy** parameter.
You can use any of the following fields to order the results:
* name
* title
**Parameters**
| Name | Type | Description | Notes |
|----------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **nodeId** | string | The identifier of a node. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.fields | string [] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [ActionDefinitionList](#ActionDefinitionList)
**Example**
```javascript
import { AlfrescoApi, ActionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const actionsApi = new ActionsApi(alfrescoApi);
const opts = {};
actionsApi.nodeActions(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## ActionBodyExec
**Properties**
| Name | Type | Description |
|------------------------|--------|------------------------------------------------------------------------------|
| **actionDefinitionId** | string | |
| targetId | string | The entity upon which to execute the action, typically a node ID or similar. |
| params | any | |
## ActionDefinitionEntry
**Properties**
| Name | Type |
|-----------|---------------------------------------|
| **entry** | [ActionDefinition](#ActionDefinition) |
## ActionDefinition
**Properties**
| Name | Type | Description |
|----------------------|-----------------------------------------------------------|-------------------------------------------------------------------------------------------|
| **id** | string | Identifier of the action definition — used for example when executing an action |
| name | string | name of the action definition, e.g. "move" |
| title | string | title of the action definition, e.g. "Move" |
| description | string | describes the action definition, e.g. "This will move the matched item to another space." |
| **applicableTypes** | string[] | QNames of the types this action applies to |
| **trackStatus** | boolean | whether the basic action definition supports action tracking or not |
| parameterDefinitions | [ActionParameterDefinition[]](#ActionParameterDefinition) | |
## ActionParameterDefinition
**Properties**
| Name | Type |
|--------------|---------|
| name | string |
| type | string |
| multiValued | boolean |
| mandatory | boolean |
| displayLabel | string |
## ActionExecResultEntry
**Properties**
| Name | Type |
|-----------|---------------------------------------|
| **entry** | [ActionExecResult](#ActionExecResult) |
## ActionExecResult
**Properties**
| Name | Type | Description |
|--------|--------|-------------------------------------------------------|
| **id** | string | The unique identifier of the action pending execution |
## ActionDefinitionList
**Properties**
| Name | Type |
|------|-------------------------------------------------------|
| list | [ActionDefinitionListList](#ActionDefinitionListList) |
## ActionDefinitionListList
**Properties**
| Name | Type |
|------------|-----------------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [ActionDefinition[]](#ActionDefinition) |

View File

@@ -0,0 +1,86 @@
# Activities Api
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------|---------------------------------------|-----------------|
| [listActivitiesForPerson](#listActivitiesForPerson) | **GET** /people/{personId}/activities | List activities |
## listActivitiesForPerson
List activities
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------|
| **personId** | string | The identifier of a person. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | [default to 0] |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | [default to 100] |
| opts.who | string | A filter to include the user's activities only me, other user's activities only others' | |
| opts.siteId | string | Include only activity feed entries relating to this site. | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [ActivityPaging](#ActivityPaging)
**Example**x
```javascript
import { AlfrescoApi, ActivitiesApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const activitiesApi = new ActivitiesApi(alfrescoApi);
const personId = '<personId>';
const opts = {};
activitiesApi.listActivitiesForPerson(personId, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## ActivityPaging
**Properties**
| Name | Type |
|------|-------------------------------------------|
| list | [ActivityPagingList](#ActivityPagingList) |
## ActivityPagingList
**Properties**
| Name | Type |
|------------|-----------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [ActivityEntry[]](#ActivityEntry) |
## ActivityEntry
**Properties**
| Name | Type |
|-------|-----------------------|
| entry | [Activity](#Activity) |
## Activity
**Properties**
| Name | Type | Description |
|------------------|---------------------|---------------------------------------------------------------|
| **postPersonId** | string | The id of the person who performed the activity |
| **id** | number | The unique id of the activity |
| siteId | string | The unique id of the site on which the activity was performed |
| postedAt | Date | The date time at which the activity was performed |
| **feedPersonId** | string | The feed on which this activity was posted |
| activitySummary | Map<string, string> | An object summarizing the activity |
| **activityType** | string | The type of the activity posted |

View File

@@ -0,0 +1,9 @@
# Association
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**targetId** | **string** | | [default to null]
**assocType** | **string** | | [default to null]

View File

@@ -0,0 +1,8 @@
# AssociationEntry
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**entry** | [**Association**](Association.md) | | [default to null]

View File

@@ -0,0 +1,8 @@
# AssociationInfo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**assocType** | **string** | | [default to null]

View File

@@ -0,0 +1,427 @@
**# AuditApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------------------|----------------------------------------------------------------------------------|-----------------------------------------------------------|
| [deleteAuditEntriesForAuditApp](#deleteAuditEntriesForAuditApp) | **DELETE** /audit-applications/{auditApplicationId}/audit-entries | Permanently delete audit entries for an audit application |
| [deleteAuditEntry](#deleteAuditEntry) | **DELETE** /audit-applications/{auditApplicationId}/audit-entries/{auditEntryId} | Permanently delete an audit entry |
| [getAuditApp](#getAuditApp) | **GET** /audit-applications/{auditApplicationId} | Get audit application info |
| [getAuditEntry](#getAuditEntry) | **GET** /audit-applications/{auditApplicationId}/audit-entries/{auditEntryId} | Get audit entry |
| [listAuditApps](#listAuditApps) | **GET** /audit-applications | List audit applications |
| [listAuditEntriesForAuditApp](#listAuditEntriesForAuditApp) | **GET** /audit-applications/{auditApplicationId}/audit-entries | List audit entries for an audit application |
| [listAuditEntriesForNode](#listAuditEntriesForNode) | **GET** /nodes/{nodeId}/audit-entries | List audit entries for a node |
| [updateAuditApp](#updateAuditApp) | **PUT** /audit-applications/{auditApplicationId} | Update audit application info |
## deleteAuditEntriesForAuditApp
Permanently delete audit entries for an audit application
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
The **where** clause must be specified, either with an inclusive time period or for
an inclusive range of ids. The deletion is within the context of the given audit application.
For example:
- `where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00', '2017-06-04T10:05:16.536+01:00')`
- `where=(id BETWEEN ('1234', '4321')`
You must have admin rights to delete audit information.
**Parameters**
| Name | Type | Description |
|------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **auditApplicationId** | string | The identifier of an audit application. |
| **where** | string | Audit entries to permanently delete for an audit application, given an inclusive time period or range of ids. For example: `where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')`, `where=(id BETWEEN ('1234', '4321')` |
**Example**
```javascript
import { AlfrescoApi, AuditApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
auditApi.deleteAuditEntriesForAuditApp('<auditApplicationId>', '<where>').then(() => {
console.log('API called successfully.');
});
```
## deleteAuditEntry
Permanently delete an audit entry
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must have admin rights to delete audit information.
**Parameters**
| Name | Type | Description |
|------------------------|--------|-----------------------------------------|
| **auditApplicationId** | string | The identifier of an audit application. |
| **auditEntryId** | string | The identifier of an audit entry. |
**Example**
```javascript
import { AlfrescoApi, AuditApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
auditApi.deleteAuditEntry('<auditApplicationId>', '<auditEntryId>').then(() => {
console.log('API called successfully.');
});
```
## getAuditApp
Get audit application info
> **Note:** this endpoint is available in Alfresco 5.2.2 and newer versions.
> You must have admin rights to retrieve audit information.
You can use the **include** parameter to return the minimum and/or maximum audit record id for the application.
**Parameters**
| Name | Type | Description |
|------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **auditApplicationId** | string | The identifier of an audit application. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
| opts.include | string[] | Also include the current minimum and/or maximum audit entry ids for the application. The following optional fields can be requested: `max`, `min` |
**Return type**: [AuditApp](#AuditApp)
**Example**
```javascript
import { AlfrescoApi, AuditApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
const opts = {};
auditApi.getAuditApp(`<auditApplicationId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getAuditEntry
Get audit entry
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must have admin rights to access audit information.
**Parameters**
| Name | Type | Description |
|------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **auditApplicationId** | string | The identifier of an audit application. |
| **auditEntryId** | string | The identifier of an audit entry. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [AuditEntryEntry](#AuditEntryEntry)
**Example**
```javascript
import { AlfrescoApi, AuditApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
const opts = {};
auditApi.getAuditEntry('<auditApplicationId>', '<auditEntryId>', opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listAuditApps
List audit applications
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must have admin rights to retrieve audit information.
Gets a list of audit applications in this repository.
This list may include pre-configured audit applications, if enabled, such as:
* alfresco-access
* CMISChangeLog
* Alfresco Tagging Service
* Alfresco Sync Service (used by Enterprise Cloud Sync)
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. | If not supplied then the default value is 0. default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [AuditAppPaging](#AuditAppPaging)
**Example**
```javascript
import { AlfrescoApi, AuditApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
const opts = {};
auditApi.listAuditApps(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listAuditEntriesForAuditApp
List audit entries for an audit application
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must have admin rights to retrieve audit information.
You can use the **include** parameter to return additional **values** information.
The list can be filtered by one or more of:
* **createdByUser** person id
* **createdAt** inclusive time period
* **id** inclusive range of ids
* **valuesKey** audit entry values contains the exact matching key
* **valuesValue** audit entry values contains the exact matching value
The default sort order is **createdAt** ascending, but you can use an optional **ASC** or **DESC**
modifier to specify an ascending or descending sort order.
For example, specifying `orderBy=createdAt DESC` returns audit entries in descending **createdAt** order.
**Example**
```javascript
import { AlfrescoApi, AuditApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
const opts = {};
auditApi.listAuditEntriesForAuditApp(`<auditApplicationId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
**Parameters**
| Name | Type | Description | Notes |
|------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **auditApplicationId** | string | The identifier of an audit application. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.orderBy | string | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.where | string | Optionally filter the list. | |
| opts.include | string | Returns additional information about the audit entry. The following optional fields can be requested: `values` | |
| opts.fields | string | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**where** examples:
* `where=(createdByUser='jbloggs')`
* `where=(id BETWEEN ('1234', '4321')`
* `where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00', '2017-06-04T10:05:16.536+01:00')`
* `where=(createdByUser='jbloggs' and createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00', '2017-06-04T10:05:16.536+01:00')`
* `where=(valuesKey='/alfresco-access/login/user')`
* `where=(valuesKey='/alfresco-access/transaction/action' and valuesValue='DELETE')`
**Return type**: [AuditEntryPaging](#AuditEntryPaging)
## listAuditEntriesForNode
List audit entries for a node
> this endpoint is available in Alfresco 5.2.2 and newer versions.
Gets a list of audit entries for node **nodeId**.
The list can be filtered by **createdByUser** and for a given inclusive time period.
The default sort order is **createdAt** ascending, but you can use an optional **ASC** or **DESC**
modifier to specify an ascending or descending sort order.
For example, specifying `orderBy=createdAt DESC` returns audit entries in descending **createdAt** order.
This relies on the pre-configured 'alfresco-access' audit application.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **nodeId** | string | The identifier of a node. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.where | string | Optionally filter the list. | |
| opts.include | string[] | Returns additional information about the audit entry. The following optional fields can be requested: `values` | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**where* examples:
- `where=(createdByUser='-me-')`
- `where=(createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')`
- `where=(createdByUser='jbloggs' and createdAt BETWEEN ('2017-06-02T12:13:51.593+01:00' , '2017-06-04T10:05:16.536+01:00')`
**Return type**: [AuditEntryPaging](#AuditEntryPaging)
**Example**
```javascript
import { AlfrescoApi, AuditApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
const opts = {};
auditApi.listAuditEntriesForNode(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## updateAuditApp
Update audit application info
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must have admin rights to update audit application.
Disable or re-enable the audit application **auditApplicationId**.
New audit entries will not be created for a disabled audit application until
it is re-enabled (and system-wide auditing is also enabled).
> it is still possible to query &/or delete any existing audit entries even
if auditing is disabled for the audit application.
**Parameters**
| Name | Type | Description |
|------------------------|-------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **auditApplicationId** | string | The identifier of an audit application. |
| **auditAppBodyUpdate** | [AuditBodyUpdate](#AuditBodyUpdate) | The audit application to update. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [AuditApp](#AuditApp)
**Example**
```javascript
import { AlfrescoApi, AuditApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*...*/);
const auditApi = new AuditApi(alfrescoApi);
const auditAppBodyUpdate = {};
const opts = {};
auditApi.updateAuditApp(`<auditApplicationId>`, auditAppBodyUpdate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## AuditApp
**Properties**
| Name | Type |
|------------|---------|
| **id** | string |
| name | string |
| isEnabled | boolean |
| maxEntryId | number |
| minEntryId | number |
## AuditAppPaging
**Properties**
| Name | Type |
|------|-------------------------------------------|
| list | [AuditAppPagingList](#AuditAppPagingList) |
## AuditAppPagingList
**Properties**
| Name | Type |
|------------|-----------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [AuditAppEntry[]](#AuditAppEntry) |
## AuditAppEntry
**Properties**
| Name | Type |
|-------|-----------------------|
| entry | [AuditApp](#AuditApp) |
## AuditApp
**Properties**
| Name | Type |
|------------|---------|
| **id** | string |
| name | string |
| isEnabled | boolean |
| maxEntryId | number |
| minEntryId | number |
## AuditBodyUpdate
| Name | Type |
|-----------|---------|
| isEnabled | boolean |
## AuditEntryPaging
**Properties**
| Name | Type |
|------|-----------------------------------------------|
| list | [AuditEntryPagingList](#AuditEntryPagingList) |
## AuditEntryPagingList
**Properties**
| Name | Type |
|------------|---------------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [AuditEntryEntry[]](#AuditEntryEntry) |
## AuditEntryEntry
**Properties**
| Name | Type |
|-------|---------------------------|
| entry | [AuditEntry](#AuditEntry) |
## AuditEntry
**Properties**
| Name | Type |
|------------------------|-------------------------|
| **id** | string |
| **auditApplicationId** | string |
| **createdByUser** | [UserInfo](UserInfo.md) |
| **createdAt** | Date |
| values | any |

View File

@@ -0,0 +1,73 @@
# CategoriesApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------|--------------------------------------------------------|---------------------------------------------|
| [getSubcategories](#getSubcategories) | **GET** /categories/{categoryId}/subcategories | List of subcategories within category |
| [getCategory](#getCategory) | **GET** /categories/{categoryId} | Get a category |
| [getCategoryLinksForNode](#getCategoryLinksForNode) | **GET** /nodes/{nodeId}/category-links | List of categories that node is assigned to |
| [deleteCategory](#deleteCategory) | **DELETE** /categories/{categoryId} | Deletes the category |
| [unlinkNodeFromCategory](#unlinkNodeFromCategory) | **DELETE** /nodes/{nodeId}/category-links/{categoryId} | Unassign a node from category |
| [updateCategory](#updateCategory) | **PUT** /categories/{categoryId} | Update a category |
| [createSubcategories](#createSubcategories) | **POST** /categories/{categoryId}/subcategories | Create new categories |
| [linkNodeToCategory](#linkNodeToCategory) | **POST** /nodes/{nodeId}/category-links | Assign a node to a category |
# Models
## CategoryPaging
**Properties**
| Name | Type |
|------|-------------------------------------------|
| list | [CategoryPagingList](#CategoryPagingList) |
## CategoryPagingList
**Properties**
| Name | Type |
|------------|-----------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [CategoryEntry[]](#CategoryEntry) |
## CategoryEntry
**Properties**
| Name | Type |
|-----------|-----------------------|
| **entry** | [Category](#Category) |
## Category
**Properties**
| Name | Type |
|-------------|---------|
| **id** | string |
| **name** | string |
| parentId | string |
| hasChildren | boolean |
| count | number |
| path | string |
## CategoryBody
**Properties**
| Name | Type |
|----------|--------|
| **name** | string |
## CategoryLinkBody
**Properties**
| Name | Type |
|----------------|--------|
| **categoryId** | string |

View File

@@ -0,0 +1,10 @@
# ChildAssociation
**Properties**
| Name | Type |
|---------------|--------|
| **childId** | string |
| **assocType** | string |

View File

@@ -0,0 +1,9 @@
# ChildAssociationEntry
**Properties**
| Name | Type |
|-----------|-----------------------------------------|
| **entry** | [ChildAssociation](ChildAssociation.md) |

View File

@@ -0,0 +1,10 @@
# ChildAssociationInfo
**Properties**
| Name | Type |
|---------------|---------|
| **assocType** | string |
| **isPrimary** | boolean |

View File

@@ -0,0 +1,220 @@
# CommentsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|---------------------------------|-------------------------------------------------|------------------|
| [createComment](#createComment) | **POST** /nodes/{nodeId}/comments | Create a comment |
| [deleteComment](#deleteComment) | **DELETE** /nodes/{nodeId}/comments/{commentId} | Delete a comment |
| [listComments](#listComments) | **GET** /nodes/{nodeId}/comments | List comments |
| [updateComment](#updateComment) | **PUT** /nodes/{nodeId}/comments/{commentId} | Update a comment |
## createComment
Create a comment
You specify the comment in a JSON body like this:
```json
{
"content": "This is a comment"
}
```
**Note:** You can create more than one comment by specifying a list of comments in the JSON body like this:
```json
[
{
"content": "This is a comment"
},
{
"content": "This is another comment"
}
]
```
If you specify a list as input, then a paginated list rather than an entry is returned in the response body.
For example:
```json
{
"list": {
"pagination": {
"count": 2,
"hasMoreItems": false,
"totalItems": 2,
"skipCount": 0,
"maxItems": 100
},
"entries": [
{
"entry": {}
},
{
"entry": {}
}
]
}
}
```
**Parameters**
| Name | Type | Description |
|-----------------------|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **commentBodyCreate** | [CommentBody](#CommentBody) | The comment text. Note that you can also provide a list of comments. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [CommentEntry](#CommentEntry)
**Example**
```javascript
import { AlfrescoApi, CommentsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const commentsApi = new CommentsApi(alfrescoApi);
const opts = {};
const commentBodyCreate = {};
commentsApi.createComment(`<nodeId>`, commentBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteComment
Delete a comment
**Parameters**
| Name | Type | Description |
|---------------|--------|------------------------------|
| **nodeId** | string | The identifier of a node. |
| **commentId** | string | The identifier of a comment. |
**Example**
```javascript
import { AlfrescoApi, CommentsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const commentsApi = new CommentsApi(alfrescoApi);
commentsApi.deleteComment(`<nodeId>`, `<commentId>`).then(() => {
console.log('API called successfully.');
});
```
## listComments
Gets a list of comments for the node **nodeId**, sorted chronologically with the newest comment first.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **nodeId** | string | The identifier of a node. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [CommentPaging](#CommentPaging)
**Example**
```javascript
import { AlfrescoApi, CommentsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const commentsApi = new CommentsApi(alfrescoApi);
const opts = {};
commentsApi.listComments(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## updateComment
Update a comment
**Parameters**
| Name | Type | Description |
|-----------------------|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **commentId** | string | The identifier of a comment. |
| **commentBodyUpdate** | [CommentBody](#CommentBody) | The JSON representing the comment to be updated. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [CommentEntry](#CommentEntry)
**Example**
```javascript
import { AlfrescoApi, CommentsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const commentsApi = new CommentsApi(alfrescoApi);
const commentBodyUpdate = {};
const opts = {};
commentsApi.updateComment(`<nodeId>`, `<commentId>`, commentBodyUpdate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## CommentBody
**Properties**
| Name | Type |
|-------------|--------|
| **content** | string |
## CommentPaging
**Properties**
| Name | Type |
|------|-----------------------------------------|
| list | [CommentPagingList](#CommentPagingList) |
## CommentPagingList
**Properties**
| Name | Type |
|------------|---------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [CommentEntry[]](#CommentEntry) |
## CommentEntry
**Properties**
| Name | Type |
|-----------|---------------------|
| **entry** | [Comment](#Comment) |
## Comment
**Properties**
| Name | Type |
|----------------|---------------------|
| **id** | string |
| **title** | string |
| **content** | string |
| **createdBy** | [Person](Person.md) |
| **createdAt** | Date |
| **edited** | boolean |
| **modifiedBy** | [Person](Person.md) |
| **modifiedAt** | Date |
| **canEdit** | boolean |
| **canDelete** | boolean |

View File

@@ -0,0 +1,16 @@
# Company
**Properties**
| Name | Type |
|--------------|--------|
| organization | string |
| address1 | string |
| address2 | string |
| address3 | string |
| postcode | string |
| telephone | string |
| fax | string |
| email | string |

View File

@@ -0,0 +1,12 @@
# ContentInfo
**Properties**
| Name | Type |
|------------------|--------|
| **mimeType** | string |
| **mimeTypeName** | string |
| **sizeInBytes** | number |
| encoding | string |

View File

@@ -0,0 +1,8 @@
# Definition
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**properties** | [**Property[]**](Property.md) | List of property definitions effective for this node as the result of combining the type with all aspects. | [optional] [default to null]

View File

@@ -0,0 +1,9 @@
# DirectAccessUrl
**Properties**
| Name | Type | Description |
|----------------|---------|----------------------------------------------------------------------------|
| **contentUrl** | string | The direct access URL of a binary content |
| attachment | boolean | Whether or not the content downloads as an attachment |
| expiryTime | Date | The direct access URL would become invalid when the expiry date is reached |

View File

@@ -0,0 +1,9 @@
# DirectAccessUrlEntry
**Properties**
| Name | Type |
|-----------|---------------------------------------|
| **entry** | [DirectAccessUrl](DirectAccessUrl.md) |

View File

@@ -0,0 +1,156 @@
# DownloadsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------|------------------------------------|-----------------------|
| [cancelDownload](#cancelDownload) | **DELETE** /downloads/{downloadId} | Cancel a download |
| [createDownload](#createDownload) | **POST** /downloads | Create a new download |
| [getDownload](#getDownload) | **GET** /downloads/{downloadId} | Get a download |
## cancelDownload
Cancel a download
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
Cancels the creation of a download request.
> The download node can be deleted using the **DELETE /nodes/{downloadId}** endpoint
By default, if the download node is not deleted it will be picked up by a cleaner job which removes download nodes older than a configurable amount of time (default is 1 hour)
Information about the existing progress at the time of cancelling can be retrieved by calling the **GET /downloads/{downloadId}** endpoint
The cancel operation is done asynchronously.
**Parameters**
| Name | Type | Description |
|----------------|--------|------------------------------------|
| **downloadId** | string | The identifier of a download node. |
**Example**
```javascript
import { AlfrescoApi, DownloadsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const downloadsApi = new DownloadsApi(alfrescoApi);
downloadsApi.cancelDownload(`<downloadId>`).then(() => {
console.log('API called successfully.');
});
```
## createDownload
Create a new download
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
Creates a new download node asynchronously, the content of which will be the zipped content of the **nodeIds** specified in the JSON body like this:
```json
{
"nodeIds":
[
"c8bb482a-ff3c-4704-a3a3-de1c83ccd84c",
"cffa62db-aa01-493d-9594-058bc058eeb1"
]
}
```
> The content of the download node can be obtained using the **GET /nodes/{downloadId}/content** endpoint
**Parameters**
| Name | Type | Description |
|------------------------|-------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **downloadBodyCreate** | [DownloadBodyCreate](#DownloadBodyCreate) | The nodeIds the content of which will be zipped, which zip will be set as the content of our download node. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [DownloadEntry](#DownloadEntry)
**Example**
```javascript
import { AlfrescoApi, DownloadsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const downloadsApi = new DownloadsApi(alfrescoApi);
const downloadBodyCreate = {};
const opts = {};
downloadsApi.createDownload(downloadBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getDownload
Retrieve status information for download node
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
**Parameters**
| Name | Type | Description |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **downloadId** | string | The identifier of a download node. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [DownloadEntry](#DownloadEntry)
**Example**
```javascript
import { AlfrescoApi, DownloadsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const downloadsApi = new DownloadsApi(alfrescoApi);
const opts = {};
downloadsApi.getDownload(`<downloadId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## DownloadBodyCreate
**Properties**
| Name | Type |
|-------------|----------|
| **nodeIds** | string[] |
## DownloadEntry
**Properties**
| Name | Type |
|-----------|-----------------------|
| **entry** | [Download](#Download) |
## Download
**Properties**
| Name | Type | Description |
|------------|--------|--------------------------------------------------|
| filesAdded | number | number of files added so far in the zip |
| bytesAdded | number | number of bytes added so far in the zip |
| id | string | the id of the download node |
| totalFiles | number | the total number of files to be added in the zip |
| totalBytes | number | the total number of bytes to be added in the zip |
| status | string | the current status of the download node creation |
### Download.StatusEnum
* `PENDING` (value: `'PENDING'`)
* `CANCELLED` (value: `'CANCELLED'`)
* `INPROGRESS` (value: `'IN_PROGRESS'`)
* `DONE` (value: `'DONE'`)
* `MAXCONTENTSIZEEXCEEDED` (value: `'MAX_CONTENT_SIZE_EXCEEDED'`)

View File

@@ -0,0 +1,8 @@
# ModelError
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | [**ErrorError**](ErrorError.md) | | [optional] [default to null]

View File

@@ -0,0 +1,13 @@
# ErrorError
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**errorKey** | **string** | | [optional] [default to null]
**statusCode** | **number** | | [default to null]
**briefSummary** | **string** | | [default to null]
**stackTrace** | **string** | | [default to null]
**descriptionURL** | **string** | | [default to null]
**logId** | **string** | | [optional] [default to null]

View File

@@ -0,0 +1,465 @@
# FavoritesApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------------|-------------------------------------------------------|------------------------|
| [createFavorite](#createFavorite) | **POST** /people/{personId}/favorites | Create a favorite |
| [createSiteFavorite](#createSiteFavorite) | **POST** /people/{personId}/favorite-sites | Create a site favorite |
| [deleteFavorite](#deleteFavorite) | **DELETE** /people/{personId}/favorites/{favoriteId} | Delete a favorite |
| [deleteSiteFavorite](#deleteSiteFavorite) | **DELETE** /people/{personId}/favorite-sites/{siteId} | Delete a site favorite |
| [getFavorite](#getFavorite) | **GET** /people/{personId}/favorites/{favoriteId} | Get a favorite |
| [getFavoriteSite](#getFavoriteSite) | **GET** /people/{personId}/favorite-sites/{siteId} | Get a favorite site |
| [listFavoriteSitesForPerson](#listFavoriteSitesForPerson) | **GET** /people/{personId}/favorite-sites | List favorite sites |
| [listFavorites](#listFavorites) | **GET** /people/{personId}/favorites | List favorites |
## createFavorite
Favorite a **site**, **file**, or **folder** in the repository.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Note:** You can favorite more than one entity by specifying a list of objects in the JSON body like this:
```json
[
{
"target": {
"file": {
"guid": "abcde-01234-...."
}
}
},
{
"target": {
"file": {
"guid": "abcde-09863-...."
}
}
}
]
```
If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example:
```json
{
"list": {
"pagination": {
"count": 2,
"hasMoreItems": false,
"totalItems": 2,
"skipCount": 0,
"maxItems": 100
},
"entries": [
{
"entry": {}
},
{
"entry": {}
}
]
}
}
```
**Parameters**
| Name | Type | Description |
|------------------------|-------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **favoriteBodyCreate** | [FavoriteBodyCreate](#FavoriteBodyCreate) | An object identifying the entity to be favorited. The object consists of a single property which is an object with the name site, file, or folder. The content of that object is the guid of the target entity. For example, to favorite a file the following body would be used. |
| opts.include | string[] | Returns additional information about favorites, the following optional fields can be requested: `path` (note, this only applies to files and folders), `properties` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [FavoriteEntry](#FavoriteEntry)
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
const favoriteBodyCreate = {};
const opts = {};
favoritesApi.createFavorite(`<personId>`, favoriteBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## createSiteFavorite
Create a site favorite
> this endpoint is deprecated as of **Alfresco 4.2**, and will be removed in the future.
> Use **/people/{personId}/favorites** instead.
Create a site favorite for person **personId**.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Note:** You can favorite more than one site by specifying a list of sites in the JSON body like this:
```json
[
{
"id": "test-site-1"
},
{
"id": "test-site-2"
}
]
```
If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example:
```json
{
"list": {
"pagination": {
"count": 2,
"hasMoreItems": false,
"totalItems": 2,
"skipCount": 0,
"maxItems": 100
},
"entries": [
{
"entry": {}
},
{
"entry": {}
}
]
}
}
```
**Parameters**
| Name | Type | Description |
|----------------------------|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **favoriteSiteBodyCreate** | [FavoriteSiteBodyCreate](#FavoriteSiteBodyCreate) | The id of the site to favorite. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [FavoriteSiteEntry](#FavoriteSiteEntry)
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
const favoriteSiteBodyCreate = {};
const opts = {};
favoritesApi.createSiteFavorite(`<personId>`, favoriteSiteBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteFavorite
Delete a favorite
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|----------------|--------|-------------------------------|
| **personId** | string | The identifier of a person. |
| **favoriteId** | string | The identifier of a favorite. |
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
favoritesApi.deleteFavorite(`<personId>`, `<favoriteId>`).then(() => {
console.log('API called successfully.');
});
```
## deleteSiteFavorite
Delete a site favorite
> this endpoint is deprecated as of **Alfresco 4.2**, and will be removed in the future.
> Use **/people/{personId}/favorites/{favoriteId}** instead.
Deletes site **siteId** from the favorite site list of person **personId**.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
favoritesApi.deleteSiteFavorite(`<personId>`, `<siteId>`).then(() => {
console.log('API called successfully.');
});
```
**Parameters**
| Name | Type | Description |
|--------------|--------|-----------------------------|
| **personId** | string | The identifier of a person. |
| **siteId** | string | The identifier of a site. |
## getFavorite
Get a favorite
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **favoriteId** | string | The identifier of a favorite. |
| opts.include | string[] | Returns additional information about favorites, the following optional fields can be requested: `path` (note, this only applies to files and folders), `properties` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [FavoriteEntry](#FavoriteEntry)
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
const opts = {};
favoritesApi.getFavorite(`<personId>`, `<favoriteId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getFavoriteSite
Get a favorite site
> This endpoint is **deprecated** as of **Alfresco 4.2**, and will be removed in the future.
> Use `/people/{personId}/favorites/{favoriteId}` instead.
Gets information on favorite site **siteId** of person **personId**.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **siteId** | string | The identifier of a site. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [SiteEntry](SiteEntry.md)
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
const opts = {};
favoritesApi.getFavoriteSite(`<personId>`, `<siteId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listFavoriteSitesForPerson
List favorite sites
> This endpoint is **deprecated** as of Alfresco 4.2, and will be removed in the future.
> Use **/people/{personId}/favorites** instead.
Gets a list of a person's favorite sites.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
const opts = {};
favoritesApi.listFavoriteSitesForPerson(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
**Parameters**
| Name | Type | Description |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [SitePaging](SitePaging.md)
## listFavorites
List favorites
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
The default sort order for the returned list of favorites is type ascending, createdAt descending.
You can override the default by using the **orderBy** parameter.
You can use any of the following fields to order the results:
* type
* createdAt
* title
You can use the **where** parameter to restrict the list in the response
to entries of a specific kind. The **where** parameter takes a value.
The value is a single predicate that can include one or more **EXISTS**
conditions. The **EXISTS** condition uses a single operand to limit the
list to include entries that include that one property. The property values are:
* target/file
* target/folder
* target/site
For example, the following **where** parameter restricts the returned list to the file favorites for a person:
```sql
(EXISTS(target/file))
```
You can specify more than one condition using **OR**.
The predicate must be enclosed in parentheses.
For example, the following **where** parameter restricts the returned list to the file and folder favorites for a person:
```sql
(EXISTS(target/file) OR EXISTS(target/folder))
```
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **personId** | string | The identifier of a person. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.where | string | A string to restrict the returned objects by using a predicate. | |
| opts.include | string[] | Returns additional information about favorites, the following optional fields can be requested: `path` (note, this only applies to files and folders), `properties` | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [FavoritePaging](#FavoritePaging)
**Example**
```javascript
import { AlfrescoApi, FavoritesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const favoritesApi = new FavoritesApi(alfrescoApi);
const opts = {};
favoritesApi.listFavorites(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## FavoritePaging
**Properties**
| Name | Type |
|------|-------------------------------------------|
| list | [FavoritePagingList](#FavoritePagingList) |
## FavoritePagingList
**Properties**
| Name | Type |
|------------|-----------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [FavoriteEntry[]](#FavoriteEntry) |
## FavoriteEntry
**Properties**
| Name | Type |
|-----------|-----------------------|
| **entry** | [Favorite](#Favorite) |
## Favorite
**Properties**
| Name | Type | Description |
|----------------|--------|----------------------------------------------------------------------------------------------------------------------------|
| **targetGuid** | string | The guid of the object that is a favorite. |
| **target** | any | |
| createdAt | Date | The time the object was made a favorite. |
| properties | any | A subset of the target favorite properties, system properties and properties already available in the target are excluded. |
## FavoriteBodyCreate
**Properties**
| Name | Type |
|------------|---------|
| **target** | **any** |
## FavoriteSiteBodyCreate
**Properties**
| Name | Type |
|------|--------|
| id | string |
## FavoriteSiteEntry
**Properties**
| Name | Type |
|-------|-------------------------------|
| entry | [FavoriteSite](#FavoriteSite) |
## FavoriteSite
**Properties**
| Name | Type |
|------|--------|
| id | string |

View File

@@ -0,0 +1,12 @@
# Group
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [default to null]
**displayName** | **string** | | [default to null]
**isRoot** | **boolean** | | [default to null]
**parentIds** | **string[]** | | [optional] [default to null]
**zones** | **string[]** | | [optional] [default to null]

View File

@@ -0,0 +1,18 @@
# GroupMember
**Properties**
| Name | Type |
|-----------------|--------|
| **id** | string |
| **displayName** | string |
| **memberType** | string |
## GroupMember.MemberTypeEnum
* `GROUP` (value: `'GROUP'`)
* `PERSON` (value: `'PERSON'`)

View File

@@ -0,0 +1,512 @@
# GroupsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------------------|------------------------------------------------------|-----------------------------|
| [createGroup](#createGroup) | **POST** /groups | Create a group |
| [createGroupMembership](#createGroupMembership) | **POST** /groups/{groupId}/members | Create a group membership |
| [deleteGroup](#deleteGroup) | **DELETE** /groups/{groupId} | Delete a group |
| [deleteGroupMembership](#deleteGroupMembership) | **DELETE** /groups/{groupId}/members/{groupMemberId} | Delete a group membership |
| [getGroup](#getGroup) | **GET** /groups/{groupId} | Get group details |
| [listGroupMemberships](#listGroupMemberships) | **GET** /groups/{groupId}/members | List memberships of a group |
| [listGroupMembershipsForPerson](#listGroupMembershipsForPerson) | **GET** /people/{personId}/groups | List group memberships |
| [listGroups](#listGroups) | **GET** /groups | List groups |
| [updateGroup](#updateGroup) | **PUT** /groups/{groupId} | Update group details |
## createGroup
Create a group
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> You must have admin rights to create a group.
Create a group.
The group id must start with \"GROUP\\_\". If this is omitted it will be added automatically.
This format is also returned when listing groups or group memberships. It should be noted
that the other group-related operations also expect the id to start with \"GROUP\\_\".
If one or more parentIds are specified then the group will be created and become a member
of each of the specified parent groups.
If no parentIds are specified then the group will be created as a root group.
The group will be created in the **APP.DEFAULT** and **AUTH.ALF** zones.
**Parameters**
| Name | Type | Description |
|---------------------|-------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **groupBodyCreate** | [GroupBodyCreate](#GroupBodyCreate) | The group to create. |
| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [GroupEntry](#GroupEntry)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const payload = {};
const opts = {};
groupsApi.createGroup(payload, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## createGroupMembership
Create a group membership
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> You must have admin rights to create a group membership.
Create a group membership (for an existing person or group) within a group **groupId**.
If the added group was previously a root group then it becomes a non-root group since it now has a parent.
It is an error to specify an **id** that does not exist.
**Parameters**
| Name | Type | Description |
|-------------------------------|---------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **groupId** | string | The identifier of a group. |
| **groupMembershipBodyCreate** | [GroupMembershipBodyCreate](#GroupMembershipBodyCreate) | The group membership to add (person or sub-group). |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [GroupMemberEntry](#GroupMemberEntry)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const groupMembershipBodyCreate = {};
const opts = {};
groupsApi.createGroupMembership(`<groupId>`, groupMembershipBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteGroup
Delete a group
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> You must have admin rights to delete a group.
The option to cascade delete applies this recursively to any hierarchy of group members.
In this case, removing a group member does not delete the person or subgroup itself.
If a removed subgroup no longer has any parent groups then it becomes a root group.
**Parameters**
| Name | Type | Description | Notes |
|--------------|---------|-----------------------------------------------------------------------|------------------|
| **groupId** | string | The identifier of a group. | |
| opts.cascade | boolean | If **true** then the delete will be applied in cascade to sub-groups. | default to false |
**Example**
```javascript
import { AlfrescoApi, GroupsApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const opts = {
cascade: true
};
groupsApi.deleteGroup(`<groupId>`, opts).then(() => {
console.log('API called successfully.');
});
```
## deleteGroupMembership
Delete a group membership
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> You must have admin rights to delete a group membership.
Delete group member **groupMemberId** (person or subgroup) from group **groupId**.
Removing a group member does not delete the person or subgroup itself.
If a removed subgroup no longer has any parent groups then it becomes a root group.
**Parameters**
| Name | Type | Description |
|---------------|--------|--------------------------------------|
| groupId | string | The identifier of a group. |
| groupMemberId | string | The identifier of a person or group. |
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
groupsApi.deleteGroupMembership(`<groupId>`, `<groupMemberId>`).then(() => {
console.log('API called successfully.');
});
```
## getGroup
Get group details
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
You can use the **include** parameter to return additional information.
**Parameters**
| Name | Type | Description |
|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **groupId** | string | The identifier of a group. |
| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [GroupEntry](#GroupEntry)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const opts = {};
groupsApi.getGroup(`<groupId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listGroupMemberships
List memberships of a group
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
Gets a list of the group memberships for the group **groupId**.
You can use the **where** parameter to filter the returned groups by **memberType**.
Example to filter by **memberType**, use any one of:
```text
(memberType='GROUP')
(memberType='PERSON')
```
The default sort order for the returned list is for group members to be sorted by ascending displayName.
You can override the default by using the **orderBy** parameter. You can specify one of the following fields in the **orderBy** parameter:
* id
* displayName
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **groupId** | string | The identifier of a group. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.where | string | A string to restrict the returned objects by using a predicate. | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [GroupMemberPaging](#GroupMemberPaging)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const opts = { };
groupsApi.listGroupMemberships(`<groupId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listGroupMembershipsForPerson
List group memberships
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
Gets a list of group membership information for person **personId**.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
You can use the **include** parameter to return additional information.
You can use the **where** parameter to filter the returned groups by **isRoot**. For example, the following **where**
clause will return just the root groups:
```text
(isRoot=true)
```
The **where** parameter can also be used to filter by ***zone***. This may be combined with isRoot to narrow
a result set even further. For example, the following where clause will only return groups belonging to the
`MY.ZONE` zone.
```text
where=(zones in ('MY.ZONE'))
```
This may be combined with the isRoot filter, as shown below:
```text
where=(isRoot=false AND zones in ('MY.ZONE'))
```
***Note:*** restrictions include
* AND is the only supported operator when combining isRoot and zones filters
* Only one zone is supported by the filter
* The quoted zone name must be placed in parentheses — a 400 error will result if these are omitted.
The default sort order for the returned list is for groups to be sorted by ascending displayName.
You can override the default by using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter:
* id
* displayName
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **personId** | string | The identifier of a person. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` | |
| opts.where | string | A string to restrict the returned objects by using a predicate. | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [GroupPaging](#GroupPaging)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const opts = {};
groupsApi.listGroupMembershipsForPerson(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listGroups
List groups
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
Gets a list of groups.
You can use the **include** parameter to return additional information.
You can use the **where** parameter to filter the returned groups by **isRoot**. For example, the following **where**
clause will return just the root groups:
```text
(isRoot=true)
```
The **where** parameter can also be used to filter by ***zone***. This may be combined with isRoot to narrow
a result set even further. For example, the following where clause will only return groups belonging to the
`MY.ZONE` zone.
```text
where=(zones in ('MY.ZONE'))
```
This may be combined with the isRoot filter, as shown below:
```text
where=(isRoot=false AND zones in ('MY.ZONE'))
```
***Note:*** restrictions include
* AND is the only supported operator when combining isRoot and zones filters
* Only one zone is supported by the filter
* The quoted zone name must be placed in parentheses — a 400 error will result if these are omitted.
The default sort order for the returned list is for groups to be sorted by ascending displayName.
You can override the default by using the **orderBy** parameter. You can specify one of the following fields in the **orderBy** parameter:
* id
* displayName
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` | |
| opts.where | string | A string to restrict the returned objects by using a predicate. | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [GroupPaging](#GroupPaging)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const opts = {};
groupsApi.listGroups(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## updateGroup
Update group details
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> You must have admin rights to update a group.
**Parameters**
| Name | Type | Description |
|---------------------|-------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **groupId** | string | The identifier of a group. |
| **groupBodyUpdate** | [GroupBodyUpdate](#GroupBodyUpdate) | The group information to update. |
| opts.include | string[] | Returns additional information about the group. The following optional fields can be requested: `parentIds`, `zones` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [GroupEntry](#GroupEntry)
**Example**
```javascript
import { AlfrescoApi, GroupsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const groupsApi = new GroupsApi(alfrescoApi);
const groupBodyUpdate = {};
const opts = {};
groupsApi.updateGroup(`<groupId>`, groupBodyUpdate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## GroupMemberPaging
**Properties**
| Name | Type |
|------|-------------------------------------------------|
| list | [GroupMemberPagingList](#GroupMemberPagingList) |
## GroupMemberPagingList
**Properties**
| Name | Type |
|------------|-----------------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [GroupMemberEntry[]](#GroupMemberEntry) |
## GroupMemberEntry
**Properties**
| Name | Type |
|-------|-------------------------------|
| entry | [GroupMember](GroupMember.md) |
## GroupBodyCreate
**Properties**
| Name | Type |
|-------------|----------|
| id | string |
| displayName | string |
| parentIds | string[] |
## GroupMembershipBodyCreate
**Properties**
| Name | Type |
|------------|--------|
| id | string |
| memberType | string |
### GroupMembershipBodyCreate.MemberTypeEnum
* `GROUP` (value: `'GROUP'`)
* `PERSON` (value: `'PERSON'`)
## GroupBodyUpdate
**Properties**
| Name | Type |
|-------------|--------|
| displayName | string |
## GroupPaging
**Properties**
| Name | Type |
|------|-------------------------------------|
| list | [GroupPagingList](#GroupPagingList) |
## GroupPagingList
**Properties**
| Name | Type |
|------------|-----------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [GroupEntry[]](#GroupEntry) |
## GroupEntry
**Properties**
| Name | Type |
|-----------|-------------------|
| **entry** | [Group](Group.md) |

View File

@@ -0,0 +1,158 @@
# NetworksApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-------------------------------------------------|-------------------------------------------------|-------------------------|
| [getNetwork](#getNetwork) | **GET** /networks/{networkId} | Get a network |
| [getNetworkForPerson](#getNetworkForPerson) | **GET** /people/{personId}/networks/{networkId} | Get network information |
| [listNetworksForPerson](#listNetworksForPerson) | **GET** /people/{personId}/networks | List network membership |
## getNetwork
Get a network
**Parameters**
| Name | Type | Description |
|---------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **networkId** | string | The identifier of a network. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [PersonNetworkEntry](#PersonNetworkEntry)
**Example**
```javascript
import { AlfrescoApi, NetworksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const networksApi = new NetworksApi(alfrescoApi);
const opts = {};
networksApi.getNetwork(`<networkId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getNetworkForPerson
Get network information
You can use the `-me-` string in place of <personId> to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|---------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **networkId** | string | The identifier of a network. |
| fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [PersonNetworkEntry](#PersonNetworkEntry)
**Example**
```javascript
import { AlfrescoApi, NetworksApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const networksApi = new NetworksApi(alfrescoApi);
const opts = {};
networksApi.getNetworkForPerson(`<personId>`, `<networkId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listNetworksForPerson
List network membership
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **personId** | string | The identifier of a person. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [PersonNetworkPaging](#PersonNetworkPaging)
**Example**
```javascript
import { AlfrescoApi, NetworksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const networksApi = new NetworksApi(alfrescoApi);
const opts = {};
networksApi.listNetworksForPerson(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## PersonNetworkEntry
**Properties**
| Name | Type |
|-------|---------------------------------|
| entry | [PersonNetwork](#PersonNetwork) |
## PersonNetworkPaging
**Properties**
| Name | Type |
|------|-----------------------------------------------------|
| list | [PersonNetworkPagingList](#PersonNetworkPagingList) |
## PersonNetworkPagingList
**Properties**
| Name | Type |
|------------|---------------------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [PersonNetworkEntry[]](#PersonNetworkEntry) |
## PersonNetwork
**Properties**
| Name | Type | Description |
|-------------------|---------------------------------|---------------------------|
| **id** | string | This network's unique id |
| homeNetwork | boolean | Is this the home network? |
| **isEnabled** | boolean | |
| createdAt | Date | |
| paidNetwork | boolean | |
| subscriptionLevel | string | |
| quotas | [NetworkQuota[]](#NetworkQuota) | |
### PersonNetwork.SubscriptionLevelEnum
* `Free` (value: `'Free'`)
* `Standard` (value: `'Standard'`)
* `Enterprise` (value: `'Enterprise'`)
## NetworkQuota
**Properties**
| Name | Type |
|-----------|--------|
| **id** | string |
| **limit** | number |
| **usage** | number |

View File

@@ -0,0 +1,29 @@
# Node
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [default to null]
**name** | **string** | The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |.
The character . must not be used at the end of the name.
| [default to null]
**nodeType** | **string** | | [default to null]
**isFolder** | **boolean** | | [default to null]
**isFile** | **boolean** | | [default to null]
**isLocked** | **boolean** | | [optional] [default to null]
**modifiedAt** | [**Date**](Date.md) | | [default to null]
**modifiedByUser** | [**UserInfo**](UserInfo.md) | | [default to null]
**createdAt** | [**Date**](Date.md) | | [default to null]
**createdByUser** | [**UserInfo**](UserInfo.md) | | [default to null]
**parentId** | **string** | | [optional] [default to null]
**isLink** | **boolean** | | [optional] [default to null]
**isFavorite** | **boolean** | | [optional] [default to null]
**content** | [**ContentInfo**](ContentInfo.md) | | [optional] [default to null]
**aspectNames** | **string[]** | | [optional] [default to null]
**properties** | **any** | | [optional] [default to null]
**allowableOperations** | **string[]** | | [optional] [default to null]
**path** | [**PathInfo**](PathInfo.md) | | [optional] [default to null]
**permissions** | [**PermissionsInfo**](PermissionsInfo.md) | | [optional] [default to null]
**definition** | [**Definition**](Definition.md) | | [optional] [default to null]

View File

@@ -0,0 +1,8 @@
# NodeEntry
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**entry** | [**Node**](Node.md) | | [default to null]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
# Pagination
**Properties**
| Name | Type | Description |
|--------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| count | number | The number of objects in the entries array. |
| hasMoreItems | boolean | A boolean value which is **true** if there are more entities in the collection beyond those in this response. A true value means a request with a larger value for the **skipCount** or the **maxItems** parameter will return more entities. |
| totalItems | number | An integer describing the total number of entities in the collection. The API might not be able to determine this value, in which case this property will not be present. |
| skipCount | number | An integer describing how many entities exist in the collection before those included in this list. If there was no **skipCount** parameter then the default value is 0. |
| maxItems | number | The value of the **maxItems** parameter used to generate this list. If there was no **maxItems** parameter then the default value is 100. |

View File

@@ -0,0 +1,12 @@
# PathElement
**Properties**
| Name | Type |
|-------------|----------|
| id | string |
| name | string |
| nodeType | string |
| aspectNames | string[] |

View File

@@ -0,0 +1,11 @@
# PathInfo
**Properties**
| Name | Type |
|------------|---------------------------------|
| elements | [PathElement[]](PathElement.md) |
| name | string |
| isComplete | boolean |

View File

@@ -0,0 +1,457 @@
# PeopleApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------|----------------------------------------------------|------------------------|
| [createPerson](#createPerson) | **POST** /people | Create person |
| [deleteAvatarImage](#deleteAvatarImage) | **DELETE** /people/{personId}/avatar | Delete avatar image |
| [getAvatarImage](#getAvatarImage) | **GET** /people/{personId}/avatar | Get avatar image |
| [getPerson](#getPerson) | **GET** /people/{personId} | Get a person |
| [listPeople](#listPeople) | **GET** /people | List people |
| [requestPasswordReset](#requestPasswordReset) | **POST** /people/{personId}/request-password-reset | Request password reset |
| [resetPassword](#resetPassword) | **POST** /people/{personId}/reset-password | Reset password |
| [updateAvatarImage](#updateAvatarImage) | **PUT** /people/{personId}/avatar | Update avatar image |
| [updatePerson](#updatePerson) | **PUT** /people/{personId} | Update person |
## createPerson
Create person
> this endpoint is available in **Alfresco 5.2** and newer versions.
> You must have admin rights to create a person.
Create a person.
If applicable, the given person's login access can also be optionally disabled.
You can set custom properties when you create a person:
```json
{
"id": "abeecher",
"firstName": "Alice",
"lastName": "Beecher",
"displayName": "Alice Beecher",
"email": "abeecher@example.com",
"password": "secret",
"properties":
{
"my:property": "The value"
}
}
```
> setting properties of type d:content and d:category are not supported.
**Parameters**
| Name | Type | Description |
|----------------------|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personBodyCreate** | [PersonBodyCreate](#PersonBodyCreate) | The person details. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [PersonEntry](PersonEntry.md)
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const personBodyCreate = {};
const opts = {};
peopleApi.createPerson(personBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteAvatarImage
Deletes the avatar image related to person.
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must be the person or have admin rights to update a person's avatar.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|--------------|--------|-----------------------------|
| **personId** | string | The identifier of a person. |
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
peopleApi.deleteAvatarImage(`<personId>`).then(() => {
console.log('API called successfully.');
});
```
## getAvatarImage
Get avatar image
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
Gets the avatar image related to the person **personId**. If the person has no related avatar then
the **placeholder** query parameter can be optionally used to request a placeholder image to be returned.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| opts.attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| opts.ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, `Wed, 09 Mar 2016 16:56:34 GMT`. |
| opts.placeholder | boolean | If **true** (default) and there is no avatar for this **personId** then the placeholder image is returned, rather than a 404 response. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const opts = {};
peopleApi.getAvatarImage(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getPerson
Gets information for the person
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [PersonEntry](PersonEntry.md)
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const opts = {};
peopleApi.getPerson(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listPeople
List people
> this endpoint is available in **Alfresco 5.2** and newer versions.
You can use the **include** parameter to return any additional information.
The default sort order for the returned list is for people to be sorted by ascending id.
You can override the default by using the **orderBy** parameter.
You can use any of the following fields to order the results:
* id
* firstName
* lastName
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. | |
| opts.include | string[] | Returns additional information about the person. The following optional fields can be requested: `properties`, `aspectNames`, `capabilities` | |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [PersonPaging](PersonPaging.md)
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const opts = {};
peopleApi.listPeople(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## requestPasswordReset
Request password reset
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> No authentication is required to call this endpoint.
Initiates the reset password workflow to send an email with reset password instruction to the user's registered email.
The client is mandatory in the request body. For example:
```json
{
"client": "myClient"
}
```
**Note:** The client must be registered before this API can send an email. See [server documentation]. However, out-of-the-box
share is registered as a default client, so you could pass **share** as the client name:
```json
{
"client": "share"
}
```
**Parameters**
| Name | Type | Description |
|----------------|---------------------------|------------------------------------------------------|
| **personId** | **string** | The identifier of a person. |
| **clientBody** | [ClientBody](#ClientBody) | The client name to send email with app-specific url. |
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const clientBody = {};
peopleApi.requestPasswordReset(`<personId>`, clientBody).then(() => {
console.log('API called successfully.');
});
```
## resetPassword
Resets user's password
> this endpoint is available in **Alfresco 5.2.1** and newer versions.
> No authentication is required to call this endpoint.
The password, id and key properties are mandatory in the request body. For example:
```json
{
"password":"newPassword",
"id":"activiti$10",
"key":"4dad6d00-0daf-413a-b200-f64af4e12345"
}
```
**Parameters**
| Name | Type | Description |
|-----------------------|-----------------------------------------|-----------------------------|
| **personId** | string | The identifier of a person. |
| **passwordResetBody** | [PasswordResetBody](#PasswordResetBody) | The reset password details |
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const passwordResetBody = {};
peopleApi.resetPassword(`<personId>`, passwordResetBody).then(() => {
console.log('API called successfully.');
});
```
## updateAvatarImage
Updates the avatar image related to the person
> this endpoint is available in **Alfresco 5.2.2** and newer versions.
> You must be the person or have admin rights to update a person's avatar.
The request body should be the binary stream for the avatar image. The content type of the file
should be an image file. This will be used to generate an "avatar" thumbnail rendition.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
**Parameters**
| Name | Type | Description |
|-----------------------|--------|-----------------------------|
| **personId** | string | The identifier of a person. |
| **contentBodyUpdate** | string | The binary content |
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const contentBodyUpdate = {};
peopleApi.updateAvatarImage(`<personId>`, contentBodyUpdate).then(() => {
console.log('API called successfully.');
});
```
## updatePerson
Update the given person's details.
> this endpoint is available in **Alfresco 5.2** and newer versions.
> You must have admin rights to update a person — unless updating your own details.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
If applicable, the given person's login access can also be optionally disabled or re-enabled.
If you are changing your password, as a non-admin user, then the existing password must also
be supplied (using the oldPassword field in addition to the new password value).
Admin users cannot be disabled by setting enabled to false.
Non-admin users may not disable themselves.
You can set custom properties when you update a person:
```json
{
"firstName": "Alice",
"properties":
{
"my:property": "The value"
}
}
```
> setting properties of type d:content and d:category are not supported.
**Parameters**
| Name | Type | Description |
|----------------------|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **personBodyUpdate** | [PersonBodyUpdate](#PersonBodyUpdate) | The person details. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [PersonEntry](PersonEntry.md)
**Example**
```javascript
import { AlfrescoApi, PeopleApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const peopleApi = new PeopleApi(alfrescoApi);
const personBodyUpdate = {};
const opts = {};
peopleApi.updatePerson(`<personId>`, personBodyUpdate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## PersonBodyCreate
**Properties**
| Name | Type | Description |
|---------------------------|-----------------------|-------------|
| **id** | string | |
| **firstName** | string | |
| lastName | string | |
| description | string | |
| **email** | string | |
| skypeId | string | |
| googleId | string | |
| instantMessageId | string | |
| jobTitle | string | |
| location | string | |
| company | [Company](Company.md) | |
| mobile | string | |
| telephone | string | |
| userStatus | string | |
| enabled | boolean | |
| emailNotificationsEnabled | boolean | |
| **password** | string | |
| aspectNames | string[] | |
| properties | any | |
## PersonBodyUpdate
**Properties**
| Name | Type |
|---------------------------|-----------------------|
| firstName | string |
| lastName | string |
| description | string |
| email | string |
| skypeId | string |
| googleId | string |
| instantMessageId | string |
| jobTitle | string |
| location | string |
| company | [Company](Company.md) |
| mobile | string |
| telephone | string |
| userStatus | string |
| enabled | boolean |
| emailNotificationsEnabled | boolean |
| password | string |
| oldPassword | string |
| aspectNames | string[] |
| properties | any |
## ClientBody
**Properties**
| Name | Type | Description |
|--------|--------|-----------------|
| client | string | the client name |
## PasswordResetBody
**Properties**
| Name | Type | Description |
|--------------|--------|-------------------------------------------------------|
| **password** | string | the new password |
| **id** | string | the workflow id provided in the reset password email |
| **key** | string | the workflow key provided in the reset password email |

View File

@@ -0,0 +1,14 @@
# PermissionElement
**Properties**
| Name | Type |
|--------------|--------|
| authorityId | string |
| name | string |
| accessStatus | string |
## PermissionElement.AccessStatusEnum
* `ALLOWED` (value: `'ALLOWED'`)
* `DENIED` (value: `'DENIED'`)

View File

@@ -0,0 +1,12 @@
# PermissionsInfo
**Properties**
| Name | Type |
|----------------------|---------------------------------------------|
| isInheritanceEnabled | boolean |
| inherited | [PermissionElement[]](PermissionElement.md) |
| locallySet | [PermissionElement[]](PermissionElement.md) |
| settable | string[] |

View File

@@ -0,0 +1,39 @@
# Person
**Properties**
| Name | Type |
|---------------------------|-------------------------------|
| **id** | string |
| **firstName** | string |
| lastName | string |
| displayName | string |
| description | string |
| avatarId | string |
| **email** | string |
| skypeId | string |
| googleId | string |
| instantMessageId | string |
| jobTitle | string |
| location | string |
| company | [Company](Company.md) |
| mobile | string |
| telephone | string |
| statusUpdatedAt | Date |
| userStatus | string |
| **enabled** | boolean |
| emailNotificationsEnabled | boolean |
| aspectNames | string[] |
| properties | Map<string, string> |
| capabilities | [Capabilities](#Capabilities) |
## Capabilities
**Properties**
| Name | Type |
|-----------|---------|
| isAdmin | boolean |
| isGuest | boolean |
| isMutable | boolean |

View File

@@ -0,0 +1,9 @@
# PersonEntry
**Properties**
| Name | Type |
|-----------|---------------------|
| **entry** | [Person](Person.md) |

View File

@@ -0,0 +1,18 @@
# PersonPaging
**Properties**
| Name | Type |
|------|---------------------------------------|
| list | [PersonPagingList](#PersonPagingList) |
# PersonPagingList
**Properties**
| Name | Type |
|------------|---------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [PersonEntry[]](PersonEntry.md) |

View File

@@ -0,0 +1,108 @@
# PreferencesApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-------------------------------------|---------------------------------------------------------|------------------|
| [getPreference](#getPreference) | **GET** /people/{personId}/preferences/{preferenceName} | Get a preference |
| [listPreferences](#listPreferences) | **GET** /people/{personId}/preferences | List preferences |
## getPreference
Get a preference
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
### Parameters
| Name | Type | Description |
|--------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **personId** | string | The identifier of a person. |
| **preferenceName** | string | The name of the preference. |
| opts.fields | string | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [PreferenceEntry](#PreferenceEntry)
**Example**
```javascript
import { AlfrescoApi, PreferencesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const preferencesApi = new PreferencesApi(alfrescoApi);
const opts = {};
preferencesApi.getPreference(`<personId>`, `<preferenceName>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listPreferences
Gets a list of preferences for person.
You can use the `-me-` string in place of `<personId>` to specify the currently authenticated user.
Note that each preference consists of an **id** and a **value**.
The **value** can be of any JSON type.
### Parameters
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **personId** | string | The identifier of a person. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [PreferencePaging](#PreferencePaging)
**Example**
```javascript
import { AlfrescoApi, PreferencesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const preferencesApi = new PreferencesApi(alfrescoApi);
const opts = {};
preferencesApi.listPreferences(`<personId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## PreferencePaging
**Properties**
| Name | Type |
|------|-----------------------------------------------|
| list | [PreferencePagingList](#PreferencePagingList) |
## PreferencePagingList
**Properties**
| Name | Type |
|----------------|---------------------------------------|
| **pagination** | [Pagination](Pagination.md) |
| **entries** | [PreferenceEntry[]](#PreferenceEntry) |
## PreferenceEntry
**Properties**
| Name | Type |
|-----------|---------------------------|
| **entry** | [Preference](#Preference) |
# Preference
**Properties**
| Name | Type | Description |
|--------|--------|----------------------------------------------------------------------|
| **id** | string | The unique id of the preference |
| value | string | The value of the preference. Note that this can be of any JSON type. |

View File

@@ -0,0 +1,61 @@
# ProbesApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------|---------------------------|------------------------------------------------|
| [getProbe](#getProbe) | **GET** /probes/{probeId} | Check readiness and liveness of the repository |
## getProbe
Check readiness and liveness of the repository
> No authentication is required to call this endpoint.
> This endpoint is available in **Alfresco 6.0** and newer versions.
Returns a status of `200` to indicate success and `503` for failure.
The readiness probe is normally only used to check repository startup.
The liveness probe should then be used to check the repository is still responding to requests.
**Parameters**
| Name | Type | Description |
|-------------|--------|--------------------------------------------|
| **probeId** | string | The name of the probe: `-ready-`, `-live-` |
**Return type**: [ProbeEntry](#ProbeEntry)
**Example**
```javascript
import { AlfrescoApi, ProbesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const probesApi = new ProbesApi(alfrescoApi);
probesApi.getProbe(`<probeId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## ProbeEntry
**Properties**
| Name | Type |
|-------|-------------------------------------|
| entry | [ProbeEntryEntry](#ProbeEntryEntry) |
## ProbeEntryEntry
**Properties**
| Name | Type |
|-------------|--------|
| **message** | string |

View File

@@ -0,0 +1,31 @@
# Property
**Properties**
| Name | Type | Description |
|---------------------|-----------------------------|------------------------------------------------------------|
| **id** | string | |
| title | string | the human-readable title |
| description | string | the human-readable description |
| defaultValue | string | the default value |
| dataType | string | the name of the property type (i.g. d:text) |
| isMultiValued | boolean | define if the property is multi-valued |
| isMandatory | boolean | define if the property is mandatory |
| isMandatoryEnforced | boolean | define if the presence of mandatory properties is enforced |
| isProtected | boolean | define if the property is system maintained |
| constraints | [Constraint[]](#Constraint) | list of constraints defined for the property |
## Constraint
**Properties**
| Name | Type | Description |
|-------------|------------------|-------------------------------------------|
| **id** | string | |
| type | string | the type of the constraint |
| title | string | the human-readable constraint title |
| description | string | the human-readable constraint description |
| parameters | Map<string, any> | |

View File

@@ -0,0 +1,182 @@
# QueriesApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|---------------------------|-------------------------|-------------|
| [findNodes](#findNodes) | **GET** /queries/nodes | Find nodes |
| [findPeople](#findPeople) | **GET** /queries/people | Find people |
| [findSites](#findSites) | **GET** /queries/sites | Find sites |
## findNodes
Find nodes
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets a list of nodes that match the given search criteria.
The search term is used to look for nodes that match against name, title, description, full text content or tags.
The search term:
- must contain a minimum of 3 alphanumeric characters
- allows "quoted term"
- can optionally use `*` for wildcard matching
By default, file and folder types will be searched unless a specific type is provided as a query parameter.
By default, the search will be across the repository unless a specific root node id is provided to start the search from.
You can sort the result list using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter:
* name
* modifiedAt
* createdAt
**Parameters**
| Name | Type | Description |
|-----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **term** | string | The term to search for. |
| opts.rootNodeId | string | The id of the node to start the search from. Supports the aliases `-my-`, `-root-` and `-shared-`. |
| opts.skipCount | number | Default: 0. The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. |
| opts.maxItems | number | Default: 100. The maximum number of items to return in the list. If not supplied then the default value is 100. |
| opts.nodeType | string | Restrict the returned results to only those of the given node type and its sub-types |
| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `aspectNames`, `isLink`, `isFavorite`, `isLocked`, `path`, `properties` |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [NodePaging](#NodePaging)
**Example**
```javascript
import { AlfrescoApi, QueriesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const queriesApi = new QueriesApi(alfrescoApi);
const opts = {};
queriesApi.findNodes(`<term>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## findPeople
Find people
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets a list of people that match the given search criteria.
The search term is used to look for matches against person id, firstname and lastname.
The search term:
- must contain a minimum of 2 alphanumeric characters
- can optionally use '*' for wildcard matching within the term
You can sort the result list using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter:
* id
* firstName
* lastName
**Parameters**
| Name | Type | Description |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **term** | string | The term to search for. |
| opts.skipCount | number | Default 0. The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. |
| opts.maxItems | number | Default 100. The maximum number of items to return in the list. If not supplied then the default value is 100. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. |
**Return type**: [PersonPaging](PersonPaging.md)
**Example**
```javascript
import { AlfrescoApi, QueriesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const queriesApi = new QueriesApi(alfrescoApi);
const opts = {};
queriesApi.findPeople(`<term>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## findSites
Find sites
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets a list of sites that match the given search criteria.
The search term is used to look for sites that match against site id, title or description.
The search term:
- must contain a minimum of 2 alphanumeric characters
- can optionally use '*' for wildcard matching within the term
The default sort order for the returned list is for sites to be sorted by ascending id.
You can override the default by using the **orderBy** parameter. You can specify one or more of the following fields in the **orderBy** parameter:
* id
* title
* description
**Parameters**
| Name | Type | Description |
|----------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **term** | string | The term to search for. |
| opts.skipCount | number | Default 0. The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. |
| opts.maxItems | number | Default 100. The maximum number of items to return in the list. If not supplied then the default value is 100. |
| opts.orderBy | string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [SitePaging](SitePaging.md)
**Example**
```javascript
import { AlfrescoApi, QueriesApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const queriesApi = new QueriesApi(alfrescoApi);
const opts = {};
queriesApi.findSites(`<term>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## NodePaging
**Properties**
| Name | Type |
|------|-----------------------------------|
| list | [NodePagingList](#NodePagingList) |
## NodePagingList
**Properties**
| Name | Type |
|------------|-----------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [NodeEntry[]](NodeEntry.md) |
| source | [Node](Node.md) |

View File

@@ -0,0 +1,181 @@
# RatingsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-------------------------------|-----------------------------------------------|-----------------|
| [createRating](#createRating) | **POST** /nodes/{nodeId}/ratings | Create a rating |
| [deleteRating](#deleteRating) | **DELETE** /nodes/{nodeId}/ratings/{ratingId} | Delete a rating |
| [getRating](#getRating) | **GET** /nodes/{nodeId}/ratings/{ratingId} | Get a rating |
| [listRatings](#listRatings) | **GET** /nodes/{nodeId}/ratings | List ratings |
## createRating
Create a rating
**Parameters**
| Name | Type | Description |
|----------------------|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **ratingBodyCreate** | [RatingBody](#RatingBody) | For "myRating" the type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar. For example, to "like" a file the following body would be used: `{ "id": "likes", "myRating": true }` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [RatingEntry](#RatingEntry)
**Example**
```javascript
import { AlfrescoApi, RatingsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const ratingsApi = new RatingsApi(alfrescoApi);
const ratingBodyCreate = {};
const opts = {};
ratingsApi.createRating(`<nodeId>`, ratingBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteRating
Delete a rating
**Parameters**
| Name | Type | Description | Notes |
|--------------|--------|-----------------------------|-------|
| **nodeId** | string | The identifier of a node. | |
| **ratingId** | string | The identifier of a rating. | |
**Example**
```javascript
import { AlfrescoApi, RatingsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const ratingsApi = new RatingsApi(alfrescoApi);
ratingsApi.deleteRating(`<nodeId>`, `<ratingId>`).then(() => {
console.log('API called successfully.');
});
```
## getRating
Get a rating
**Parameters**
| Name | Type | Description |
|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **ratingId** | string | The identifier of a rating. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [RatingEntry](#RatingEntry)
**Example**
```javascript
import { AlfrescoApi, RatingsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const ratingsApi = new RatingsApi(alfrescoApi);
const opts = {};
ratingsApi.getRating(`<nodeId>`, `<ratingId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listRatings
List ratings
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **nodeId** | string | The identifier of a node. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [RatingPaging](#RatingPaging)
**Example**
```javascript
import { AlfrescoApi, RatingsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const ratingsApi = new RatingsApi(alfrescoApi);
const opts = {};
ratingsApi.listRatings(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## RatingPaging
**Properties**
| Name | Type |
|------|---------------------------------------|
| list | [RatingPagingList](#RatingPagingList) |
## RatingPagingList
**Properties**
| Name | Type |
|----------------|-------------------------------|
| **pagination** | [Pagination](Pagination.md) |
| **entries** | [RatingEntry[]](#RatingEntry) |
## RatingEntry
**Properties**
| Name | Type |
|-----------|-------------------|
| **entry** | [Rating](#Rating) |
## Rating
**Properties**
| Name | Type | Description |
|-----------|-------------------------------------|---------------------------------------------------------------------------------------------------------------|
| **id** | string | |
| aggregate | [RatingAggregate](#RatingAggregate) | |
| ratedAt | Date | |
| myRating | string | The rating. The type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar. |
## RatingAggregate
**Properties**
| Name | Type |
|---------------------|--------|
| **numberOfRatings** | number |
| average | number |
## RatingBody
**Properties**
| Name | Type | Description |
|--------------|--------|--------------------------------------------------------------------------------------------------------------|
| **id** | string | The rating scheme type. Possible values are likes and fiveStar. |
| **myRating** | string | The rating. The type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar |
### RatingBody.IdEnum
* `Likes` (value: `'likes'`)
* `FiveStar` (value: `'fiveStar'`)

View File

@@ -0,0 +1,21 @@
# Rendition
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [optional] [default to null]
**content** | [**ContentInfo**](ContentInfo.md) | | [optional] [default to null]
**status** | **string** | | [optional] [default to null]
<a name="Rendition.StatusEnum"></a>
## Enum: Rendition.StatusEnum
* `CREATED` (value: `'CREATED'`)
* `NOTCREATED` (value: `'NOT_CREATED'`)

View File

@@ -0,0 +1,9 @@
# RenditionBodyCreate
**Properties**
| Name | Type |
|--------|--------|
| **id** | string |

View File

@@ -0,0 +1,9 @@
# RenditionEntry
**Properties**
| Name | Type |
|-----------|---------------------------|
| **entry** | [Rendition](Rendition.md) |

View File

@@ -0,0 +1,18 @@
# RenditionPaging
**Properties**
| Name | Type |
|------|---------------------------------------------|
| list | [RenditionPagingList](#RenditionPagingList) |
# RenditionPagingList
**Properties**
| Name | Type |
|------------|---------------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [RenditionEntry[]](RenditionEntry.md) |

View File

@@ -0,0 +1,192 @@
# RenditionsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|---------------------------------------------------|-----------------------------------------------------------------------------|----------------------------------------------------------------------|
| [createRendition](#createRendition) | **POST** /nodes/{nodeId}/renditions | Create rendition |
| [getRendition](#getRendition) | **GET** /nodes/{nodeId}/renditions/{renditionId} | Get rendition information |
| [getRenditionContent](#getRenditionContent) | **GET** /nodes/{nodeId}/renditions/{renditionId}/content | Get rendition content |
| [listRenditions](#listRenditions) | **GET** /nodes/{nodeId}/renditions | List renditions |
| [requestDirectAccessUrl](#requestDirectAccessUrl) | **POST** /nodes/{nodeId}/renditions/{renditionId}/request-direct-access-url | Generate a direct access content url for a given rendition of a node |
## createRendition
Create rendition
> this endpoint is available in **Alfresco 5.2** and newer versions.
An asynchronous request to create a rendition for file **nodeId**.
The rendition is specified by name **id** in the request body:
```json
{
"id": "doclib"
}
```
Multiple names may be specified as a comma separated list or using a list format:
```json
[
{
"id": "doclib"
},
{
"id": "avatar"
}
]
```
**Parameters**
| Name | Type | Description |
|-------------------------|-----------------------------------------------|---------------------------|
| **nodeId** | string | The identifier of a node. |
| **renditionBodyCreate** | [RenditionBodyCreate](RenditionBodyCreate.md) | The rendition "id". |
**Example**
```javascript
import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const renditionsApi = new RenditionsApi(alfrescoApi);
const renditionBodyCreate = {};
renditionsApi.createRendition(`<nodeId>`, renditionBodyCreate).then(() => {
console.log('API called successfully.');
});
```
## getRendition
Get rendition information
> **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
**Parameters**
| Name | Type | Description |
|-----------------|--------|--------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
**Return type**: [RenditionEntry](RenditionEntry.md)
**Example**
```javascript
import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const renditionsApi = new RenditionsApi(alfrescoApi);
renditionsApi.getRendition(`<nodeId>`, `<renditionId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getRenditionContent
Get rendition content
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
| opts.attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| opts.ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, `Wed, 09 Mar 2016 16:56:34 GMT`. |
| opts.range | string | Default: true. The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
| opts.placeholder | boolean | Default: false. If **true** and there is no rendition for this **nodeId** and **renditionId**, then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const renditionsApi = new RenditionsApi(alfrescoApi);
const opts = {};
renditionsApi.getRenditionContent(`<nodeId>`, `<renditionId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listRenditions
List renditions
**Note:** this endpoint is available in Alfresco 5.2 and newer versions.
Gets a list of the rendition information for each rendition of the file **nodeId**, including the rendition id.
Each rendition returned has a **status**: `CREATED` means it is available to view or download, `NOT_CREATED` means the rendition can be requested.
You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where**
clause will return just the `CREATED` renditions:
```text
(status='CREATED')
```
**Parameters**
| Name | Type | Description |
|------------|--------|-----------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| where | string | A string to restrict the returned objects by using a predicate. |
**Return type**: [RenditionPaging](RenditionPaging.md)
**Example**
```javascript
import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const renditionsApi = new RenditionsApi(alfrescoApi);
renditionsApi.listRenditions(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## requestDirectAccessUrl
Generate a direct access content url for a given rendition of a node
> this endpoint is available in **Alfresco 7.1** and newer versions.
**Parameters**
| Name | Type | Description |
|-----------------|--------|--------------------------------|
| **nodeId** | string | The identifier of a node. |
| **renditionId** | string | The identifier of a rendition. |
**Return type**: [DirectAccessUrlEntry](DirectAccessUrlEntry.md)
**Example**
```javascript
import { AlfrescoApi, RenditionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const renditionsApi = new RenditionsApi(alfrescoApi);
const nodeId = 'da2e6953-3850-408b-8284-3534dd777417';
const renditionId = 'avatar';
renditionsApi.requestDirectAccessUrl(nodeId, renditionId).then((data) => {
console.log('URL generated successfully: ', data.contentUrl);
});
```

View File

@@ -0,0 +1,457 @@
# SharedlinksApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------------------|-------------------------------------------------------------------|---------------------------------------|
| [createSharedLink](#createSharedLink) | **POST** /shared-links | Create a shared link to a file |
| [deleteSharedLink](#deleteSharedLink) | **DELETE** /shared-links/{sharedId} | Deletes a shared link |
| [emailSharedLink](#emailSharedLink) | **POST** /shared-links/{sharedId}/email | Email shared link |
| [getSharedLink](#getSharedLink) | **GET** /shared-links/{sharedId} | Get a shared link |
| [getSharedLinkContent](#getSharedLinkContent) | **GET** /shared-links/{sharedId}/content | Get shared link content |
| [getSharedLinkRendition](#getSharedLinkRendition) | **GET** /shared-links/{sharedId}/renditions/{renditionId} | Get shared link rendition information |
| [getSharedLinkRenditionContent](#getSharedLinkRenditionContent) | **GET** /shared-links/{sharedId}/renditions/{renditionId}/content | Get shared link rendition content |
| [listSharedLinkRenditions](#listSharedLinkRenditions) | **GET** /shared-links/{sharedId}/renditions | List renditions for a shared link |
| [listSharedLinks](#listSharedLinks) | **GET** /shared-links | List shared links |
## createSharedLink
Create a shared link to a file
> this endpoint is available in **Alfresco 5.2** and newer versions.
Create a shared link to the file **nodeId** in the request body. Also, an optional expiry date could be set,
so the shared link would become invalid when the expiry date is reached. For example:
```json
{
"nodeId": "1ff9da1a-ee2f-4b9c-8c34-3333333333",
"expiresAt": "2017-03-23T23:00:00.000+0000"
}
```
**Note:** You can create shared links to more than one file
specifying a list of **nodeId**s in the JSON body like this:
```json
[
{
"nodeId": "1ff9da1a-ee2f-4b9c-8c34-4444444444"
},
{
"nodeId": "1ff9da1a-ee2f-4b9c-8c34-5555555555"
}
]
```
If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example:
```json
{
"list": {
"pagination": {
"count": 2,
"hasMoreItems": false,
"totalItems": 2,
"skipCount": 0,
"maxItems": 100
},
"entries": [
{
"entry": {
}
},
{
"entry": {
}
}
]
}
}
```
**Parameters**
| Name | Type | Description |
|--------------------------|-----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **sharedLinkBodyCreate** | [SharedLinkBodyCreate](#SharedLinkBodyCreate) | The nodeId to create a shared link for. |
| opts.include | string[] | Returns additional information about the shared link, the following optional fields can be requested: `allowableOperations`, `path`, `properties`, `isFavorite`, `aspectNames` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [SharedLinkEntry](#SharedLinkEntry)
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
const sharedLinkBodyCreate = {};
const opts = {};
sharedlinksApi.createSharedLink(sharedLinkBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteSharedLink
Deletes a shared link
> this endpoint is available in Alfresco 5.2 and newer versions.
**Parameters**
| Name | Type | Description |
|--------------|--------|--------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
sharedlinksApi.deleteSharedLink(`<sharedId>`).then(() => {
console.log('API called successfully.');
});
```
## emailSharedLink
Email shared link
> this endpoint is available in **Alfresco 5.2** and newer versions.
Sends email with app-specific url including identifier **sharedId**.
The client and recipientEmails properties are mandatory in the request body. For example, to email a shared link with minimum info:
```json
{
"client": "myClient",
"recipientEmails": ["john.doe@acme.com", "joe.bloggs@acme.com"]
}
```
A plain text message property can be optionally provided in the request body to customise the email being sent.
Also, a locale property can be optionally provided in the request body to send the emails in a particular language (if the locale is supported by Alfresco).
For example, to email a shared link with a messages and a locale:
```json
{
"client": "myClient",
"recipientEmails": ["john.doe@acme.com", "joe.bloggs@acme.com"],
"message": "myMessage",
"locale":"en-GB"
}
```
>The client must be registered before you can send a shared link email. See [server documentation]. However, out-of-the-box
share is registered as a default client, so you could pass **share** as the client name:
```json
{
"client": "share",
"recipientEmails": ["john.doe@acme.com"]
}
```
**Parameters**
| Name | Type | Description |
|-------------------------|---------------------------------------------|--------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
| **sharedLinkBodyEmail** | [SharedLinkBodyEmail](#SharedLinkBodyEmail) | The shared link email to send. |
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
const sharedLinkBodyEmail = {};
sharedlinksApi.emailSharedLink(`<sharedId>`, sharedLinkBodyEmail).then(() => {
console.log('API called successfully.');
});
```
## getSharedLink
Get a shared link
> this endpoint is available in **Alfresco 5.2** and newer versions.
> No authentication is required to call this endpoint.
Gets minimal information for the file with shared link identifier **sharedId**.
**Parameters**
| Name | Type | Description |
|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [SharedLinkEntry](#SharedLinkEntry)
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
const opts = {};
sharedlinksApi.getSharedLink(`<sharedId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getSharedLinkContent
Get shared link content
> this endpoint is available in **Alfresco 5.2** and newer versions.
> No authentication is required to call this endpoint.
Gets the content of the file with shared link identifier **sharedId**.
**Parameters**
| Name | Type | Description |
|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
| opts.attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| opts.ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. |
| opts.range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
const opts = {};
sharedlinksApi.getSharedLinkContent(`<sharedId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getSharedLinkRendition
Get shared link rendition information
> this endpoint is available in **Alfresco 5.2** and newer versions.
> No authentication is required to call this endpoint.
Gets rendition information for the file with shared link identifier **sharedId**.
This API method returns rendition information where the rendition status is CREATED,
which means the rendition is available to view/download.
**Parameters**
| Name | Type | Description |
|-----------------|--------|--------------------------------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
| **renditionId** | string | The name of a thumbnail rendition, for example `doclib`, or `pdf`. |
**Return type**: [RenditionEntry](RenditionEntry.md)
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
sharedlinksApi.getSharedLinkRendition(`<sharedId>`, `<renditionId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getSharedLinkRenditionContent
Get shared link rendition content
> this endpoint is available in **Alfresco 5.2** and newer versions.
> No authentication is required to call this endpoint.
Gets the rendition content for file with shared link identifier **sharedId**.
**Parameters**
| Name | Type | Description |
|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
| opts.attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| opts.ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. |
| opts.range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
const opts = {};
sharedlinksApi.getSharedLinkRenditionContent(`<sharedId>`, `<renditionId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listSharedLinkRenditions
List renditions for a shared link
> this endpoint is available in **Alfresco 5.2** and newer versions.
> No authentication is required to call this endpoint.
Gets a list of the rendition information for the file with shared link identifier **sharedId**.
This API method returns rendition information, including the rendition id, for each rendition
where the rendition status is `CREATED`, which means the rendition is available to view/download.
**Parameters**
| Name | Type | Description |
|--------------|--------|--------------------------------------------|
| **sharedId** | string | The identifier of a shared link to a file. |
**Return type**: [RenditionPaging](RenditionPaging.md)
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
sharedlinksApi.listSharedLinkRenditions(`<sharedId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listSharedLinks
List shared links
> this endpoint is available in Alfresco 5.2 and newer versions.
Get a list of links that the current user has read permission on source node.
The list is ordered in descending modified order.
> The list of links is eventually consistent so newly created shared links may not appear immediately.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.where | string | Optionally filter the list by "sharedByUser" userid of person who shared the link (can also use -me-)`where=(sharedByUser='jbloggs')`, `where=(sharedByUser='-me-')` | |
| opts.include | string[] | Returns additional information about the shared link, the following optional fields can be requested: `allowableOperations`, `path`, `properties`, `isFavorite`, `aspectNames` | |
| opts.fields | string[] | A list of field names.You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [SharedLinkPaging](#SharedLinkPaging)
**Example**
```javascript
import { AlfrescoApi, SharedlinksApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const sharedlinksApi = new SharedlinksApi(alfrescoApi);
const opts = {};
sharedlinksApi.listSharedLinks(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## SharedLinkPaging
**Properties**
| Name | Type |
|------|-----------------------------------------------|
| list | [SharedLinkPagingList](#SharedLinkPagingList) |
## SharedLinkPagingList
**Properties**
| Name | Type |
|----------------|---------------------------------------|
| **pagination** | [Pagination](Pagination.md) |
| **entries** | [SharedLinkEntry[]](#SharedLinkEntry) |
## SharedLinkEntry
**Properties**
| Name | Type |
|-----------|---------------------------|
| **entry** | [SharedLink](#SharedLink) |
## SharedLinkBodyEmail
**Properties**
| Name | Type |
|-----------------|----------|
| client | string |
| message | string |
| locale | string |
| recipientEmails | string[] |
## SharedLinkBodyCreate
**Properties**
| Name | Type |
|------------|--------|
| **nodeId** | string |
| expiresAt | Date |
## SharedLink
**Properties**
| Name | Type | Description |
|-----------------------------|-------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| id | string | |
| expiresAt | Date | |
| nodeId | string | |
| name | string | The name must not contain spaces or the following special characters: `* " < > \\ / ? :` and `\|`. The character . must not be used at the end of the name. |
| title | string | |
| description | string | |
| modifiedAt | Date | |
| modifiedByUser | [UserInfo](UserInfo.md) | |
| sharedByUser | [UserInfo](UserInfo.md) | |
| content | [ContentInfo](ContentInfo.md) | |
| allowableOperations | string[] | The allowable operations for the Quickshare link itself. See allowableOperationsOnTarget for the allowable operations pertaining to the linked content node. |
| allowableOperationsOnTarget | string[] | The allowable operations for the content node being shared. |
| isFavorite | boolean | |
| properties | any | A subset of the target node's properties, system properties and properties already available in the SharedLink are excluded. |
| aspectNames | string[] | |

View File

@@ -0,0 +1,42 @@
# Site
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | | [default to null]
**guid** | **string** | | [default to null]
**title** | **string** | | [default to null]
**description** | **string** | | [optional] [default to null]
**visibility** | **string** | | [default to null]
**preset** | **string** | | [optional] [default to null]
**role** | **string** | | [optional] [default to null]
<a name="Site.VisibilityEnum"></a>
## Enum: Site.VisibilityEnum
* `PRIVATE` (value: `'PRIVATE'`)
* `MODERATED` (value: `'MODERATED'`)
* `PUBLIC` (value: `'PUBLIC'`)
<a name="Site.RoleEnum"></a>
## Enum: Site.RoleEnum
* `SiteConsumer` (value: `'SiteConsumer'`)
* `SiteCollaborator` (value: `'SiteCollaborator'`)
* `SiteContributor` (value: `'SiteContributor'`)
* `SiteManager` (value: `'SiteManager'`)

View File

@@ -0,0 +1,7 @@
# SiteEntry
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
| **entry** | [**Site**](Site.md) | | [default to null] |
| **relations** | [**SiteEntryRelations**]() | | [default to undefined] |

View File

@@ -0,0 +1,7 @@
# SiteEntryRelations
**Properties**
| Name | Type |
|----------------|-----------------------------|
| **members** | [SiteMemberPaging](SiteMemberPaging.md) |

View File

@@ -0,0 +1,18 @@
# SitePaging
**Properties**
| Name | Type |
|------|-----------------------------------|
| list | [SitePagingList](#SitePagingList) |
# SitePagingList
**Properties**
| Name | Type |
|----------------|-----------------------------|
| **pagination** | [Pagination](Pagination.md) |
| **entries** | [SiteEntry[]](SiteEntry.md) |

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,361 @@
# TagsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| [createTagForNode](#createTagForNode) | **POST** /nodes/{nodeId}/tags | Create a tag for a node |
| [deleteTagFromNode](#deleteTagFromNode) | **DELETE** /nodes/{nodeId}/tags/{tagId} | Delete a tag from a node |
| [getTag](#getTag) | **GET** /tags/{tagId} | Get a tag |
| [listTags](#listTags) | **GET** /tags | List tags |
| [listTagsForNode](#listTagsForNode) | **GET** /nodes/{nodeId}/tags | List tags for a node |
| [updateTag](#updateTag) | **PUT** /tags/{tagId} | Update a tag |
| [deleteTag](#deleteTag) | **DELETE** /tags/{tagId} | Completely deletes a tag |
| [createTags](#createTags) | **POST** /tags | Create list of tags |
| [assignTagsToNode](#assignTagsToNode) | **POST** /nodes/{nodeId}/tags | Assign tags to node. If tag is new then tag is also created additionally, if tag already exists then it is just assigned. |
## createTagForNode
Creates a tag on the node **nodeId**. You specify the tag in a JSON body like this:
```json
{
"tag":"test-tag-1"
}
```
**Note:** You can create more than one tag by
specifying a list of tags in the JSON body like this:
```json
[
{
"tag": "test-tag-1"
},
{
"tag": "test-tag-2"
}
]
```
If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example:
```json
{
"list": {
"pagination": {
"count": 2,
"hasMoreItems": false,
"totalItems": 2,
"skipCount": 0,
"maxItems": 100
},
"entries": [
{
"entry": {
}
},
{
"entry": {
}
}
]
}
}
```
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const tagBodyCreate = {};
const opts = {};
tagsApi.createTagForNode(nodeId, tagBodyCreate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
**Parameters**
| Name | Type | Description |
|-------------------|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **tagBodyCreate** | [TagBody](#TagBody) | The new tag |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [TagEntry](#TagEntry)
## deleteTagFromNode
Delete a tag from a node
**Parameters**
| Name | Type | Description |
|------------|--------|---------------------------|
| **nodeId** | string | The identifier of a node. |
| **tagId** | string | The identifier of a tag. |
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
tagsApi.deleteTagFromNode(`<nodeId>`, `<tagId>`).then(() => {
console.log('API called successfully.');
});
```
## getTag
Get a tag
**Parameters**
| Name | Type | Description |
|-------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **tagId** | string | The identifier of a tag. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [TagEntry](#TagEntry)
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const opts = {};
tagsApi.getTag(`<tagId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listTags
Gets a list of tags in this repository.
You can use the **include** parameter to return additional **values** information.
You can also use **name** parameter to return tags only for specified name.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
| opts.include | string[] | Returns additional information about the tag. The following optional fields can be requested: `count` | |
**Return type**: [TagPaging](#TagPaging)
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const opts = {};
tagsApi.listTags(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listTagsForNode
List tags for a node
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| **nodeId** | string | The identifier of a node. | |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | |
**Return type**: [TagPaging](#TagPaging)
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const opts = {};
tagsApi.listTagsForNode(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## updateTag
Update a tag
**Parameters**
| Name | Type | Description |
|-------------------|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **tagId** | string | The identifier of a tag. |
| **tagBodyUpdate** | [TagBody](#TagBody) | The updated tag |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [TagEntry](#TagEntry)
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const tagBodyUpdate = {};
const opts = {};
tagsApi.updateTag(`<tagId>`, tagBodyUpdate, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## createTags
Create specified by **tags** list of tags.
**Parameters**
| Name | Type | Description |
|----------|-----------------------|-------------------------|
| **tags** | [TagBody[]](#TagBody) | List of tags to create. |
**Return type**: [TagEntry[]](#TagEntry)
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const tags = [];
tagsApi.createTags(tags).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## deleteTag
Deletes the tag with **tagId**. This will cause the tag to be removed from all nodes.
> You must have admin rights to delete a tag.
**Parameters**
| Name | Type | Description |
|-----------|--------|--------------------------|
| **tagId** | string | The identifier of a tag. |
**Example**
```javascript
import { AlfrescoApi, TagsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
tagsApi.deleteTag(`<tagId>`).then(() => {
console.log('API called successfully.');
});
```
## assignTagsToNode
Assign tags to node. If tag is new then tag is also created additionally, if tag already exists then it is just assigned.
**Parameters**
| Name | Type | Description | Notes |
|------------|-----------------------|-------------------------------------------------------------------------|-------|
| **nodeId** | string | Id of node to which tags should be assigned. |
| **tags** | [TagBody[]](#TagBody) | List of tags to create and assign or just assign if they already exist. |
**Return type**: [TagPaging](#TagPaging) | [TagEntry](#TagEntry)
**Example**
```javascript
import { AlfrescoApi, TagsApi, TagBody } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const tagsApi = new TagsApi(alfrescoApi);
const tag1 = new TagBody({ tag: 'tag-test-1' });
const tag2 = new TagBody({ tag: 'tag-test-2' });
tagsApi.assignTagsToNode('someNodeId', [tag1, tag2]).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## TagPaging
**Properties**
| Name | Type |
|------|---------------------------------|
| list | [TagPagingList](#TagPagingList) |
## TagPagingList
**Properties**
| Name | Type |
|----------------|-----------------------------|
| **pagination** | [Pagination](Pagination.md) |
| **entries** | [TagEntry[]](#TagEntry) |
## TagEntry
**Properties**
| Name | Type |
|-----------|-------------|
| **entry** | [Tag](#Tag) |
## TagBody
**Properties**
| Name | Type |
|---------|--------|
| **tag** | string |
## Tag
**Properties**
| Name | Type |
|---------|--------|
| **id** | string |
| **tag** | string |
| count | number |

View File

@@ -0,0 +1,403 @@
# TrashcanApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|---------------------------------------------------------------------|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| [deleteDeletedNode](#deleteDeletedNode) | **DELETE** /deleted-nodes/{nodeId} | Permanently delete a deleted node |
| [getArchivedNodeRendition](#getArchivedNodeRendition) | **GET** /deleted-nodes/{nodeId}/renditions/{renditionId} | Get rendition information for a deleted node |
| [getArchivedNodeRenditionContent](#getArchivedNodeRenditionContent) | **GET** /deleted-nodes/{nodeId}/renditions/{renditionId}/content | Get rendition content of a deleted node |
| [getDeletedNode](#getDeletedNode) | **GET** /deleted-nodes/{nodeId} | Get a deleted node |
| [getDeletedNodeContent](#getDeletedNodeContent) | **GET** /deleted-nodes/{nodeId}/content | Get deleted node content |
| [listDeletedNodeRenditions](#listDeletedNodeRenditions) | **GET** /deleted-nodes/{nodeId}/renditions | List renditions for a deleted node |
| [listDeletedNodes](#listDeletedNodes) | **GET** /deleted-nodes | List deleted nodes |
| [requestDirectAccessUrl](#requestDirectAccessUrl) | **POST** /deleted-nodes/{nodeId}/request-direct-access-url | Generate a direct access content url for a given deleted node |
| [requestRenditionDirectAccessUrl](#requestRenditionDirectAccessUrl) | **POST** /deleted-nodes/{nodeId}/renditions/{renditionId}/request-direct-access-url | Generate a direct access content url for a given rendition of a deleted node |
| [restoreDeletedNode](#restoreDeletedNode) | **POST** /deleted-nodes/{nodeId}/restore | Restore a deleted node |
## deleteDeletedNode
Permanently delete a deleted node
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|-------------|--------|--------------------------------------------------------------------|
| nodeId | string | The identifier of a node. |
**Example**
```javascript
import { AlfrescoApi, TrashcanApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.deleteDeletedNode(`<nodeId>`).then(() => {
console.log('API called successfully.');
});
```
## getArchivedNodeRendition
Get rendition information for a deleted node
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|-------------|--------|--------------------------------------------------------------------|
| nodeId | string | The identifier of a node. |
| renditionId | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.getArchivedNodeRendition('node-id', 'rendition-id').then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
**Return type**: [RenditionEntry](RenditionEntry.md)
## getArchivedNodeRenditionContent
Get rendition content of a deleted node
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|-----------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| nodeId | string | The identifier of a node. |
| renditionId | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| ifModifiedSince | boolean | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. |
| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
| placeholder | boolean | If **true** and there is no rendition for this **nodeId** and **renditionId**, then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. |
**Return type**: **Blob**
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.getArchivedNodeRenditionContent('node-id', 'rendition-id').then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getDeletedNode
Get a deleted node
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| include | string | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `association`, `isLink`, `isFavorite`,`isLocked`, `path`, `permissions`, `definition` |
**Return type**: [DeletedNodeEntry](#DeletedNodeEntry)
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.getDeletedNode('nodeId').then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getDeletedNodeContent
Get deleted node content
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|-----------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, `Wed, 09 Mar 2016 16:56:34 GMT`. |
| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.getDeletedNodeContent('nodeId').then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listDeletedNodeRenditions
List renditions for a deleted node
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets a list of the rendition information for each rendition of the file **nodeId**, including the rendition id.
Each rendition returned has a **status**: `CREATED` means it is available to view or download, `NOT_CREATED` means the rendition can be requested.
You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where**
clause will return just the `CREATED` renditions:
```text
(status='CREATED')
```
**Parameters**
| Name | Type | Description |
|------------|--------|-----------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| opts.where | string | A string to restrict the returned objects by using a predicate. |
**Return type**: [RenditionPaging](RenditionPaging.md)
**Example**
```javascript
import { AlfrescoApi, TrashcanApi} from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
trashcanApi.listDeletedNodeRenditions(`<nodeId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listDeletedNodes
List deleted nodes
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets a list of deleted nodes for the current user.
If the current user is an administrator deleted nodes for all users will be returned.
The list of deleted nodes will be ordered with the most recently deleted node at the top of the list.
**Parameters**
| Name | Type | Description | Notes |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. | default to 0 |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. | default to 100 |
| opts.include | string[] | Returns additional information about the node. The following optional fields can be requested: `allowableOperations`, `aspectNames`, `association`, `isLink`, `isFavorite`, `isLocked`, `path`, `properties`, `permissions` | |
**Return type**: [DeletedNodesPaging](#DeletedNodesPaging)
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
const opts = {};
trashcanApi.listDeletedNodes(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## requestDirectAccessUrl
Generate a direct access content url for a given deleted node
> this endpoint is available in **Alfresco 7.1** and newer versions.
**Parameters**
| Name | Type | Description |
|------------|--------|---------------------------|
| **nodeId** | string | The identifier of a node. |
**Return type**: [DirectAccessUrlEntry](DirectAccessUrlEntry.md)
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
const nodeId = 'da2e6953-3850-408b-8284-3534dd777417';
trashcanApi.requestDirectAccessUrl(nodeId).then((data) => {
console.log('URL generated successfully: ', data.contentUrl);
});
```
## requestRenditionDirectAccessUrl
Generate a direct access content url for a given rendition of a deleted node
> this endpoint is available in **Alfresco 7.1** and newer versions.
**Parameters**
| Name | Type | Description |
|-----------------|--------|--------------------------------|
| **nodeId** | string | The identifier of a node. |
| **renditionId** | string | The identifier of a rendition. |
**Return type**: [**DirectAccessUrlEntry**](DirectAccessUrlEntry.md)
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
const nodeId = 'da2e6953-3850-408b-8284-3534dd777417';
const renditionId = 'avatar';
trashcanApi.requestRenditionDirectAccessUrl(nodeId, renditionId).then((data) => {
console.log('URL generated successfully: ', data.contentUrl);
});
```
## restoreDeletedNode
Restore a deleted node
> this endpoint is available in **Alfresco 5.2** and newer versions.
Attempts to restore the deleted node **nodeId** to its original location or to a new location.
If the node is successfully restored to its former primary parent, then only the
primary child association will be restored, including recursively for any primary
children. It should be noted that no other secondary child associations or peer
associations will be restored, for any of the nodes within the primary parent-child
hierarchy of restored nodes, irrespective of whether these associations were to
nodes within or outside the restored hierarchy.
Also, any previously shared link will not be restored since it is deleted at the time
of delete of each node.
**Parameters**
| Name | Type | Description |
|-----------------------------|---------------------------------------------------|---------------------------------------------------------------|
| nodeId | string | The identifier of a node. |
| opts.fields | string | A list of field names. |
| opts.deletedNodeBodyRestore | [DeletedNodeBodyRestore](#DeletedNodeBodyRestore) | The targetParentId if the node is restored to a new location. |
**Return type**: [NodeEntry](NodeEntry.md)
**Example**
```javascript
import { AlfrescoApi, TrashcanApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const trashcanApi = new TrashcanApi(alfrescoApi);
const nodeId = '<guid>';
trashcanApi.restoreDeletedNode(nodeId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## DeletedNodesPaging
**Properties**
| Name | Type |
|------|-----------------------------------------------------|
| list | [DeletedNodesPagingList](DeletedNodesPagingList.md) |
## DeletedNodesPagingList
**Properties**
| Name | Type |
|------------|-----------------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [DeletedNodeEntry[]](#DeletedNodeEntry) |
## DeletedNodeEntry
**Properties**
| Name | Type |
|-----------|-----------------------------|
| **entry** | [DeletedNode](#DeletedNode) |
## DeletedNode
**Properties**
| Name | Type | Description |
|---------------------|---------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **id** | string | |
| **name** | string | The name must not contain spaces or the following special characters: `* \" < > \\ / ?` : and ` \| `. The character `.` must not be used at the end of the name. |
| **nodeType** | string | |
| **isFolder** | boolean | |
| **isFile** | boolean | |
| isLocked | boolean | |
| **modifiedAt** | Date | |
| **modifiedByUser** | [UserInfo](UserInfo.md) | |
| **createdAt** | Date | |
| **createdByUser** | [UserInfo](UserInfo.md) | |
| parentId | string | |
| isLink | boolean | |
| isFavorite | boolean | |
| content | [ContentInfo](ContentInfo.md) | |
| aspectNames | string[] | |
| properties | any | |
| allowableOperations | string[] | |
| path | [PathInfo](PathInfo.md) | |
| permissions | [PermissionsInfo](PermissionsInfo.md) | |
| definition | [Definition](Definition.md) | |
| **archivedByUser** | [UserInfo](UserInfo.md) | |
| **archivedAt** | Date | |
## DeletedNodeBodyRestore
**Properties**
| Name | Type |
|----------------|--------|
| targetParentId | string |
| assocType | string |

View File

@@ -0,0 +1,10 @@
# UserInfo
**Properties**
| Name | Type |
|-----------------|--------|
| **displayName** | string |
| **id** | string |

View File

@@ -0,0 +1,434 @@
# VersionsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/public/alfresco/versions/1*
| Method | HTTP request | Description |
|-----------------------------------------------------------|-------------------------------------------------------------------------------|--------------------------------------------------------------------|
| [createVersionRendition](#createVersionRendition) | **POST** /nodes/{nodeId}/versions/{versionId}/renditions | Create rendition for a file version |
| [deleteVersion](#deleteVersion) | **DELETE** /nodes/{nodeId}/versions/{versionId} | Delete a version |
| [getVersion](#getVersion) | **GET** /nodes/{nodeId}/versions/{versionId} | Get version information |
| [getVersionContent](#getVersionContent) | **GET** /nodes/{nodeId}/versions/{versionId}/content | Get version content |
| [getVersionRendition](#getVersionRendition) | **GET** /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId} | Get rendition information for a file version |
| [getVersionRenditionContent](#getVersionRenditionContent) | **GET** /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content | Get rendition content for a file version |
| [listVersionHistory](#listVersionHistory) | **GET** /nodes/{nodeId}/versions | List version history |
| [listVersionRenditions](#listVersionRenditions) | **GET** /nodes/{nodeId}/versions/{versionId}/renditions | List renditions for a file version |
| [requestDirectAccessUrl](#requestDirectAccessUrl) | **POST** /nodes/{nodeId}/versions/{versionId}/request-direct-access-url | Generate a direct access content url for a given version of a node |
| [revertVersion](#revertVersion) | **POST** /nodes/{nodeId}/versions/{versionId}/revert | Revert a version |
## createVersionRendition
Create rendition for a file version
> this endpoint is available in **Alfresco 7.0.0** and newer versions.
An asynchronous request to create a rendition for version of file **nodeId** and **versionId**.
The version rendition is specified by name **id** in the request body:
```json
{
"id": "doclib"
}
```
Multiple names may be specified as a comma separated list or using a list format:
```json
[
{
"id": "doclib"
},
{
"id": "avatar"
}
]
```
**Parameters**
| Name | Type | Description |
|-------------------------|-----------------------------------------------|---------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. |
| **renditionBodyCreate** | [RenditionBodyCreate](RenditionBodyCreate.md) | The rendition "id". |
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const renditionBodyCreate = {};
versionsApi.createVersionRendition(`<nodeId>`, `<versionId>`, renditionBodyCreate).then(() => {
console.log('API called successfully.');
});
```
## deleteVersion
Delete a version
> this endpoint is available in **Alfresco 5.2** and newer versions.
Delete the version identified by **versionId** and **nodeId*.
**Parameters**
| Name | Type | Description | Notes |
|---------------|--------|---------------------------------------------------------------------------------------|-------|
| **nodeId** | string | The identifier of a node. |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. |
If the version is successfully deleted then the content and metadata for that versioned node
will be deleted and will no longer appear in the version history. This operation cannot be undone.
If the most recent version is deleted the live node will revert to the next most recent version.
We currently do not allow the last version to be deleted. If you wish to clear the history then you
can remove the `cm:versionable` aspect (via update node) which will also disable versioning. In this
case, you can re-enable versioning by adding back the `cm:versionable` aspect or using the version
params (majorVersion and comment) on a subsequent file content update.
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
versionsApi.deleteVersion(nodeId, versionId).then(() => {
console.log('API called successfully.');
});
```
## getVersion
Get version information
> this endpoint is available in **Alfresco 5.2** and newer versions.
**Parameters**
| Name | Type | Description |
|---------------|------------|---------------------------------------------------------------------------------------|
| **nodeId** | **string** | The identifier of a node. |
| **versionId** | **string** | The identifier of a version, ie. version label, within the version history of a node. |
**Return type**: [VersionEntry](#VersionEntry)
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
versionsApi.getVersion(`<nodeId>`, `<versionId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getVersionContent
Get version content
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets the version content for **versionId** of file node **nodeId**.
**Parameters**
| Name | Type | Description |
|-----------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. |
| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| ifModifiedSince | Date | Only returns the content if it has been modified since the date provided.Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. |
| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const opts = {};
versionsApi.getVersionContent(`<nodeId>`, `<versionId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getVersionRendition
Get rendition information for a file version
> this endpoint is available in **Alfresco 7.0.0** and newer versions.
Gets the rendition information for **renditionId** of version of file **nodeId** and **versionId**.
**Parameters**
| Name | Type | Description |
|-----------------|--------|---------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. |
| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
**Return type**: [RenditionEntry](RenditionEntry.md)
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
versionsApi.getVersionRendition(`<nodeId>`, `<versionId>`, `<renditionId>`).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## getVersionRenditionContent
Get rendition content for a file version
> this endpoint is available in **Alfresco 7.0.0** and newer versions.
Gets the rendition content for **renditionId** of version of file **nodeId** and **versionId**.
**Parameters**
| Name | Type | Description |
|-----------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. |
| **renditionId** | string | The name of a thumbnail rendition, for example *doclib*, or *pdf*. |
| attachment | boolean | **true** (default) enables a web browser to download the file as an attachment. **false** means a web browser may preview the file in a new tab or window, but not download the file. You can only set this parameter to **false** if the content type of the file is in the supported list; for example, certain image files and PDF files. If the content type is not supported for preview, then a value of **false** is ignored, and the attachment will be returned in the response. |
| ifModifiedSince | Date | Only returns the content if it has been modified since the date provided. Use the date format defined by HTTP. For example, Wed, 09 Mar 2016 16:56:34 GMT. |
| range | string | The Range header indicates the part of a document that the server should return. Single part request supported, for example: bytes=1-10. |
| placeholder | boolean | If **true** (default: false) and there is no rendition for this **nodeId** and **renditionId**, then the placeholder image for the mime type of this rendition is returned, rather than a 404 response. |
**Return type**: Blob
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const opts = {};
versionsApi.getVersionRenditionContent(`<nodeId>`, `<versionId>`, `<renditionId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listVersionHistory
List version history
> this endpoint is available in **Alfresco 5.2** and newer versions.
Gets the version history as an ordered list of versions for the specified **nodeId**.
The list is ordered in descending modified order. So the most recent version is first and
the original version is last in the list.
**Parameters**
| Name | Type | Description |
|----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| opts.include | string[] | Returns additional information about the version node. The following optional fields can be requested: `properties`, `aspectNames` |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
| opts.skipCount | number | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. |
| opts.maxItems | number | The maximum number of items to return in the list. If not supplied then the default value is 100. |
**Return type**: [VersionPaging](#VersionPaging)
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const opts = {};
versionsApi.listVersionHistory(`<nodeId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## listVersionRenditions
List renditions for a file version
> this endpoint is available in **Alfresco 7.0.0** and newer versions.
Gets a list of the rendition information for each rendition of the version of file **nodeId** and **versionId**, including the rendition id.
Each rendition returned has a **status**: `CREATED` means it is available to view or download, `NOT_CREATED` means the rendition can be requested.
You can use the **where** parameter to filter the returned renditions by **status**. For example, the following **where**
clause will return just the `CREATED` renditions:
```text
(status='CREATED')
```
**Parameters**
| Name | Type | Description | Notes |
|---------------|--------|---------------------------------------------------------------------------------------|------------|
| **nodeId** | string | The identifier of a node. | |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. | |
| opts.where | string | A string to restrict the returned objects by using a predicate. | [optional] |
**Return type**: [RenditionPaging](RenditionPaging.md)
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const opts = {};
versionsApi.listVersionRenditions(`<nodeId>`, `<versionId>`, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
## requestDirectAccessUrl
Generate a direct access content url for a given version of a node
> this endpoint is available in **Alfresco 7.1** and newer versions.
**Parameters**
| Name | Type | Description |
|---------------|------------|------------------------------|
| **nodeId** | **string** | The identifier of a node. |
| **versionId** | **string** | The identifier of a version. |
**Return type**: [DirectAccessUrlEntry](DirectAccessUrlEntry.md)
### Example
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const nodeId = 'da2e6953-3850-408b-8284-3534dd777417';
const versionId = '1.0';
versionsApi.requestDirectAccessUrl(nodeId, versionId).then((data) => {
console.log('URL generated successfully: ', data.contentUrl);
});
```
## revertVersion
Revert a version
> this endpoint is available in **Alfresco 5.2** and newer versions.
Attempts to revert the version identified by **versionId** and **nodeId** to the live node.
If the node is successfully reverted then the content and metadata for that versioned node
will be promoted to the live node and a new version will appear in the version history.
**Parameters**
| Name | Type | Description |
|----------------|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **nodeId** | string | The identifier of a node. |
| **versionId** | string | The identifier of a version, ie. version label, within the version history of a node. |
| **revertBody** | [RevertBody](#RevertBody) | Optionally, specify a version comment and whether this should be a major version, or not. |
| opts.fields | string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. |
**Return type**: [VersionEntry](#VersionEntry)
**Example**
```javascript
import { AlfrescoApi, VersionsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const versionsApi = new VersionsApi(alfrescoApi);
const revertBody = {};
const opts = {};
versionsApi.revertVersion(`<nodeId>`, `<versionId>`, revertBody, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
});
```
# Models
## RevertBody
**Properties**
| Name | Type |
|--------------|---------|
| majorVersion | boolean |
| comment | string |
## VersionPaging
**Properties**
| Name | Type |
|------|-----------------------------------------|
| list | [VersionPagingList](#VersionPagingList) |
## VersionPagingList
**Properties**
| Name | Type |
|------------|---------------------------------|
| pagination | [Pagination](Pagination.md) |
| entries | [VersionEntry[]](#VersionEntry) |
## VersionEntry
**Properties**
| Name | Type |
|-------|---------------------|
| entry | [Version](#Version) |
## Version
**Properties**
| Name | Type | Description |
|--------------------|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **id** | string | |
| versionComment | string | |
| **name** | string | The name must not contain spaces or the following special characters: `* \" < > \\ / ? :` and `\|` . The character . must not be used at the end of the name. |
| **nodeType** | string | |
| **isFolder** | boolean | |
| **isFile** | boolean | |
| **modifiedAt** | Date | |
| **modifiedByUser** | [UserInfo](UserInfo.md) | |
| content | [ContentInfo](ContentInfo.md) | |
| aspectNames | string[] | |
| properties | any | |