bpmn-client 1.0.2 → 1.2.1
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/.env +4 -0
- package/Sample/.env +4 -0
- package/Sample/CarExample.js +62 -0
- package/Sample/CarExample.ts +97 -0
- package/Sample/package.json +44 -0
- package/Sample/test.js +33 -0
- package/Sample/test.ts +32 -0
- package/Sample/tsconfig.json +17 -0
- package/index.js +10 -18
- package/index.ts +1 -139
- package/package.json +9 -25
- package/src/BPMNClient.js +235 -0
- package/src/BPMNClient.ts +236 -0
- package/src/index.js +15 -0
- package/src/index.ts +4 -0
- package/src/interfaces/DataObjects.js +2 -0
- package/src/interfaces/DataObjects.ts +97 -0
- package/src/interfaces/Enums.js +117 -0
- package/src/interfaces/Enums.ts +71 -0
- package/test/.eslintrc.json +20 -0
- package/test/feature/.env +5 -0
- package/test/feature/carServer.js +117 -0
- package/test/helpers/setup.js +9 -0
- package/test/logs/Buy Used Carrepairsfalse cleaning +0 -0
- package/test/logs/Buy Used Carrepairstrue cleaning +0 -0
- package/test/logs/Buy Used Carscenario CaseId +0 -0
- package/test/logs/carrepairsfalse cleaning +0 -0
- package/test/logs/carrepairstrue cleaning +0 -0
- package/test/mocha.opts +5 -0
- package/test/resources/Invoice.js +91 -0
- package/test/resources/car.js +69 -0
- package/test/resources/loop.js +50 -0
- package/test.js +64 -0
- package/test.ts +94 -4
- package/test2.js +270 -0
- package/test2.ts +326 -0
- package/tsconfig.json +4 -4
- package/BPMNClient.d.ts +0 -36
- package/BPMNClient.js +0 -144
- package/BPMNClient.js.map +0 -1
- package/BPMNClient.ts +0 -139
- package/index.d.ts +0 -1
- package/index.js.map +0 -1
- package/npm.list +0 -579
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ClientDefinitions = exports.ClientDatastore = exports.ClientEngine = exports.BPMNClient = void 0;
|
|
13
|
+
console.log("BPMNClient 1.2");
|
|
14
|
+
const https = require('https');
|
|
15
|
+
const http = require('http');
|
|
16
|
+
class WebService {
|
|
17
|
+
constructor() { }
|
|
18
|
+
invoke(params, options) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
var driver = http;
|
|
21
|
+
var body = JSON.stringify(params);
|
|
22
|
+
console.log(options, params);
|
|
23
|
+
if (options.port == 443)
|
|
24
|
+
driver = https;
|
|
25
|
+
let data = '';
|
|
26
|
+
let self = this;
|
|
27
|
+
return new Promise(function (resolve, reject) {
|
|
28
|
+
try {
|
|
29
|
+
driver.request(options, function (res) {
|
|
30
|
+
console.log('STATUS: ' + res.statusCode);
|
|
31
|
+
//console.log(res);
|
|
32
|
+
self.statusCode = res.statusCode;
|
|
33
|
+
res.setEncoding('utf8');
|
|
34
|
+
res.on('data', function (chunk) {
|
|
35
|
+
data += chunk;
|
|
36
|
+
});
|
|
37
|
+
res.on('end', () => {
|
|
38
|
+
self.result = JSON.parse(data);
|
|
39
|
+
resolve(self.result);
|
|
40
|
+
});
|
|
41
|
+
}).on("error", (err) => {
|
|
42
|
+
console.log("Error: " + err.message);
|
|
43
|
+
reject(err);
|
|
44
|
+
}).end(body);
|
|
45
|
+
}
|
|
46
|
+
catch (exc) {
|
|
47
|
+
console.log(exc);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
class BPMNClient extends WebService {
|
|
54
|
+
constructor(host, port, apiKey) {
|
|
55
|
+
super();
|
|
56
|
+
this.host = host;
|
|
57
|
+
this.port = port;
|
|
58
|
+
this.apiKey = apiKey;
|
|
59
|
+
this.engine = new ClientEngine(this);
|
|
60
|
+
this.datastore = new ClientDatastore(this);
|
|
61
|
+
this.definitions = new ClientDefinitions(this);
|
|
62
|
+
}
|
|
63
|
+
get(url, data = {}) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
return yield this.request(url, 'GET', data);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
post(url, data = {}) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
return yield this.request(url, 'POST', data);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
put(url, data = {}) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
return yield this.request(url, 'PUT', data);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
del(url, data = {}) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
return yield this.request(url, 'DELETE', data);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
request(url, method, params) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
var body = JSON.stringify(params);
|
|
86
|
+
var options;
|
|
87
|
+
if (params) {
|
|
88
|
+
options = {
|
|
89
|
+
host: this.host,
|
|
90
|
+
port: this.port,
|
|
91
|
+
path: '/api/' + url,
|
|
92
|
+
method: method,
|
|
93
|
+
headers: {
|
|
94
|
+
"Content-Type": "application/json",
|
|
95
|
+
"x-api-key": this.apiKey,
|
|
96
|
+
"Accept": "*/*",
|
|
97
|
+
// "User-Agent": "PostmanRuntime/ 7.26.8",
|
|
98
|
+
// "Accept-Encoding": "gzip, deflate, br",
|
|
99
|
+
"Connection": "keep-alive",
|
|
100
|
+
"Content-Length": Buffer.byteLength(body)
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
options = {
|
|
106
|
+
host: this.host,
|
|
107
|
+
port: this.port,
|
|
108
|
+
path: '/api/' + url,
|
|
109
|
+
method: method
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return yield this.invoke(params, options);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.BPMNClient = BPMNClient;
|
|
117
|
+
class ClientEngine {
|
|
118
|
+
constructor(client) {
|
|
119
|
+
this.client = client;
|
|
120
|
+
}
|
|
121
|
+
start(name, data = {}, startNodeId = null, options = {}) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
const ret = yield this.client.post('engine/start', { name, data, startNodeId, options });
|
|
124
|
+
if (ret['errors']) {
|
|
125
|
+
console.log(ret['errors']);
|
|
126
|
+
throw new Error(ret['errors']);
|
|
127
|
+
}
|
|
128
|
+
const instance = ret;
|
|
129
|
+
return instance;
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
invoke(query, data) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
const ret = yield this.client.put('engine/invoke', { query, data });
|
|
135
|
+
if (ret['errors']) {
|
|
136
|
+
console.log(ret['errors']);
|
|
137
|
+
throw new Error(ret['errors']);
|
|
138
|
+
}
|
|
139
|
+
const instance = ret['instance'];
|
|
140
|
+
return instance;
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
throwMessage(messageId, data) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
const ret = yield this.client.put('engine/throwMessage', { "messageId": messageId, "data": data });
|
|
146
|
+
if (ret['errors']) {
|
|
147
|
+
console.log(ret['errors']);
|
|
148
|
+
throw new Error(ret['errors']);
|
|
149
|
+
}
|
|
150
|
+
return ret;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
throwSignal(signalId, data) {
|
|
154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
const ret = yield this.client.put('engine/throwSignal', { "signalId": signalId, "data": data });
|
|
156
|
+
if (ret['errors']) {
|
|
157
|
+
console.log(ret['errors']);
|
|
158
|
+
throw new Error(ret['errors']);
|
|
159
|
+
}
|
|
160
|
+
return ret;
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
get(query) {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
const ret = yield this.client.get('engine/get', query);
|
|
166
|
+
if (ret['errors']) {
|
|
167
|
+
console.log(ret['errors']);
|
|
168
|
+
throw new Error(ret['errors']);
|
|
169
|
+
}
|
|
170
|
+
const instance = ret['instance'];
|
|
171
|
+
return instance;
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
exports.ClientEngine = ClientEngine;
|
|
176
|
+
class ClientDatastore {
|
|
177
|
+
constructor(client) {
|
|
178
|
+
this.client = client;
|
|
179
|
+
}
|
|
180
|
+
findItems(query) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
var res = yield this.client.get('datastore/findItems', query);
|
|
183
|
+
if (res['errors']) {
|
|
184
|
+
console.log(res['errors']);
|
|
185
|
+
throw new Error(res['errors']);
|
|
186
|
+
}
|
|
187
|
+
const items = res['items'];
|
|
188
|
+
return items;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
findInstances(query) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
const res = yield this.client.get('datastore/findInstances', query);
|
|
194
|
+
if (res['errors']) {
|
|
195
|
+
console.log(res['errors']);
|
|
196
|
+
throw new Error(res['errors']);
|
|
197
|
+
}
|
|
198
|
+
const instances = res['instances'];
|
|
199
|
+
return instances;
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
deleteInstances(query) {
|
|
203
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
204
|
+
return yield this.client.del('datastore/delete', query);
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
exports.ClientDatastore = ClientDatastore;
|
|
209
|
+
class ClientDefinitions {
|
|
210
|
+
constructor(client) {
|
|
211
|
+
this.client = client;
|
|
212
|
+
}
|
|
213
|
+
list() {
|
|
214
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
var res = yield this.client.get('definitions/list', []);
|
|
216
|
+
if (res['errors']) {
|
|
217
|
+
console.log(res['errors']);
|
|
218
|
+
throw new Error(res['errors']);
|
|
219
|
+
}
|
|
220
|
+
return res;
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
load(name) {
|
|
224
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
225
|
+
const res = yield this.client.get(encodeURI('definitions/load/' + name), { name: name });
|
|
226
|
+
if (res['errors']) {
|
|
227
|
+
console.log(res['errors']);
|
|
228
|
+
throw new Error(res['errors']);
|
|
229
|
+
}
|
|
230
|
+
console.log(res);
|
|
231
|
+
return res;
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
exports.ClientDefinitions = ClientDefinitions;
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { IInstanceData, IItemData , IDefinitionData} from './interfaces/DataObjects';
|
|
2
|
+
|
|
3
|
+
console.log("BPMNClient 1.2");
|
|
4
|
+
|
|
5
|
+
const https = require('https');
|
|
6
|
+
const http = require('http');
|
|
7
|
+
|
|
8
|
+
class WebService {
|
|
9
|
+
statusCode;
|
|
10
|
+
result;
|
|
11
|
+
constructor() { }
|
|
12
|
+
async invoke(params, options) {
|
|
13
|
+
|
|
14
|
+
var driver = http;
|
|
15
|
+
var body = JSON.stringify(params);
|
|
16
|
+
|
|
17
|
+
console.log(options, params);
|
|
18
|
+
if (options.port == 443)
|
|
19
|
+
driver = https;
|
|
20
|
+
|
|
21
|
+
let data = '';
|
|
22
|
+
let self = this;
|
|
23
|
+
return new Promise(function (resolve, reject) {
|
|
24
|
+
try {
|
|
25
|
+
|
|
26
|
+
driver.request(options, function (res) {
|
|
27
|
+
console.log('STATUS: ' + res.statusCode);
|
|
28
|
+
//console.log(res);
|
|
29
|
+
self.statusCode = res.statusCode;
|
|
30
|
+
res.setEncoding('utf8');
|
|
31
|
+
res.on('data', function (chunk) {
|
|
32
|
+
data += chunk;
|
|
33
|
+
});
|
|
34
|
+
res.on('end', () => {
|
|
35
|
+
self.result = JSON.parse(data);
|
|
36
|
+
|
|
37
|
+
resolve(self.result);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
}).on("error", (err) => {
|
|
42
|
+
console.log("Error: " + err.message);
|
|
43
|
+
reject(err);
|
|
44
|
+
}).end(body);
|
|
45
|
+
}
|
|
46
|
+
catch (exc) {
|
|
47
|
+
console.log(exc);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
class BPMNClient extends WebService {
|
|
55
|
+
host;
|
|
56
|
+
port;
|
|
57
|
+
apiKey;
|
|
58
|
+
engine: ClientEngine;
|
|
59
|
+
datastore: ClientDatastore;
|
|
60
|
+
definitions: ClientDefinitions;
|
|
61
|
+
|
|
62
|
+
constructor(host, port, apiKey) {
|
|
63
|
+
super();
|
|
64
|
+
this.host = host;
|
|
65
|
+
this.port = port;
|
|
66
|
+
this.apiKey = apiKey;
|
|
67
|
+
this.engine = new ClientEngine(this);
|
|
68
|
+
this.datastore = new ClientDatastore(this);
|
|
69
|
+
this.definitions = new ClientDefinitions(this);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async get(url, data = {}) {
|
|
73
|
+
return await this.request(url, 'GET', data);
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
async post(url, data = {}) {
|
|
77
|
+
return await this.request(url, 'POST', data);
|
|
78
|
+
|
|
79
|
+
}
|
|
80
|
+
async put(url, data = {}) {
|
|
81
|
+
return await this.request(url, 'PUT', data);
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
async del(url, data = {}) {
|
|
85
|
+
return await this.request(url, 'DELETE', data);
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
async request(url, method, params) {
|
|
89
|
+
|
|
90
|
+
var body = JSON.stringify(params);
|
|
91
|
+
|
|
92
|
+
var options;
|
|
93
|
+
|
|
94
|
+
if (params) {
|
|
95
|
+
options = {
|
|
96
|
+
host: this.host,
|
|
97
|
+
port: this.port,
|
|
98
|
+
path: '/api/' + url,
|
|
99
|
+
method: method,
|
|
100
|
+
headers: {
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
"x-api-key": this.apiKey,
|
|
103
|
+
"Accept": "*/*",
|
|
104
|
+
// "User-Agent": "PostmanRuntime/ 7.26.8",
|
|
105
|
+
// "Accept-Encoding": "gzip, deflate, br",
|
|
106
|
+
"Connection": "keep-alive",
|
|
107
|
+
"Content-Length": Buffer.byteLength(body)
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
options = {
|
|
113
|
+
host: this.host,
|
|
114
|
+
port: this.port,
|
|
115
|
+
path: '/api/' + url,
|
|
116
|
+
method: method
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
return await this.invoke(params, options);
|
|
122
|
+
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
class ClientEngine {
|
|
128
|
+
private client: BPMNClient;
|
|
129
|
+
|
|
130
|
+
constructor(client) {
|
|
131
|
+
this.client = client;
|
|
132
|
+
}
|
|
133
|
+
async start(name, data = {} , startNodeId = null, options = {}): Promise<IInstanceData> {
|
|
134
|
+
const ret = await this.client.post('engine/start',
|
|
135
|
+
{ name, data, startNodeId, options });
|
|
136
|
+
if (ret['errors']) {
|
|
137
|
+
console.log(ret['errors']);
|
|
138
|
+
throw new Error(ret['errors']);
|
|
139
|
+
}
|
|
140
|
+
const instance = ret as IInstanceData;
|
|
141
|
+
return instance;
|
|
142
|
+
}
|
|
143
|
+
async invoke(query, data): Promise<IInstanceData> {
|
|
144
|
+
const ret = await this.client.put('engine/invoke', { query, data });
|
|
145
|
+
if (ret['errors']) {
|
|
146
|
+
console.log(ret['errors']);
|
|
147
|
+
throw new Error(ret['errors']);
|
|
148
|
+
}
|
|
149
|
+
const instance = ret['instance'] as IInstanceData;
|
|
150
|
+
return instance;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
async throwMessage(messageId, data) {
|
|
154
|
+
const ret = await this.client.put('engine/throwMessage', { "messageId": messageId , "data": data });
|
|
155
|
+
if (ret['errors']) {
|
|
156
|
+
console.log(ret['errors']);
|
|
157
|
+
throw new Error(ret['errors']);
|
|
158
|
+
}
|
|
159
|
+
return ret;
|
|
160
|
+
}
|
|
161
|
+
async throwSignal(signalId, data) {
|
|
162
|
+
const ret = await this.client.put('engine/throwSignal', { "signalId": signalId, "data": data });
|
|
163
|
+
if (ret['errors']) {
|
|
164
|
+
console.log(ret['errors']);
|
|
165
|
+
throw new Error(ret['errors']);
|
|
166
|
+
}
|
|
167
|
+
return ret;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
async get(query): Promise<IInstanceData> {
|
|
171
|
+
const ret = await this.client.get('engine/get', query);
|
|
172
|
+
if (ret['errors']) {
|
|
173
|
+
console.log(ret['errors']);
|
|
174
|
+
throw new Error(ret['errors']);
|
|
175
|
+
}
|
|
176
|
+
const instance = ret['instance'] as IInstanceData;
|
|
177
|
+
return instance;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
class ClientDatastore {
|
|
181
|
+
private client: BPMNClient;
|
|
182
|
+
|
|
183
|
+
constructor(client) {
|
|
184
|
+
this.client = client;
|
|
185
|
+
}
|
|
186
|
+
async findItems(query): Promise<IItemData[]> {
|
|
187
|
+
var res = await this.client.get('datastore/findItems', query);
|
|
188
|
+
if (res['errors']) {
|
|
189
|
+
console.log(res['errors']);
|
|
190
|
+
throw new Error(res['errors']);
|
|
191
|
+
}
|
|
192
|
+
const items = res['items'] as IItemData[];
|
|
193
|
+
return items;
|
|
194
|
+
|
|
195
|
+
}
|
|
196
|
+
async findInstances(query): Promise<IInstanceData[]> {
|
|
197
|
+
const res = await this.client.get('datastore/findInstances', query);
|
|
198
|
+
if (res['errors']) {
|
|
199
|
+
console.log(res['errors']);
|
|
200
|
+
throw new Error(res['errors']);
|
|
201
|
+
}
|
|
202
|
+
const instances = res['instances'] as IInstanceData[];
|
|
203
|
+
return instances;
|
|
204
|
+
}
|
|
205
|
+
async deleteInstances(query) {
|
|
206
|
+
return await this.client.del('datastore/delete', query);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
class ClientDefinitions {
|
|
210
|
+
private client: BPMNClient;
|
|
211
|
+
|
|
212
|
+
constructor(client) {
|
|
213
|
+
this.client = client;
|
|
214
|
+
}
|
|
215
|
+
async list(): Promise<string[]> {
|
|
216
|
+
var res = await this.client.get('definitions/list', []);
|
|
217
|
+
if (res['errors']) {
|
|
218
|
+
console.log(res['errors']);
|
|
219
|
+
throw new Error(res['errors']);
|
|
220
|
+
}
|
|
221
|
+
return res as string[];
|
|
222
|
+
|
|
223
|
+
}
|
|
224
|
+
async load(name): Promise<IDefinitionData> {
|
|
225
|
+
const res = await this.client.get(encodeURI('definitions/load/' + name), { name: name });
|
|
226
|
+
if (res['errors']) {
|
|
227
|
+
console.log(res['errors']);
|
|
228
|
+
throw new Error(res['errors']);
|
|
229
|
+
}
|
|
230
|
+
console.log(res);
|
|
231
|
+
return res as IDefinitionData;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
export { BPMNClient , ClientEngine,ClientDatastore , ClientDefinitions}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./interfaces/Enums"), exports);
|
|
14
|
+
__exportStar(require("./interfaces/DataObjects"), exports);
|
|
15
|
+
__exportStar(require("./BPMNClient"), exports);
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ITEM_STATUS, } from './Enums';
|
|
2
|
+
|
|
3
|
+
interface IItemData {
|
|
4
|
+
id: string; // System generated unique Id
|
|
5
|
+
itemKey: string; // application assigned key to call the item by
|
|
6
|
+
elementId: string; // bpmn element
|
|
7
|
+
name: string; // name of bpmn element
|
|
8
|
+
type: string; // bpmn element type
|
|
9
|
+
tokenId: any; // execution Token
|
|
10
|
+
userId: any;
|
|
11
|
+
startedAt: any;
|
|
12
|
+
endedAt: any;
|
|
13
|
+
seq: any;
|
|
14
|
+
timeDue: Date;
|
|
15
|
+
status: ITEM_STATUS;
|
|
16
|
+
data: any;
|
|
17
|
+
messageId;
|
|
18
|
+
signalId;
|
|
19
|
+
assignments;
|
|
20
|
+
authorizations;
|
|
21
|
+
notifications;
|
|
22
|
+
}
|
|
23
|
+
interface IInstanceData {
|
|
24
|
+
id;
|
|
25
|
+
name;
|
|
26
|
+
status;
|
|
27
|
+
startedAt;
|
|
28
|
+
endedAt;
|
|
29
|
+
saved;
|
|
30
|
+
data;
|
|
31
|
+
items;
|
|
32
|
+
source;
|
|
33
|
+
logs;
|
|
34
|
+
tokens;
|
|
35
|
+
loops;
|
|
36
|
+
parentItemId; // used for subProcess Calls
|
|
37
|
+
involvements;
|
|
38
|
+
authorizations;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
interface IDefinitionData {
|
|
44
|
+
name: any;
|
|
45
|
+
processes: Map<any, any>;
|
|
46
|
+
rootElements: any;
|
|
47
|
+
nodes: Map<any, any>;
|
|
48
|
+
flows: any[];
|
|
49
|
+
source: any;
|
|
50
|
+
logger: any;
|
|
51
|
+
accessRules: any[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
interface IElementData {
|
|
56
|
+
id: any;
|
|
57
|
+
type: any;
|
|
58
|
+
name: any;
|
|
59
|
+
behaviours: Map<any, any>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface IFlowData {
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface IEventData {
|
|
67
|
+
elementId: string;
|
|
68
|
+
processId: string;
|
|
69
|
+
type;
|
|
70
|
+
name;
|
|
71
|
+
subType;
|
|
72
|
+
signalId?: string;
|
|
73
|
+
messageId?: string;
|
|
74
|
+
// timer info
|
|
75
|
+
expression;
|
|
76
|
+
expressionFormat; // cron/iso
|
|
77
|
+
referenceDateTime; // start time of event or last time timer ran
|
|
78
|
+
maxRepeat;
|
|
79
|
+
repeatCount;
|
|
80
|
+
timeDue?: Date;
|
|
81
|
+
|
|
82
|
+
}
|
|
83
|
+
interface IBpmnModelData {
|
|
84
|
+
name;
|
|
85
|
+
source;
|
|
86
|
+
svg;
|
|
87
|
+
processes: IProcessData[];
|
|
88
|
+
events: IEventData[];
|
|
89
|
+
saved;
|
|
90
|
+
// parse(definition: IDefinition);
|
|
91
|
+
}
|
|
92
|
+
interface IProcessData {
|
|
93
|
+
id;
|
|
94
|
+
name;
|
|
95
|
+
isExecutable;
|
|
96
|
+
}
|
|
97
|
+
export { IItemData, IInstanceData , IDefinitionData, IElementData, IFlowData , IBpmnModelData, IProcessData, IEventData }
|