bpmn-client 1.3.15 → 1.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/remote-import.js +11 -3
- package/remote-import.ts +15 -5
- package/src/BPMNClient.js +2 -1
- package/src/BPMNClient.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpmn-client",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.16",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc --build",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"connect-busboy": "0.0.2",
|
|
30
30
|
"core-js": "^3.6.5",
|
|
31
|
-
"dotenv": "^16.0.1"
|
|
31
|
+
"dotenv": "^16.0.1",
|
|
32
|
+
"follow-redirects": "^1.15.2"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@types/mime": "^1.3.1",
|
|
@@ -40,6 +41,5 @@
|
|
|
40
41
|
},
|
|
41
42
|
"engines": {
|
|
42
43
|
"node": ">=12.0.0"
|
|
43
|
-
|
|
44
44
|
}
|
|
45
45
|
}
|
package/remote-import.js
CHANGED
|
@@ -12,14 +12,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
//FromPostMan();
|
|
13
13
|
//request('test4', 'Trans.bpmn');
|
|
14
14
|
const _1 = require("./");
|
|
15
|
+
console.log('remote-import.ts');
|
|
15
16
|
fromClientLib();
|
|
17
|
+
console.log('-------------------');
|
|
16
18
|
//FromPostMan();
|
|
17
19
|
function fromClientLib() {
|
|
18
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
|
|
21
|
+
console.log('from client lib');
|
|
22
|
+
const server = new _1.BPMNClient('localhost', 3000, '12345');
|
|
20
23
|
var name = 'test-import';
|
|
21
24
|
var file = 'E:\\x4\\dev\\webApp\\processes\\Trans.bpmn';
|
|
22
|
-
server.definitions.import(name, file);
|
|
25
|
+
var res = yield server.definitions.import(name, file);
|
|
26
|
+
//console.log(res.length);
|
|
27
|
+
return res;
|
|
23
28
|
});
|
|
24
29
|
}
|
|
25
30
|
function FromPostMan() {
|
|
@@ -27,12 +32,13 @@ function FromPostMan() {
|
|
|
27
32
|
console.log("Testing Remote import");
|
|
28
33
|
var file = 'E:\\x4\\dev\\webApp\\processes\\Trans.bpmn';
|
|
29
34
|
var http = require('follow-redirects').http;
|
|
35
|
+
//const http = require('http');
|
|
30
36
|
var fs = require('fs');
|
|
31
37
|
var options = {
|
|
32
38
|
'method': 'POST',
|
|
33
39
|
'hostname': 'localhost',
|
|
34
40
|
'port': 3000,
|
|
35
|
-
'path': '/api/definitions/import/
|
|
41
|
+
'path': '/api/definitions/import/testing4',
|
|
36
42
|
'headers': {
|
|
37
43
|
'x-api-key': '12345',
|
|
38
44
|
'Cookie': 'connect.sid=s%3AXMa01DuOlQ4WsrvBj0FVaIrTak49vLPB.hDIV9j7ONA437rZf%2F%2Biu%2Bc6B7T5%2FVuEIjj1BAaoCJW4'
|
|
@@ -56,6 +62,7 @@ function FromPostMan() {
|
|
|
56
62
|
req.setHeader('content-type', 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');
|
|
57
63
|
req.write(postData);
|
|
58
64
|
req.end();
|
|
65
|
+
return req;
|
|
59
66
|
});
|
|
60
67
|
}
|
|
61
68
|
function request(name, path) {
|
|
@@ -93,5 +100,6 @@ function request(name, path) {
|
|
|
93
100
|
req.setHeader('content-type', 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');
|
|
94
101
|
req.write(postData);
|
|
95
102
|
req.end();
|
|
103
|
+
console.log('end');
|
|
96
104
|
});
|
|
97
105
|
}
|
package/remote-import.ts
CHANGED
|
@@ -4,18 +4,24 @@
|
|
|
4
4
|
import { BPMNClient } from './';
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
console.log('remote-import.ts');
|
|
7
8
|
|
|
8
9
|
fromClientLib();
|
|
10
|
+
|
|
11
|
+
console.log('-------------------');
|
|
9
12
|
//FromPostMan();
|
|
10
13
|
|
|
11
14
|
async function fromClientLib() {
|
|
12
|
-
|
|
15
|
+
|
|
16
|
+
console.log('from client lib');
|
|
17
|
+
const server = new BPMNClient('localhost', 3000, '12345');
|
|
13
18
|
|
|
14
19
|
var name = 'test-import';
|
|
15
20
|
var file = 'E:\\x4\\dev\\webApp\\processes\\Trans.bpmn';
|
|
16
21
|
|
|
17
|
-
server.definitions.import(name, file);
|
|
18
|
-
|
|
22
|
+
var res=await server.definitions.import(name, file);
|
|
23
|
+
//console.log(res.length);
|
|
24
|
+
return res;
|
|
19
25
|
}
|
|
20
26
|
async function FromPostMan() {
|
|
21
27
|
|
|
@@ -24,13 +30,15 @@ async function FromPostMan() {
|
|
|
24
30
|
|
|
25
31
|
|
|
26
32
|
var http = require('follow-redirects').http;
|
|
33
|
+
//const http = require('http');
|
|
34
|
+
|
|
27
35
|
var fs = require('fs');
|
|
28
36
|
|
|
29
37
|
var options = {
|
|
30
38
|
'method': 'POST',
|
|
31
39
|
'hostname': 'localhost',
|
|
32
40
|
'port': 3000,
|
|
33
|
-
'path': '/api/definitions/import/
|
|
41
|
+
'path': '/api/definitions/import/testing4',
|
|
34
42
|
'headers': {
|
|
35
43
|
'x-api-key': '12345',
|
|
36
44
|
'Cookie': 'connect.sid=s%3AXMa01DuOlQ4WsrvBj0FVaIrTak49vLPB.hDIV9j7ONA437rZf%2F%2Biu%2Bc6B7T5%2FVuEIjj1BAaoCJW4'
|
|
@@ -63,6 +71,8 @@ async function FromPostMan() {
|
|
|
63
71
|
|
|
64
72
|
req.end();
|
|
65
73
|
|
|
74
|
+
return req;
|
|
75
|
+
|
|
66
76
|
}
|
|
67
77
|
|
|
68
78
|
|
|
@@ -112,5 +122,5 @@ async function request(name,path) {
|
|
|
112
122
|
req.write(postData);
|
|
113
123
|
|
|
114
124
|
req.end();
|
|
115
|
-
|
|
125
|
+
console.log('end');
|
|
116
126
|
}
|
package/src/BPMNClient.js
CHANGED
|
@@ -99,7 +99,7 @@ class BPMNClient extends WebService {
|
|
|
99
99
|
'method': 'POST',
|
|
100
100
|
'hostname': this.host,
|
|
101
101
|
'port': this.port,
|
|
102
|
-
'path': url + '/' + fileName,
|
|
102
|
+
'path': '/api/' + url + '/' + fileName,
|
|
103
103
|
'headers': {
|
|
104
104
|
'x-api-key': this.apiKey
|
|
105
105
|
},
|
|
@@ -124,6 +124,7 @@ class BPMNClient extends WebService {
|
|
|
124
124
|
req.setHeader('content-type', 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');
|
|
125
125
|
req.write(postData);
|
|
126
126
|
req.end();
|
|
127
|
+
return req;
|
|
127
128
|
});
|
|
128
129
|
}
|
|
129
130
|
request(url, method, params) {
|
package/src/BPMNClient.ts
CHANGED
|
@@ -107,7 +107,7 @@ class BPMNClient extends WebService {
|
|
|
107
107
|
'method': 'POST',
|
|
108
108
|
'hostname': this.host,
|
|
109
109
|
'port': this.port,
|
|
110
|
-
'path': url + '/' + fileName,
|
|
110
|
+
'path': '/api/'+ url + '/' + fileName,
|
|
111
111
|
'headers': {
|
|
112
112
|
'x-api-key': this.apiKey
|
|
113
113
|
},
|
|
@@ -139,6 +139,8 @@ class BPMNClient extends WebService {
|
|
|
139
139
|
req.write(postData);
|
|
140
140
|
|
|
141
141
|
req.end();
|
|
142
|
+
|
|
143
|
+
return req;
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
|