bpmn-client 2.1.6 → 2.3.2
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/dist/BPMNClient.js +306 -295
- package/dist/BPMNClient2.js +263 -252
- package/dist/WebService.js +82 -82
- package/dist/cli.js +285 -279
- package/dist/index.js +20 -16
- package/dist/interfaces/API.js +2 -2
- package/dist/interfaces/DataObjects.js +2 -2
- package/dist/interfaces/Enums.js +116 -124
- package/dist/monitor.js +91 -91
- package/dist/remote-import.js +137 -137
- package/dist/setup.js +22 -22
- package/dist/test-raw.js +74 -73
- package/dist/test.js +85 -75
- package/dist/test2.js +52 -78
- package/dist/test3.js +42 -42
- package/dist/testFind.js +30 -0
- package/package.json +1 -1
package/dist/BPMNClient2.js
CHANGED
|
@@ -1,252 +1,263 @@
|
|
|
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.ClientModel2 = exports.ClientData2 = exports.ClientEngine2 = exports.BPMNClient2 = void 0;
|
|
13
|
-
const WebService_1 = require("./WebService");
|
|
14
|
-
class BPMNClient2 extends WebService_1.WebService {
|
|
15
|
-
constructor(host, port, apiKey) {
|
|
16
|
-
super();
|
|
17
|
-
this.host = host;
|
|
18
|
-
this.port = port;
|
|
19
|
-
this.apiKey = apiKey;
|
|
20
|
-
this.engine = new ClientEngine2(this);
|
|
21
|
-
this.data = new ClientData2(this);
|
|
22
|
-
this.model = new ClientModel2(this);
|
|
23
|
-
}
|
|
24
|
-
get(url, params) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
return yield this.request(url, 'GET', params);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
post(url, params) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
return yield this.request(url, 'POST', params);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
put(url, params) {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
return yield this.request(url, 'PUT', params);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
del(url, params) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
return yield this.request(url, 'DELETE', params);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
request(url, method, params) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
var body = JSON.stringify(params);
|
|
47
|
-
var size = Buffer.byteLength(body);
|
|
48
|
-
var contentType = "application/json";
|
|
49
|
-
if (method == 'UPLOAD') {
|
|
50
|
-
contentType = 'multipart/form-data; boundary = ----WebKitFormBoundary7MA4YWxkTrZu0gW';
|
|
51
|
-
method = 'POST';
|
|
52
|
-
}
|
|
53
|
-
var headers = {
|
|
54
|
-
"Content-Type": contentType,
|
|
55
|
-
"x-api-key": this.apiKey,
|
|
56
|
-
"Accept": "*/*",
|
|
57
|
-
// "User-Agent": "PostmanRuntime/ 7.26.8",
|
|
58
|
-
// "Accept-Encoding": "gzip, deflate, br",
|
|
59
|
-
"Connection": "keep-alive"
|
|
60
|
-
//,
|
|
61
|
-
// "Content-Length": Buffer.byteLength(body)
|
|
62
|
-
};
|
|
63
|
-
var options;
|
|
64
|
-
if (params) {
|
|
65
|
-
options = {
|
|
66
|
-
host: this.host,
|
|
67
|
-
port: this.port,
|
|
68
|
-
path: '/api2/' + url,
|
|
69
|
-
method: method,
|
|
70
|
-
headers: headers
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
options = {
|
|
75
|
-
host: this.host,
|
|
76
|
-
port: this.port,
|
|
77
|
-
path: '/api2/' + url,
|
|
78
|
-
method: method
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
return yield this.invoke(params, options);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
exports.BPMNClient2 = BPMNClient2;
|
|
86
|
-
class ClientEngine2 {
|
|
87
|
-
constructor(client) {
|
|
88
|
-
this.client = client;
|
|
89
|
-
}
|
|
90
|
-
start(
|
|
91
|
-
return __awaiter(this,
|
|
92
|
-
const ret = yield this.client.post('engine/start', { name, data, user, options });
|
|
93
|
-
if (ret['errors']) {
|
|
94
|
-
console.log(ret['errors']);
|
|
95
|
-
throw new Error(ret['errors']);
|
|
96
|
-
}
|
|
97
|
-
const instance = ret;
|
|
98
|
-
return instance;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
invoke(
|
|
102
|
-
return __awaiter(this,
|
|
103
|
-
console.log('invoke', options);
|
|
104
|
-
const ret = yield this.client.put('engine/invoke', { query, data, user, options });
|
|
105
|
-
if (ret['errors']) {
|
|
106
|
-
console.log(ret['errors']);
|
|
107
|
-
throw new Error(ret['errors']);
|
|
108
|
-
}
|
|
109
|
-
const instance = ret['instance'];
|
|
110
|
-
return instance;
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
assign(query, data, assignment, user) {
|
|
114
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
-
const ret = yield this.client.put('engine/assign', { query, data, assignment, user });
|
|
116
|
-
if (ret['errors']) {
|
|
117
|
-
console.log(ret['errors']);
|
|
118
|
-
throw new Error(ret['errors']);
|
|
119
|
-
}
|
|
120
|
-
const instance = ret['instance'];
|
|
121
|
-
return instance;
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
throwMessage(
|
|
125
|
-
return __awaiter(this,
|
|
126
|
-
const ret = yield this.client.post('engine/throwMessage', { "messageId": messageId, "data": data, messageMatchingKey, user, options });
|
|
127
|
-
if (ret['errors']) {
|
|
128
|
-
console.log(ret['errors']);
|
|
129
|
-
throw new Error(ret['errors']);
|
|
130
|
-
}
|
|
131
|
-
return ret;
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
throwSignal(
|
|
135
|
-
return __awaiter(this,
|
|
136
|
-
const ret = yield this.client.post('engine/throwSignal', { "signalId": signalId, "data": data, messageMatchingKey, user, options });
|
|
137
|
-
if (ret['errors']) {
|
|
138
|
-
console.log(ret['errors']);
|
|
139
|
-
throw new Error(ret['errors']);
|
|
140
|
-
}
|
|
141
|
-
return ret;
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
exports.ClientEngine2 = ClientEngine2;
|
|
146
|
-
class ClientData2 {
|
|
147
|
-
constructor(client) {
|
|
148
|
-
this.client = client;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return __awaiter(this,
|
|
152
|
-
var res = yield this.client.get('
|
|
153
|
-
if (res
|
|
154
|
-
console.log(res
|
|
155
|
-
throw new Error(res
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
-
|
|
164
|
-
if (res['errors']) {
|
|
165
|
-
console.log(res['errors']);
|
|
166
|
-
throw new Error(res['errors']);
|
|
167
|
-
}
|
|
168
|
-
const
|
|
169
|
-
return
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
var
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return res;
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
225
|
-
const res = yield this.client.post('model/
|
|
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
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
-
const res = yield this.client.
|
|
237
|
-
if (res['errors']) {
|
|
238
|
-
console.log(res['errors']);
|
|
239
|
-
throw new Error(res['errors']);
|
|
240
|
-
}
|
|
241
|
-
console.log(res);
|
|
242
|
-
return res;
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
|
|
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.ClientModel2 = exports.ClientData2 = exports.ClientEngine2 = exports.BPMNClient2 = void 0;
|
|
13
|
+
const WebService_1 = require("./WebService");
|
|
14
|
+
class BPMNClient2 extends WebService_1.WebService {
|
|
15
|
+
constructor(host, port, apiKey) {
|
|
16
|
+
super();
|
|
17
|
+
this.host = host;
|
|
18
|
+
this.port = port;
|
|
19
|
+
this.apiKey = apiKey;
|
|
20
|
+
this.engine = new ClientEngine2(this);
|
|
21
|
+
this.data = new ClientData2(this);
|
|
22
|
+
this.model = new ClientModel2(this);
|
|
23
|
+
}
|
|
24
|
+
get(url, params) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
return yield this.request(url, 'GET', params);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
post(url, params) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
return yield this.request(url, 'POST', params);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
put(url, params) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
return yield this.request(url, 'PUT', params);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
del(url, params) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
return yield this.request(url, 'DELETE', params);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
request(url, method, params) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
var body = JSON.stringify(params);
|
|
47
|
+
var size = Buffer.byteLength(body);
|
|
48
|
+
var contentType = "application/json";
|
|
49
|
+
if (method == 'UPLOAD') {
|
|
50
|
+
contentType = 'multipart/form-data; boundary = ----WebKitFormBoundary7MA4YWxkTrZu0gW';
|
|
51
|
+
method = 'POST';
|
|
52
|
+
}
|
|
53
|
+
var headers = {
|
|
54
|
+
"Content-Type": contentType,
|
|
55
|
+
"x-api-key": this.apiKey,
|
|
56
|
+
"Accept": "*/*",
|
|
57
|
+
// "User-Agent": "PostmanRuntime/ 7.26.8",
|
|
58
|
+
// "Accept-Encoding": "gzip, deflate, br",
|
|
59
|
+
"Connection": "keep-alive"
|
|
60
|
+
//,
|
|
61
|
+
// "Content-Length": Buffer.byteLength(body)
|
|
62
|
+
};
|
|
63
|
+
var options;
|
|
64
|
+
if (params) {
|
|
65
|
+
options = {
|
|
66
|
+
host: this.host,
|
|
67
|
+
port: this.port,
|
|
68
|
+
path: '/api2/' + url,
|
|
69
|
+
method: method,
|
|
70
|
+
headers: headers
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
options = {
|
|
75
|
+
host: this.host,
|
|
76
|
+
port: this.port,
|
|
77
|
+
path: '/api2/' + url,
|
|
78
|
+
method: method
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return yield this.invoke(params, options);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.BPMNClient2 = BPMNClient2;
|
|
86
|
+
class ClientEngine2 {
|
|
87
|
+
constructor(client) {
|
|
88
|
+
this.client = client;
|
|
89
|
+
}
|
|
90
|
+
start(name_1) {
|
|
91
|
+
return __awaiter(this, arguments, void 0, function* (name, data = {}, user, options = {}) {
|
|
92
|
+
const ret = yield this.client.post('engine/start', { name, data, user, options });
|
|
93
|
+
if (ret['errors']) {
|
|
94
|
+
console.log(ret['errors']);
|
|
95
|
+
throw new Error(ret['errors']);
|
|
96
|
+
}
|
|
97
|
+
const instance = ret;
|
|
98
|
+
return instance;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
invoke(query_1, data_1, user_1) {
|
|
102
|
+
return __awaiter(this, arguments, void 0, function* (query, data, user, options = {}) {
|
|
103
|
+
console.log('invoke', options);
|
|
104
|
+
const ret = yield this.client.put('engine/invoke', { query, data, user, options });
|
|
105
|
+
if (ret['errors']) {
|
|
106
|
+
console.log(ret['errors']);
|
|
107
|
+
throw new Error(ret['errors']);
|
|
108
|
+
}
|
|
109
|
+
const instance = ret['instance'];
|
|
110
|
+
return instance;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
assign(query, data, assignment, user) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
const ret = yield this.client.put('engine/assign', { query, data, assignment, user });
|
|
116
|
+
if (ret['errors']) {
|
|
117
|
+
console.log(ret['errors']);
|
|
118
|
+
throw new Error(ret['errors']);
|
|
119
|
+
}
|
|
120
|
+
const instance = ret['instance'];
|
|
121
|
+
return instance;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
throwMessage(messageId_1) {
|
|
125
|
+
return __awaiter(this, arguments, void 0, function* (messageId, data = {}, messageMatchingKey = {}, user, options) {
|
|
126
|
+
const ret = yield this.client.post('engine/throwMessage', { "messageId": messageId, "data": data, messageMatchingKey, user, options });
|
|
127
|
+
if (ret['errors']) {
|
|
128
|
+
console.log(ret['errors']);
|
|
129
|
+
throw new Error(ret['errors']);
|
|
130
|
+
}
|
|
131
|
+
return ret;
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
throwSignal(signalId_1) {
|
|
135
|
+
return __awaiter(this, arguments, void 0, function* (signalId, data = {}, messageMatchingKey = {}, user, options) {
|
|
136
|
+
const ret = yield this.client.post('engine/throwSignal', { "signalId": signalId, "data": data, messageMatchingKey, user, options });
|
|
137
|
+
if (ret['errors']) {
|
|
138
|
+
console.log(ret['errors']);
|
|
139
|
+
throw new Error(ret['errors']);
|
|
140
|
+
}
|
|
141
|
+
return ret;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
exports.ClientEngine2 = ClientEngine2;
|
|
146
|
+
class ClientData2 {
|
|
147
|
+
constructor(client) {
|
|
148
|
+
this.client = client;
|
|
149
|
+
}
|
|
150
|
+
find(_a) {
|
|
151
|
+
return __awaiter(this, arguments, void 0, function* ({ filter, sort, limit, after, projection, getTotalCount, user }) {
|
|
152
|
+
var res = yield this.client.get('datastore/find', { filter, after, limit, sort, projection, getTotalCount });
|
|
153
|
+
if (res.error) {
|
|
154
|
+
console.log(res.error);
|
|
155
|
+
throw new Error(res.error);
|
|
156
|
+
throw new Error(res['errors']);
|
|
157
|
+
}
|
|
158
|
+
return res;
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
findItems(query, user) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
var res = yield this.client.get('data/findItems', { query, user });
|
|
164
|
+
if (res['errors']) {
|
|
165
|
+
console.log(res['errors']);
|
|
166
|
+
throw new Error(res['errors']);
|
|
167
|
+
}
|
|
168
|
+
const items = res['items'];
|
|
169
|
+
return items;
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
findInstances(query, user) {
|
|
173
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
174
|
+
const res = yield this.client.get('data/findInstances', { query, user });
|
|
175
|
+
if (res['errors']) {
|
|
176
|
+
console.log(res['errors']);
|
|
177
|
+
throw new Error(res['errors']);
|
|
178
|
+
}
|
|
179
|
+
const instances = res['instances'];
|
|
180
|
+
return instances;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
deleteInstances(query, user) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
return yield this.client.del('data/deleteInstances', { query, user });
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
exports.ClientData2 = ClientData2;
|
|
190
|
+
class ClientModel2 {
|
|
191
|
+
constructor(client) {
|
|
192
|
+
this.client = client;
|
|
193
|
+
}
|
|
194
|
+
import(name_1, pathToBPMN_1) {
|
|
195
|
+
return __awaiter(this, arguments, void 0, function* (name, pathToBPMN, pathToSVG = null, user) {
|
|
196
|
+
var options = {
|
|
197
|
+
'method': 'POST',
|
|
198
|
+
'host': this.client.host,
|
|
199
|
+
'port': this.client.port,
|
|
200
|
+
'path': '/api/model/import/' + name,
|
|
201
|
+
'headers': {
|
|
202
|
+
'x-api-key': this.client.apiKey
|
|
203
|
+
},
|
|
204
|
+
'maxRedirects': 20
|
|
205
|
+
};
|
|
206
|
+
console.log('import ', name, pathToBPMN, pathToSVG);
|
|
207
|
+
var res = yield this.client.upload(name, pathToBPMN, pathToSVG, options);
|
|
208
|
+
console.log('import done ', res);
|
|
209
|
+
this.checkErrors(res);
|
|
210
|
+
return res;
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
list() {
|
|
214
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
var res = yield this.client.get('model/list', []);
|
|
216
|
+
if (res['errors']) {
|
|
217
|
+
console.log(res['errors']);
|
|
218
|
+
throw new Error(res['errors']);
|
|
219
|
+
}
|
|
220
|
+
return res;
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
delete(name) {
|
|
224
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
225
|
+
const res = yield this.client.post('model/delete/', { 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
|
+
rename(name, newName) {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
+
const res = yield this.client.post('model/rename/', { name, newName });
|
|
237
|
+
if (res['errors']) {
|
|
238
|
+
console.log(res['errors']);
|
|
239
|
+
throw new Error(res['errors']);
|
|
240
|
+
}
|
|
241
|
+
console.log(res);
|
|
242
|
+
return res;
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
load(name) {
|
|
246
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
247
|
+
const res = yield this.client.get(encodeURI('model/load/' + name), { name });
|
|
248
|
+
if (res['errors']) {
|
|
249
|
+
console.log(res['errors']);
|
|
250
|
+
throw new Error(res['errors']);
|
|
251
|
+
}
|
|
252
|
+
console.log(res);
|
|
253
|
+
return res;
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
checkErrors(res) {
|
|
257
|
+
if (res['errors']) {
|
|
258
|
+
console.log(res['errors']);
|
|
259
|
+
throw new Error(res['errors']);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
exports.ClientModel2 = ClientModel2;
|