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

Commit 8754891

Browse files
authored
Merge pull request #91 from Alfresco/development
0.3.8 release
2 parents c3f5b97 + 36a5916 commit 8754891

File tree

11 files changed

+276
-44
lines changed

11 files changed

+276
-44
lines changed

CHANGELOG.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,29 @@ Alfresco JS API
66

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

9+
<a name="0.3.8"></a>
10+
# [0.3.8](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.8) (04-11-2016)
11+
12+
## Fix
13+
- [Activiti API processApi.getProcessDefinitionStartForm() does not take a process def ID #76](https://github.com/Alfresco/alfresco-js-api/issues/76)
14+
15+
```javascript
16+
17+
var processDefinitionId = "pprocessDefinitionId_example"; // String | processDefinitionId
18+
19+
this.alfrescoJsApi.activiti.processApi.getProcessDefinitionStartForm(processDefinitionId);
20+
```
21+
- [cookies are missing #86](https://github.com/Alfresco/alfresco-js-api/issues/86)
22+
23+
924
<a name="0.3.7"></a>
10-
# [0.3.7](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.7) (2016-10-29)
25+
# [0.3.7](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.7) (29-10-2016)
1126

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

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

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

5469

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

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

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

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

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

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

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

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

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

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

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

103118
## Features
104119
- [Integration Activiti Api #19](https://github.com/Alfresco/alfresco-js-api/issues/19)
@@ -192,12 +207,12 @@ this.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb
192207
```
193208
194209
<a name="0.2.2"></a>
195-
# [0.2.2](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.2.2) (2016-07-21)
210+
# [0.2.2](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.2.2) (21-07-2016)
196211
- [Cannot find module mockAlfrescoApi #29](https://github.com/Alfresco/alfresco-js-api/issues/29)
197212
- [ChangesAPI doesn't refer to any real API and duplicates other APIs #26](https://github.com/Alfresco/alfresco-js-api/issues/26)
198213
199214
<a name="0.2.1"></a>
200-
# [0.2.1](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.2.1) (2016-07-15)
215+
# [0.2.1](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.2.1) (15-07-2016)
201216
202217
## Features
203218
@@ -229,7 +244,7 @@ After:
229244
```
230245
231246
<a name="0.2.0"></a>
232-
# [0.2.0](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.2.0) (2016-07-08)
247+
# [0.2.0](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.2.0) (08-07-2016)
233248
234249
## BREAKING CHANGES
235250

dist/alfresco-js-api.js

Lines changed: 89 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60358,11 +60358,20 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
6035860358

6035960359
/**
6036060360
* Retrieve the start form for a process definition
60361+
* @param {String} processDefinitionId processDefinitionId
6036160362
*/
60362-
this.getProcessDefinitionStartForm = function () {
60363+
this.getProcessDefinitionStartForm = function (processDefinitionId) {
6036360364
var postBody = null;
6036460365

60365-
var pathParams = {};
60366+
// verify the required parameter 'processInstanceId' is set
60367+
if (processDefinitionId == undefined || processDefinitionId == null) {
60368+
throw "Missing the required parameter 'processDefinitionId' when calling getProcessInstanceContent";
60369+
}
60370+
60371+
var pathParams = {
60372+
'processDefinitionId': processDefinitionId
60373+
};
60374+
6036660375
var queryParams = {};
6036760376
var headerParams = {};
6036860377
var formParams = {};
@@ -89827,8 +89836,11 @@ var AlfrescoApiClient = function (_ApiClient) {
8982789836
}
8982889837

8982989838
// add cookie for activiti
89830-
if (this.isBpmRequest() && this.cookie) {
89831-
request.set('Cookie', this.cookie);
89839+
if (this.isBpmRequest()) {
89840+
request._withCredentials = true;
89841+
if (this.cookie) {
89842+
request.set('Cookie', this.cookie);
89843+
}
8983289844
}
8983389845

8983489846
// set request timeout
@@ -91106,6 +91118,78 @@ var ProcessMock = function (_BaseMock) {
9110691118
}]
9110791119
});
9110891120
}
91121+
}, {
91122+
key: 'get200getProcessDefinitionStartForm',
91123+
value: function get200getProcessDefinitionStartForm() {
91124+
nock(this.host, { 'encodedQueryParams': true }).get('/activiti-app/api/enterprise/process-definitions/testProcess%3A1%3A7504/start-form').reply(200, {
91125+
'id': 2002,
91126+
'processDefinitionId': 'testProcess:1:7504',
91127+
'processDefinitionName': 'test process',
91128+
'processDefinitionKey': 'testProcess',
91129+
'tabs': [],
91130+
'fields': [{
91131+
'fieldType': 'DynamicTableRepresentation',
91132+
'id': 'label',
91133+
'name': 'Label',
91134+
'type': 'dynamic-table',
91135+
'value': null,
91136+
'required': false,
91137+
'readOnly': false,
91138+
'overrideId': false,
91139+
'colspan': 1,
91140+
'placeholder': null,
91141+
'minLength': 0,
91142+
'maxLength': 0,
91143+
'minValue': null,
91144+
'maxValue': null,
91145+
'regexPattern': null,
91146+
'optionType': null,
91147+
'hasEmptyValue': null,
91148+
'options': null,
91149+
'restUrl': null,
91150+
'restResponsePath': null,
91151+
'restIdProperty': null,
91152+
'restLabelProperty': null,
91153+
'tab': null,
91154+
'className': null,
91155+
'params': { 'existingColspan': 1, 'maxColspan': 1 },
91156+
'layout': { 'row': -1, 'column': -1, 'colspan': 2 },
91157+
'sizeX': 2,
91158+
'sizeY': 2,
91159+
'row': -1,
91160+
'col': -1,
91161+
'visibilityCondition': null,
91162+
'columnDefinitions': [{
91163+
'id': 'user',
91164+
'name': 'User',
91165+
'type': 'Dropdown',
91166+
'value': null,
91167+
'optionType': 'rest',
91168+
'options': [{ 'id': null, 'name': 'Option 1' }],
91169+
'restResponsePath': null,
91170+
'restUrl': 'https://jsonplaceholder.typicode.com/users',
91171+
'restIdProperty': 'id',
91172+
'restLabelProperty': 'name',
91173+
'amountCurrency': null,
91174+
'amountEnableFractions': false,
91175+
'required': true,
91176+
'editable': true,
91177+
'sortable': true,
91178+
'visible': true,
91179+
'endpoint': null,
91180+
'requestHeaders': null
91181+
}]
91182+
}],
91183+
'outcomes': [],
91184+
'javascriptEvents': [],
91185+
'className': '',
91186+
'style': '',
91187+
'customFieldTemplates': {},
91188+
'metadata': {},
91189+
'variables': [],
91190+
'gridsterForm': false
91191+
});
91192+
}
9110991193
}]);
9111091194

9111191195
return ProcessMock;
@@ -91243,7 +91327,7 @@ var TaskFormMock = function (_BaseMock) {
9124391327
_createClass(TaskFormMock, [{
9124491328
key: 'get200getTaskFormVariables',
9124591329
value: function get200getTaskFormVariables() {
91246-
nock(this.host, { 'encodedQueryParams': true }).get('/activiti-app/app/rest/task-forms/5028/variables').reply(200, [{ 'id': 'initiator', 'type': 'string', 'value': '1001' }]);
91330+
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']);
9124791331
}
9124891332
}]);
9124991333

dist/alfresco-js-api.min.js

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "alfresco-js-api",
3-
"version": "0.3.7",
3+
"version": "0.3.8",
44
"description": "JavaScript client library for the Alfresco REST API",
55
"main": "main.js",
66
"typings": "index.d.ts",

src/alfresco-activiti-rest-api/docs/ProcessApi.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,16 @@ Retrieve the start form for a process definition
9292
### Example
9393
```javascript
9494

95-
this.alfrescoJsApi.activiti.processApi.getProcessDefinitionStartForm();
95+
var processDefinitionId = "pprocessDefinitionId_example"; // String | processDefinitionId
96+
97+
this.alfrescoJsApi.activiti.processApi.getProcessDefinitionStartForm(processDefinitionId);
9698
```
9799

98100
### Parameters
99-
This endpoint does not need any parameter.
100-
101+
Name | Type | Description | Notes
102+
------------- | ------------- | ------------- | -------------
103+
**processDefinitionId** | **String**| processDefinitionId |
104+
101105
### Return type
102106

103107
[**FormDefinitionRepresentation**](FormDefinitionRepresentation.md)

src/alfresco-activiti-rest-api/src/api/ProcessApi.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,21 @@
124124

125125
/**
126126
* Retrieve the start form for a process definition
127+
* @param {String} processDefinitionId processDefinitionId
127128
*/
128-
this.getProcessDefinitionStartForm = function() {
129+
this.getProcessDefinitionStartForm = function(processDefinitionId) {
129130
var postBody = null;
130131

132+
// verify the required parameter 'processInstanceId' is set
133+
if (processDefinitionId == undefined || processDefinitionId == null) {
134+
throw "Missing the required parameter 'processDefinitionId' when calling getProcessInstanceContent";
135+
}
136+
131137

132138
var pathParams = {
139+
'processDefinitionId': processDefinitionId
133140
};
141+
134142
var queryParams = {
135143
};
136144
var headerParams = {

src/alfrescoApiClient.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ class AlfrescoApiClient extends ApiClient {
6363
}
6464

6565
// add cookie for activiti
66-
if (this.isBpmRequest() && this.cookie) {
67-
request.set('Cookie', this.cookie);
66+
if (this.isBpmRequest()) {
67+
request._withCredentials = true;
68+
if (this.cookie) {
69+
request.set('Cookie', this.cookie);
70+
}
6871
}
6972

7073
// set request timeout

test/activitProcessApi.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,14 @@ describe('Activiti Process Api', function () {
5353
});
5454
});
5555

56+
it('get process definition startForm', function (done) {
57+
this.processMock.get200getProcessDefinitionStartForm();
58+
var processDefinitionId = 'testProcess:1:7504';
59+
60+
this.alfrescoJsApi.activiti.processApi.getProcessDefinitionStartForm(processDefinitionId).then((data)=> {
61+
expect(data.processDefinitionId).equal('testProcess:1:7504');
62+
done();
63+
});
64+
});
65+
5666
});

test/activitiTaskFormApi.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,14 @@ describe('Activiti Task Api', function () {
3434
});
3535
});
3636

37+
it('Check cookie settings', function (done) {
38+
this.taskFormMock.get200getTaskFormVariables();
39+
40+
var taskId = 5028;
41+
this.alfrescoJsApi.activiti.taskFormsApi.getTaskFormVariables(taskId).then((data)=> {
42+
expect(this.alfrescoJsApi.activiti.taskFormsApi.apiClient.cookie).equal('ACTIVITI_REMEMBER_ME=NjdOdGwvcUtFTkVEczQyMGh4WFp5QT09OmpUL1UwdFVBTC94QTJMTFFUVFgvdFE9PQ');
43+
done();
44+
});
45+
});
46+
3747
});

0 commit comments

Comments
 (0)