Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #91 from Alfresco/development
Browse files Browse the repository at this point in the history
0.3.8 release
  • Loading branch information
eromano committed Nov 8, 2016
2 parents c3f5b97 + 36a5916 commit 8754891
Show file tree
Hide file tree
Showing 11 changed files with 276 additions and 44 deletions.
37 changes: 26 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,29 @@ Alfresco JS API

_This project provides a JavaScript client API into the v1 Alfresco REST API_

<a name="0.3.8"></a>
# [0.3.8](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.8) (04-11-2016)

## Fix
- [Activiti API processApi.getProcessDefinitionStartForm() does not take a process def ID #76](https://github.com/Alfresco/alfresco-js-api/issues/76)

```javascript

var processDefinitionId = "pprocessDefinitionId_example"; // String | processDefinitionId

this.alfrescoJsApi.activiti.processApi.getProcessDefinitionStartForm(processDefinitionId);
```
- [cookies are missing #86](https://github.com/Alfresco/alfresco-js-api/issues/86)


<a name="0.3.7"></a>
# [0.3.7](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.7) (2016-10-29)
# [0.3.7](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.7) (29-10-2016)

## Fix
- [Latest version no longer works due to .d.ts errors #78](https://github.com/Alfresco/alfresco-js-api/issues/78)

<a name="0.3.6"></a>
# [0.3.6](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.6) (2016-10-28)
# [0.3.6](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.6) (28-10-2016)

## Fix
- [separate getRestFieldValues in getRestFieldValues and getRestFieldValuesColumn #71](https://github.com/Alfresco/alfresco-js-api/issues/71)
Expand Down Expand Up @@ -53,20 +68,20 @@ this.alfrescoJsApi.activiti.modelJsonBpmnApi.getHistoricEditorDisplayJsonClient(


<a name="0.3.5"></a>
# [0.3.5](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.5) (2016-09-26)
# [0.3.5](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.5) (26-09-2016)

## Fix
- [Library no longer works with ECM](https://github.com/Alfresco/alfresco-js-api/issues/63)
- [Flag to enable/disable CSRF behaviour](https://github.com/Alfresco/alfresco-js-api/issues/62)

<a name="0.3.4"></a>
# [0.3.4](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.4) (2016-09-26)
# [0.3.4](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.4) (26-09-2016)

## Fix
- [csrf token for activiti doesn't work with Node.js](https://github.com/Alfresco/alfresco-js-api/issues/61)

<a name="0.3.3"></a>
# [0.3.3](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.3) (2016-09-26)
# [0.3.3](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.3) (26-09-2016)

## Fix
- [Add csrf token for activiti](https://github.com/Alfresco/alfresco-js-api/issues/59)
Expand All @@ -76,7 +91,7 @@ this.alfrescoJsApi.activiti.modelJsonBpmnApi.getHistoricEditorDisplayJsonClient(
- Various improvements for TypeScript declaration files

<a name="0.3.2"></a>
# [0.3.2](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.2) (2016-09-21)
# [0.3.2](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.2) (21-09-2016)

## Fix
- [Null date fields parsed as invalid dates](https://github.com/Alfresco/alfresco-js-api/issues/50)
Expand All @@ -88,7 +103,7 @@ this.alfrescoJsApi.activiti.modelJsonBpmnApi.getHistoricEditorDisplayJsonClient(
- Various improvements for TypeScript declaration files

<a name="0.3.1"></a>
# [0.3.1](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.1) (2016-08-29)
# [0.3.1](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.1) (29-08-2016)

## Fix
- [Date parser error with Safari](https://github.com/Alfresco/alfresco-js-api/issues/43)
Expand All @@ -98,7 +113,7 @@ this.alfrescoJsApi.activiti.modelJsonBpmnApi.getHistoricEditorDisplayJsonClient(
- Various improvements for TypeScript declaration files

<a name="0.3.0"></a>
# [0.3.0](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.0) (2016-08-22)
# [0.3.0](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.0) (22-08-2016)

## Features
- [Integration Activiti Api #19](https://github.com/Alfresco/alfresco-js-api/issues/19)
Expand Down Expand Up @@ -192,12 +207,12 @@ this.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb
```
<a name="0.2.2"></a>
# [0.2.2](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.2.2) (2016-07-21)
# [0.2.2](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.2.2) (21-07-2016)
- [Cannot find module mockAlfrescoApi #29](https://github.com/Alfresco/alfresco-js-api/issues/29)
- [ChangesAPI doesn't refer to any real API and duplicates other APIs #26](https://github.com/Alfresco/alfresco-js-api/issues/26)
<a name="0.2.1"></a>
# [0.2.1](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.2.1) (2016-07-15)
# [0.2.1](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.2.1) (15-07-2016)
## Features
Expand Down Expand Up @@ -229,7 +244,7 @@ After:
```
<a name="0.2.0"></a>
# [0.2.0](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.2.0) (2016-07-08)
# [0.2.0](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.2.0) (08-07-2016)
## BREAKING CHANGES
Expand Down
94 changes: 89 additions & 5 deletions dist/alfresco-js-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -60358,11 +60358,20 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol

/**
* Retrieve the start form for a process definition
* @param {String} processDefinitionId processDefinitionId
*/
this.getProcessDefinitionStartForm = function () {
this.getProcessDefinitionStartForm = function (processDefinitionId) {
var postBody = null;

var pathParams = {};
// verify the required parameter 'processInstanceId' is set
if (processDefinitionId == undefined || processDefinitionId == null) {
throw "Missing the required parameter 'processDefinitionId' when calling getProcessInstanceContent";
}

var pathParams = {
'processDefinitionId': processDefinitionId
};

var queryParams = {};
var headerParams = {};
var formParams = {};
Expand Down Expand Up @@ -89827,8 +89836,11 @@ var AlfrescoApiClient = function (_ApiClient) {
}

// add cookie for activiti
if (this.isBpmRequest() && this.cookie) {
request.set('Cookie', this.cookie);
if (this.isBpmRequest()) {
request._withCredentials = true;
if (this.cookie) {
request.set('Cookie', this.cookie);
}
}

// set request timeout
Expand Down Expand Up @@ -91106,6 +91118,78 @@ var ProcessMock = function (_BaseMock) {
}]
});
}
}, {
key: 'get200getProcessDefinitionStartForm',
value: function get200getProcessDefinitionStartForm() {
nock(this.host, { 'encodedQueryParams': true }).get('/activiti-app/api/enterprise/process-definitions/testProcess%3A1%3A7504/start-form').reply(200, {
'id': 2002,
'processDefinitionId': 'testProcess:1:7504',
'processDefinitionName': 'test process',
'processDefinitionKey': 'testProcess',
'tabs': [],
'fields': [{
'fieldType': 'DynamicTableRepresentation',
'id': 'label',
'name': 'Label',
'type': 'dynamic-table',
'value': null,
'required': false,
'readOnly': false,
'overrideId': false,
'colspan': 1,
'placeholder': null,
'minLength': 0,
'maxLength': 0,
'minValue': null,
'maxValue': null,
'regexPattern': null,
'optionType': null,
'hasEmptyValue': null,
'options': null,
'restUrl': null,
'restResponsePath': null,
'restIdProperty': null,
'restLabelProperty': null,
'tab': null,
'className': null,
'params': { 'existingColspan': 1, 'maxColspan': 1 },
'layout': { 'row': -1, 'column': -1, 'colspan': 2 },
'sizeX': 2,
'sizeY': 2,
'row': -1,
'col': -1,
'visibilityCondition': null,
'columnDefinitions': [{
'id': 'user',
'name': 'User',
'type': 'Dropdown',
'value': null,
'optionType': 'rest',
'options': [{ 'id': null, 'name': 'Option 1' }],
'restResponsePath': null,
'restUrl': 'https://jsonplaceholder.typicode.com/users',
'restIdProperty': 'id',
'restLabelProperty': 'name',
'amountCurrency': null,
'amountEnableFractions': false,
'required': true,
'editable': true,
'sortable': true,
'visible': true,
'endpoint': null,
'requestHeaders': null
}]
}],
'outcomes': [],
'javascriptEvents': [],
'className': '',
'style': '',
'customFieldTemplates': {},
'metadata': {},
'variables': [],
'gridsterForm': false
});
}
}]);

return ProcessMock;
Expand Down Expand Up @@ -91243,7 +91327,7 @@ var TaskFormMock = function (_BaseMock) {
_createClass(TaskFormMock, [{
key: 'get200getTaskFormVariables',
value: function get200getTaskFormVariables() {
nock(this.host, { 'encodedQueryParams': true }).get('/activiti-app/app/rest/task-forms/5028/variables').reply(200, [{ 'id': 'initiator', 'type': 'string', 'value': '1001' }]);
nock(this.host, { 'encodedQueryParams': true }).get('/activiti-app/app/rest/task-forms/5028/variables').reply(200, [{ 'id': 'initiator', 'type': 'string', 'value': '1001' }], ['Server', 'Apache-Coyote/1.1', 'set-cookie', 'ACTIVITI_REMEMBER_ME=NjdOdGwvcUtFTkVEczQyMGh4WFp5QT09OmpUL1UwdFVBTC94QTJMTFFUVFgvdFE9PQ', 'X-Content-Type-Options', 'nosniff', 'X-XSS-Protection', '1; mode=block', 'Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate', 'Pragma', 'no-cache', 'Expires', '0', 'X-Frame-Options', 'SAMEORIGIN', 'Content-Type', 'application/json', 'Transfer-Encoding', 'chunked', 'Date', 'Tue, 01 Nov 2016 19:43:36 GMT', 'Connection', 'close']);
}
}]);

Expand Down
40 changes: 20 additions & 20 deletions dist/alfresco-js-api.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alfresco-js-api",
"version": "0.3.7",
"version": "0.3.8",
"description": "JavaScript client library for the Alfresco REST API",
"main": "main.js",
"typings": "index.d.ts",
Expand Down
10 changes: 7 additions & 3 deletions src/alfresco-activiti-rest-api/docs/ProcessApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,16 @@ Retrieve the start form for a process definition
### Example
```javascript

this.alfrescoJsApi.activiti.processApi.getProcessDefinitionStartForm();
var processDefinitionId = "pprocessDefinitionId_example"; // String | processDefinitionId

this.alfrescoJsApi.activiti.processApi.getProcessDefinitionStartForm(processDefinitionId);
```

### Parameters
This endpoint does not need any parameter.

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**processDefinitionId** | **String**| processDefinitionId |

### Return type

[**FormDefinitionRepresentation**](FormDefinitionRepresentation.md)
Expand Down
10 changes: 9 additions & 1 deletion src/alfresco-activiti-rest-api/src/api/ProcessApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,21 @@

/**
* Retrieve the start form for a process definition
* @param {String} processDefinitionId processDefinitionId
*/
this.getProcessDefinitionStartForm = function() {
this.getProcessDefinitionStartForm = function(processDefinitionId) {
var postBody = null;

// verify the required parameter 'processInstanceId' is set
if (processDefinitionId == undefined || processDefinitionId == null) {
throw "Missing the required parameter 'processDefinitionId' when calling getProcessInstanceContent";
}


var pathParams = {
'processDefinitionId': processDefinitionId
};

var queryParams = {
};
var headerParams = {
Expand Down
7 changes: 5 additions & 2 deletions src/alfrescoApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ class AlfrescoApiClient extends ApiClient {
}

// add cookie for activiti
if (this.isBpmRequest() && this.cookie) {
request.set('Cookie', this.cookie);
if (this.isBpmRequest()) {
request._withCredentials = true;
if (this.cookie) {
request.set('Cookie', this.cookie);
}
}

// set request timeout
Expand Down
10 changes: 10 additions & 0 deletions test/activitProcessApi.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,14 @@ describe('Activiti Process Api', function () {
});
});

it('get process definition startForm', function (done) {
this.processMock.get200getProcessDefinitionStartForm();
var processDefinitionId = 'testProcess:1:7504';

this.alfrescoJsApi.activiti.processApi.getProcessDefinitionStartForm(processDefinitionId).then((data)=> {
expect(data.processDefinitionId).equal('testProcess:1:7504');
done();
});
});

});
10 changes: 10 additions & 0 deletions test/activitiTaskFormApi.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,14 @@ describe('Activiti Task Api', function () {
});
});

it('Check cookie settings', function (done) {
this.taskFormMock.get200getTaskFormVariables();

var taskId = 5028;
this.alfrescoJsApi.activiti.taskFormsApi.getTaskFormVariables(taskId).then((data)=> {
expect(this.alfrescoJsApi.activiti.taskFormsApi.apiClient.cookie).equal('ACTIVITI_REMEMBER_ME=NjdOdGwvcUtFTkVEczQyMGh4WFp5QT09OmpUL1UwdFVBTC94QTJMTFFUVFgvdFE9PQ');
done();
});
});

});
Loading

0 comments on commit 8754891

Please sign in to comment.