@privateaim/core-http-kit 0.8.21 → 0.8.23

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/index.mjs CHANGED
@@ -1,184 +1,57 @@
1
- import { createClient, isClient, Client as Client$1, HookName, isClientError } from 'hapic';
1
+ import { isClient, createClient, Client as Client$1, HookName, isClientError } from 'hapic';
2
2
  export { isClientError, isClientErrorWithStatusCode } from 'hapic';
3
3
  import { buildQuery } from 'rapiq';
4
4
  import '@authup/kit';
5
5
  import { ServiceID } from '@privateaim/core-kit';
6
6
 
7
- /*
8
- * Copyright (c) 2023-2024.
9
- * Author Peter Placzek (tada5hi)
10
- * For the full copyright and license information,
11
- * view the LICENSE file that was distributed with this source code.
12
- */ function _define_property$5(obj, key, value) {
13
- if (key in obj) {
14
- Object.defineProperty(obj, key, {
15
- value: value,
16
- enumerable: true,
17
- configurable: true,
18
- writable: true
19
- });
20
- } else {
21
- obj[key] = value;
22
- }
23
- return obj;
24
- }
25
7
  class BaseAPI {
26
- // -----------------------------------------------------------------------------------
27
- setClient(input) {
28
- this.client = isClient(input) ? input : createClient(input);
29
- }
8
+ client;
30
9
  // -----------------------------------------------------------------------------------
31
10
  constructor(context){
32
- _define_property$5(this, "client", void 0);
33
11
  context = context || {};
34
12
  this.setClient(context.client);
35
13
  }
36
- }
37
-
38
- /*
39
- * Copyright (c) 2021-2024.
40
- * Author Peter Placzek (tada5hi)
41
- * For the full copyright and license information,
42
- * view the LICENSE file that was distributed with this source code.
43
- */ function asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, key, arg) {
44
- try {
45
- var info = gen[key](arg);
46
- var value = info.value;
47
- } catch (error) {
48
- reject(error);
49
- return;
50
- }
51
- if (info.done) {
52
- resolve(value);
53
- } else {
54
- Promise.resolve(value).then(_next, _throw);
14
+ // -----------------------------------------------------------------------------------
15
+ setClient(input) {
16
+ this.client = isClient(input) ? input : createClient(input);
55
17
  }
56
18
  }
57
- function _async_to_generator$f(fn) {
58
- return function() {
59
- var self = this, args = arguments;
60
- return new Promise(function(resolve, reject) {
61
- var gen = fn.apply(self, args);
62
- function _next(value) {
63
- asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, "next", value);
64
- }
65
- function _throw(err) {
66
- asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, "throw", err);
67
- }
68
- _next(undefined);
69
- });
70
- };
71
- }
19
+
72
20
  class MasterImageGroupAPI extends BaseAPI {
73
- getMany(data) {
74
- return _async_to_generator$f(function*() {
75
- const response = yield this.client.get(`master-image-groups${buildQuery(data)}`);
76
- return response.data;
77
- }).call(this);
78
- }
79
- getOne(id) {
80
- return _async_to_generator$f(function*() {
81
- const response = yield this.client.delete(`master-image-groups/${id}`);
82
- return response.data;
83
- }).call(this);
84
- }
85
- delete(id) {
86
- return _async_to_generator$f(function*() {
87
- const response = yield this.client.delete(`master-image-groups/${id}`);
88
- return response.data;
89
- }).call(this);
21
+ async getMany(data) {
22
+ const response = await this.client.get(`master-image-groups${buildQuery(data)}`);
23
+ return response.data;
24
+ }
25
+ async getOne(id) {
26
+ const response = await this.client.delete(`master-image-groups/${id}`);
27
+ return response.data;
28
+ }
29
+ async delete(id) {
30
+ const response = await this.client.delete(`master-image-groups/${id}`);
31
+ return response.data;
90
32
  }
91
33
  }
92
34
 
93
- /*
94
- * Copyright (c) 2021-2024.
95
- * Author Peter Placzek (tada5hi)
96
- * For the full copyright and license information,
97
- * view the LICENSE file that was distributed with this source code.
98
- */ function asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, key, arg) {
99
- try {
100
- var info = gen[key](arg);
101
- var value = info.value;
102
- } catch (error) {
103
- reject(error);
104
- return;
105
- }
106
- if (info.done) {
107
- resolve(value);
108
- } else {
109
- Promise.resolve(value).then(_next, _throw);
35
+ class MasterImageAPI extends BaseAPI {
36
+ async getMany(data) {
37
+ const response = await this.client.get(`master-images${buildQuery(data)}`);
38
+ return response.data;
110
39
  }
111
- }
112
- function _async_to_generator$e(fn) {
113
- return function() {
114
- var self = this, args = arguments;
115
- return new Promise(function(resolve, reject) {
116
- var gen = fn.apply(self, args);
117
- function _next(value) {
118
- asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, "next", value);
119
- }
120
- function _throw(err) {
121
- asyncGeneratorStep$e(gen, resolve, reject, _next, _throw, "throw", err);
122
- }
123
- _next(undefined);
124
- });
125
- };
126
- }
127
- function _define_property$4(obj, key, value) {
128
- if (key in obj) {
129
- Object.defineProperty(obj, key, {
130
- value: value,
131
- enumerable: true,
132
- configurable: true,
133
- writable: true
134
- });
135
- } else {
136
- obj[key] = value;
40
+ async getOne(id, data) {
41
+ const response = await this.client.get(`master-images/${id}${buildQuery(data)}`);
42
+ return response.data;
137
43
  }
138
- return obj;
139
- }
140
- function _object_spread$3(target) {
141
- for(var i = 1; i < arguments.length; i++){
142
- var source = arguments[i] != null ? arguments[i] : {};
143
- var ownKeys = Object.keys(source);
144
- if (typeof Object.getOwnPropertySymbols === "function") {
145
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
146
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
147
- }));
148
- }
149
- ownKeys.forEach(function(key) {
150
- _define_property$4(target, key, source[key]);
151
- });
44
+ async delete(id) {
45
+ const response = await this.client.delete(`master-images/${id}`);
46
+ return response.data;
152
47
  }
153
- return target;
154
- }
155
- class MasterImageAPI extends BaseAPI {
156
- getMany(data) {
157
- return _async_to_generator$e(function*() {
158
- const response = yield this.client.get(`master-images${buildQuery(data)}`);
159
- return response.data;
160
- }).call(this);
161
- }
162
- getOne(id, data) {
163
- return _async_to_generator$e(function*() {
164
- const response = yield this.client.get(`master-images/${id}${buildQuery(data)}`);
165
- return response.data;
166
- }).call(this);
167
- }
168
- delete(id) {
169
- return _async_to_generator$e(function*() {
170
- const response = yield this.client.delete(`master-images/${id}`);
171
- return response.data;
172
- }).call(this);
173
- }
174
- runCommand(_0) {
175
- return _async_to_generator$e(function*(command, data = {}) {
176
- const actionData = _object_spread$3({
177
- command
178
- }, data);
179
- const { data: response } = yield this.client.post('master-images/command', actionData);
180
- return response;
181
- }).apply(this, arguments);
48
+ async runCommand(command, data = {}) {
49
+ const actionData = {
50
+ command,
51
+ ...data
52
+ };
53
+ const { data: response } = await this.client.post('master-images/command', actionData);
54
+ return response;
182
55
  }
183
56
  }
184
57
 
@@ -192,439 +65,128 @@ function nullifyEmptyObjectProperties(data) {
192
65
  return data;
193
66
  }
194
67
 
195
- /*
196
- * Copyright (c) 2021-2024.
197
- * Author Peter Placzek (tada5hi)
198
- * For the full copyright and license information,
199
- * view the LICENSE file that was distributed with this source code.
200
- */ function asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, key, arg) {
201
- try {
202
- var info = gen[key](arg);
203
- var value = info.value;
204
- } catch (error) {
205
- reject(error);
206
- return;
207
- }
208
- if (info.done) {
209
- resolve(value);
210
- } else {
211
- Promise.resolve(value).then(_next, _throw);
212
- }
213
- }
214
- function _async_to_generator$d(fn) {
215
- return function() {
216
- var self = this, args = arguments;
217
- return new Promise(function(resolve, reject) {
218
- var gen = fn.apply(self, args);
219
- function _next(value) {
220
- asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "next", value);
221
- }
222
- function _throw(err) {
223
- asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "throw", err);
224
- }
225
- _next(undefined);
226
- });
227
- };
228
- }
229
68
  class ProjectAPI extends BaseAPI {
230
- getMany(record) {
231
- return _async_to_generator$d(function*() {
232
- const response = yield this.client.get(`projects${buildQuery(record)}`);
233
- return response.data;
234
- }).call(this);
235
- }
236
- getOne(id, requestRecord) {
237
- return _async_to_generator$d(function*() {
238
- const response = yield this.client.get(`projects/${id}${buildQuery(requestRecord)}`);
239
- return response.data;
240
- }).call(this);
241
- }
242
- create(data) {
243
- return _async_to_generator$d(function*() {
244
- const response = yield this.client.post('projects', nullifyEmptyObjectProperties(data));
245
- return response.data;
246
- }).call(this);
247
- }
248
- delete(id) {
249
- return _async_to_generator$d(function*() {
250
- const response = yield this.client.delete(`projects/${id}`);
251
- return response.data;
252
- }).call(this);
253
- }
254
- update(id, data) {
255
- return _async_to_generator$d(function*() {
256
- const response = yield this.client.post(`projects/${id}`, nullifyEmptyObjectProperties(data));
257
- return response.data;
258
- }).call(this);
69
+ async getMany(record) {
70
+ const response = await this.client.get(`projects${buildQuery(record)}`);
71
+ return response.data;
259
72
  }
260
- }
261
-
262
- /*
263
- * Copyright (c) 2021-2024.
264
- * Author Peter Placzek (tada5hi)
265
- * For the full copyright and license information,
266
- * view the LICENSE file that was distributed with this source code.
267
- */ function asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, key, arg) {
268
- try {
269
- var info = gen[key](arg);
270
- var value = info.value;
271
- } catch (error) {
272
- reject(error);
273
- return;
274
- }
275
- if (info.done) {
276
- resolve(value);
277
- } else {
278
- Promise.resolve(value).then(_next, _throw);
73
+ async getOne(id, requestRecord) {
74
+ const response = await this.client.get(`projects/${id}${buildQuery(requestRecord)}`);
75
+ return response.data;
279
76
  }
280
- }
281
- function _async_to_generator$c(fn) {
282
- return function() {
283
- var self = this, args = arguments;
284
- return new Promise(function(resolve, reject) {
285
- var gen = fn.apply(self, args);
286
- function _next(value) {
287
- asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "next", value);
288
- }
289
- function _throw(err) {
290
- asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "throw", err);
291
- }
292
- _next(undefined);
293
- });
294
- };
295
- }
296
- class ProjectNodeAPI extends BaseAPI {
297
- getMany(data) {
298
- return _async_to_generator$c(function*() {
299
- const response = yield this.client.get(`project-nodes${buildQuery(data)}`);
300
- return response.data;
301
- }).call(this);
302
- }
303
- getOne(id, data) {
304
- return _async_to_generator$c(function*() {
305
- const response = yield this.client.get(`project-nodes/${id}${buildQuery(data)}`);
306
- return response.data;
307
- }).call(this);
308
- }
309
- create(data) {
310
- return _async_to_generator$c(function*() {
311
- const response = yield this.client.post('project-nodes', data);
312
- return response.data;
313
- }).call(this);
314
- }
315
- update(id, data) {
316
- return _async_to_generator$c(function*() {
317
- const response = yield this.client.post(`project-nodes/${id}`, nullifyEmptyObjectProperties(data));
318
- return response.data;
319
- }).call(this);
320
- }
321
- delete(id) {
322
- return _async_to_generator$c(function*() {
323
- const response = yield this.client.delete(`project-nodes/${id}`);
324
- return response.data;
325
- }).call(this);
77
+ async create(data) {
78
+ const response = await this.client.post('projects', nullifyEmptyObjectProperties(data));
79
+ return response.data;
80
+ }
81
+ async delete(id) {
82
+ const response = await this.client.delete(`projects/${id}`);
83
+ return response.data;
84
+ }
85
+ async update(id, data) {
86
+ const response = await this.client.post(`projects/${id}`, nullifyEmptyObjectProperties(data));
87
+ return response.data;
326
88
  }
327
89
  }
328
90
 
329
- /*
330
- * Copyright (c) 2021-2024.
331
- * Author Peter Placzek (tada5hi)
332
- * For the full copyright and license information,
333
- * view the LICENSE file that was distributed with this source code.
334
- */ function asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, key, arg) {
335
- try {
336
- var info = gen[key](arg);
337
- var value = info.value;
338
- } catch (error) {
339
- reject(error);
340
- return;
341
- }
342
- if (info.done) {
343
- resolve(value);
344
- } else {
345
- Promise.resolve(value).then(_next, _throw);
91
+ class ProjectNodeAPI extends BaseAPI {
92
+ async getMany(data) {
93
+ const response = await this.client.get(`project-nodes${buildQuery(data)}`);
94
+ return response.data;
346
95
  }
347
- }
348
- function _async_to_generator$b(fn) {
349
- return function() {
350
- var self = this, args = arguments;
351
- return new Promise(function(resolve, reject) {
352
- var gen = fn.apply(self, args);
353
- function _next(value) {
354
- asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "next", value);
355
- }
356
- function _throw(err) {
357
- asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "throw", err);
358
- }
359
- _next(undefined);
360
- });
361
- };
362
- }
363
- class RegistryAPI extends BaseAPI {
364
- getMany(options) {
365
- return _async_to_generator$b(function*() {
366
- const response = yield this.client.get(`registries${buildQuery(options)}`);
367
- return response.data;
368
- }).call(this);
369
- }
370
- getOne(id, options) {
371
- return _async_to_generator$b(function*() {
372
- const response = yield this.client.get(`registries/${id}${buildQuery(options)}`);
373
- return response.data;
374
- }).call(this);
375
- }
376
- create(data) {
377
- return _async_to_generator$b(function*() {
378
- const response = yield this.client.post('registries', nullifyEmptyObjectProperties(data));
379
- return response.data;
380
- }).call(this);
381
- }
382
- update(id, data) {
383
- return _async_to_generator$b(function*() {
384
- const response = yield this.client.post(`registries/${id}`, nullifyEmptyObjectProperties(data));
385
- return response.data;
386
- }).call(this);
387
- }
388
- delete(id) {
389
- return _async_to_generator$b(function*() {
390
- const response = yield this.client.delete(`registries/${id}`);
391
- return response.data;
392
- }).call(this);
96
+ async getOne(id, data) {
97
+ const response = await this.client.get(`project-nodes/${id}${buildQuery(data)}`);
98
+ return response.data;
99
+ }
100
+ async create(data) {
101
+ const response = await this.client.post('project-nodes', data);
102
+ return response.data;
103
+ }
104
+ async update(id, data) {
105
+ const response = await this.client.post(`project-nodes/${id}`, nullifyEmptyObjectProperties(data));
106
+ return response.data;
107
+ }
108
+ async delete(id) {
109
+ const response = await this.client.delete(`project-nodes/${id}`);
110
+ return response.data;
393
111
  }
394
112
  }
395
113
 
396
- /*
397
- * Copyright (c) 2021-2024.
398
- * Author Peter Placzek (tada5hi)
399
- * For the full copyright and license information,
400
- * view the LICENSE file that was distributed with this source code.
401
- */ function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
402
- try {
403
- var info = gen[key](arg);
404
- var value = info.value;
405
- } catch (error) {
406
- reject(error);
407
- return;
408
- }
409
- if (info.done) {
410
- resolve(value);
411
- } else {
412
- Promise.resolve(value).then(_next, _throw);
114
+ class RegistryAPI extends BaseAPI {
115
+ async getMany(options) {
116
+ const response = await this.client.get(`registries${buildQuery(options)}`);
117
+ return response.data;
413
118
  }
414
- }
415
- function _async_to_generator$a(fn) {
416
- return function() {
417
- var self = this, args = arguments;
418
- return new Promise(function(resolve, reject) {
419
- var gen = fn.apply(self, args);
420
- function _next(value) {
421
- asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "next", value);
422
- }
423
- function _throw(err) {
424
- asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "throw", err);
425
- }
426
- _next(undefined);
427
- });
428
- };
429
- }
430
- class RegistryProjectAPI extends BaseAPI {
431
- getMany(options) {
432
- return _async_to_generator$a(function*() {
433
- const response = yield this.client.get(`registry-projects${buildQuery(options)}`);
434
- return response.data;
435
- }).call(this);
436
- }
437
- getOne(id, options) {
438
- return _async_to_generator$a(function*() {
439
- const response = yield this.client.get(`registry-projects/${id}${buildQuery(options)}`);
440
- return response.data;
441
- }).call(this);
442
- }
443
- create(data) {
444
- return _async_to_generator$a(function*() {
445
- const response = yield this.client.post('registry-projects', nullifyEmptyObjectProperties(data));
446
- return response.data;
447
- }).call(this);
448
- }
449
- update(id, data) {
450
- return _async_to_generator$a(function*() {
451
- const response = yield this.client.post(`registry-projects/${id}`, nullifyEmptyObjectProperties(data));
452
- return response.data;
453
- }).call(this);
454
- }
455
- delete(id) {
456
- return _async_to_generator$a(function*() {
457
- const response = yield this.client.delete(`registry-projects/${id}`);
458
- return response.data;
459
- }).call(this);
119
+ async getOne(id, options) {
120
+ const response = await this.client.get(`registries/${id}${buildQuery(options)}`);
121
+ return response.data;
122
+ }
123
+ async create(data) {
124
+ const response = await this.client.post('registries', nullifyEmptyObjectProperties(data));
125
+ return response.data;
126
+ }
127
+ async update(id, data) {
128
+ const response = await this.client.post(`registries/${id}`, nullifyEmptyObjectProperties(data));
129
+ return response.data;
130
+ }
131
+ async delete(id) {
132
+ const response = await this.client.delete(`registries/${id}`);
133
+ return response.data;
460
134
  }
461
135
  }
462
136
 
463
- /*
464
- * Copyright (c) 2021-2024.
465
- * Author Peter Placzek (tada5hi)
466
- * For the full copyright and license information,
467
- * view the LICENSE file that was distributed with this source code.
468
- */ function asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, key, arg) {
469
- try {
470
- var info = gen[key](arg);
471
- var value = info.value;
472
- } catch (error) {
473
- reject(error);
474
- return;
475
- }
476
- if (info.done) {
477
- resolve(value);
478
- } else {
479
- Promise.resolve(value).then(_next, _throw);
137
+ class RegistryProjectAPI extends BaseAPI {
138
+ async getMany(options) {
139
+ const response = await this.client.get(`registry-projects${buildQuery(options)}`);
140
+ return response.data;
480
141
  }
481
- }
482
- function _async_to_generator$9(fn) {
483
- return function() {
484
- var self = this, args = arguments;
485
- return new Promise(function(resolve, reject) {
486
- var gen = fn.apply(self, args);
487
- function _next(value) {
488
- asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "next", value);
489
- }
490
- function _throw(err) {
491
- asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "throw", err);
492
- }
493
- _next(undefined);
494
- });
495
- };
496
- }
497
- function _define_property$3(obj, key, value) {
498
- if (key in obj) {
499
- Object.defineProperty(obj, key, {
500
- value: value,
501
- enumerable: true,
502
- configurable: true,
503
- writable: true
504
- });
505
- } else {
506
- obj[key] = value;
142
+ async getOne(id, options) {
143
+ const response = await this.client.get(`registry-projects/${id}${buildQuery(options)}`);
144
+ return response.data;
507
145
  }
508
- return obj;
509
- }
510
- function _object_spread$2(target) {
511
- for(var i = 1; i < arguments.length; i++){
512
- var source = arguments[i] != null ? arguments[i] : {};
513
- var ownKeys = Object.keys(source);
514
- if (typeof Object.getOwnPropertySymbols === "function") {
515
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
516
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
517
- }));
518
- }
519
- ownKeys.forEach(function(key) {
520
- _define_property$3(target, key, source[key]);
521
- });
146
+ async create(data) {
147
+ const response = await this.client.post('registry-projects', nullifyEmptyObjectProperties(data));
148
+ return response.data;
522
149
  }
523
- return target;
524
- }
525
- class NodeAPI extends BaseAPI {
526
- getMany(options) {
527
- return _async_to_generator$9(function*() {
528
- const response = yield this.client.get(`nodes${buildQuery(options)}`);
529
- return response.data;
530
- }).call(this);
531
- }
532
- getOne(id, options) {
533
- return _async_to_generator$9(function*() {
534
- const response = yield this.client.get(`nodes/${id}${buildQuery(options)}`);
535
- return response.data;
536
- }).call(this);
537
- }
538
- create(data) {
539
- return _async_to_generator$9(function*() {
540
- const response = yield this.client.post('nodes', nullifyEmptyObjectProperties(data));
541
- return response.data;
542
- }).call(this);
543
- }
544
- update(id, data) {
545
- return _async_to_generator$9(function*() {
546
- const response = yield this.client.post(`nodes/${id}`, nullifyEmptyObjectProperties(data));
547
- return response.data;
548
- }).call(this);
549
- }
550
- delete(id) {
551
- return _async_to_generator$9(function*() {
552
- const response = yield this.client.delete(`nodes/${id}`);
553
- return response.data;
554
- }).call(this);
555
- }
556
- runCommand(id, task, data) {
557
- return _async_to_generator$9(function*() {
558
- const response = yield this.client.post(`nodes/${id}/task`, _object_spread$2({
559
- task
560
- }, data));
561
- return response.data;
562
- }).call(this);
150
+ async update(id, data) {
151
+ const response = await this.client.post(`registry-projects/${id}`, nullifyEmptyObjectProperties(data));
152
+ return response.data;
153
+ }
154
+ async delete(id) {
155
+ const response = await this.client.delete(`registry-projects/${id}`);
156
+ return response.data;
563
157
  }
564
158
  }
565
159
 
566
- /*
567
- * Copyright (c) 2021-2024.
568
- * Author Peter Placzek (tada5hi)
569
- * For the full copyright and license information,
570
- * view the LICENSE file that was distributed with this source code.
571
- */ function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
572
- try {
573
- var info = gen[key](arg);
574
- var value = info.value;
575
- } catch (error) {
576
- reject(error);
577
- return;
578
- }
579
- if (info.done) {
580
- resolve(value);
581
- } else {
582
- Promise.resolve(value).then(_next, _throw);
160
+ class NodeAPI extends BaseAPI {
161
+ async getMany(options) {
162
+ const response = await this.client.get(`nodes${buildQuery(options)}`);
163
+ return response.data;
583
164
  }
584
- }
585
- function _async_to_generator$8(fn) {
586
- return function() {
587
- var self = this, args = arguments;
588
- return new Promise(function(resolve, reject) {
589
- var gen = fn.apply(self, args);
590
- function _next(value) {
591
- asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "next", value);
592
- }
593
- function _throw(err) {
594
- asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "throw", err);
595
- }
596
- _next(undefined);
597
- });
598
- };
599
- }
600
- function _define_property$2(obj, key, value) {
601
- if (key in obj) {
602
- Object.defineProperty(obj, key, {
603
- value: value,
604
- enumerable: true,
605
- configurable: true,
606
- writable: true
607
- });
608
- } else {
609
- obj[key] = value;
165
+ async getOne(id, options) {
166
+ const response = await this.client.get(`nodes/${id}${buildQuery(options)}`);
167
+ return response.data;
610
168
  }
611
- return obj;
612
- }
613
- function _object_spread$1(target) {
614
- for(var i = 1; i < arguments.length; i++){
615
- var source = arguments[i] != null ? arguments[i] : {};
616
- var ownKeys = Object.keys(source);
617
- if (typeof Object.getOwnPropertySymbols === "function") {
618
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
619
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
620
- }));
621
- }
622
- ownKeys.forEach(function(key) {
623
- _define_property$2(target, key, source[key]);
169
+ async create(data) {
170
+ const response = await this.client.post('nodes', nullifyEmptyObjectProperties(data));
171
+ return response.data;
172
+ }
173
+ async update(id, data) {
174
+ const response = await this.client.post(`nodes/${id}`, nullifyEmptyObjectProperties(data));
175
+ return response.data;
176
+ }
177
+ async delete(id) {
178
+ const response = await this.client.delete(`nodes/${id}`);
179
+ return response.data;
180
+ }
181
+ async runCommand(id, task, data) {
182
+ const response = await this.client.post(`nodes/${id}/task`, {
183
+ task,
184
+ ...data
624
185
  });
186
+ return response.data;
625
187
  }
626
- return target;
627
188
  }
189
+
628
190
  class AnalysisAPI extends BaseAPI {
629
191
  // todo: we properly don't need this anymore
630
192
  getResultDownloadPath(id) {
@@ -639,575 +201,203 @@ class AnalysisAPI extends BaseAPI {
639
201
  getFileDownloadURL(id) {
640
202
  return new URL(this.getFilesDownloadPath(id), this.client.getBaseURL()).href;
641
203
  }
642
- getMany(options) {
643
- return _async_to_generator$8(function*() {
644
- const { data: response } = yield this.client.get(`analyses${buildQuery(options)}`);
645
- return response;
646
- }).call(this);
647
- }
648
- getOne(id, options, requestConfig) {
649
- return _async_to_generator$8(function*() {
650
- const { data: response } = yield this.client.get(`analyses/${id}${buildQuery(options)}`, requestConfig);
651
- return response;
652
- }).call(this);
653
- }
654
- delete(id) {
655
- return _async_to_generator$8(function*() {
656
- const { data: response } = yield this.client.delete(`analyses/${id}`);
657
- return response;
658
- }).call(this);
659
- }
660
- update(id, data) {
661
- return _async_to_generator$8(function*() {
662
- const { data: response } = yield this.client.post(`analyses/${id}`, nullifyEmptyObjectProperties(data));
663
- return response;
664
- }).call(this);
665
- }
666
- create(data) {
667
- return _async_to_generator$8(function*() {
668
- const { data: response } = yield this.client.post('analyses', nullifyEmptyObjectProperties(data));
669
- return response;
670
- }).call(this);
671
- }
672
- runCommand(_0, _1) {
673
- return _async_to_generator$8(function*(id, command, data = {}) {
674
- const actionData = _object_spread$1({
675
- command
676
- }, data);
677
- const { data: response } = yield this.client.post(`analyses/${id}/command`, actionData);
678
- return response;
679
- }).apply(this, arguments);
680
- }
681
- streamFiles(id) {
682
- return _async_to_generator$8(function*() {
683
- const response = yield this.client.get(this.getFilesDownloadPath(id), {
684
- responseType: 'stream'
685
- });
686
- return response.data;
687
- }).call(this);
688
- }
689
- downloadResult(id) {
690
- return _async_to_generator$8(function*() {
691
- const response = yield this.client.get(this.getResultDownloadPath(id), {
692
- responseType: 'stream'
693
- });
694
- return response.data;
695
- }).call(this);
204
+ async getMany(options) {
205
+ const { data: response } = await this.client.get(`analyses${buildQuery(options)}`);
206
+ return response;
696
207
  }
697
- }
698
-
699
- /*
700
- * Copyright (c) 2021-2024.
701
- * Author Peter Placzek (tada5hi)
702
- * For the full copyright and license information,
703
- * view the LICENSE file that was distributed with this source code.
704
- */ function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
705
- try {
706
- var info = gen[key](arg);
707
- var value = info.value;
708
- } catch (error) {
709
- reject(error);
710
- return;
711
- }
712
- if (info.done) {
713
- resolve(value);
714
- } else {
715
- Promise.resolve(value).then(_next, _throw);
208
+ async getOne(id, options, requestConfig) {
209
+ const { data: response } = await this.client.get(`analyses/${id}${buildQuery(options)}`, requestConfig);
210
+ return response;
716
211
  }
717
- }
718
- function _async_to_generator$7(fn) {
719
- return function() {
720
- var self = this, args = arguments;
721
- return new Promise(function(resolve, reject) {
722
- var gen = fn.apply(self, args);
723
- function _next(value) {
724
- asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "next", value);
725
- }
726
- function _throw(err) {
727
- asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "throw", err);
728
- }
729
- _next(undefined);
212
+ async delete(id) {
213
+ const { data: response } = await this.client.delete(`analyses/${id}`);
214
+ return response;
215
+ }
216
+ async update(id, data) {
217
+ const { data: response } = await this.client.post(`analyses/${id}`, nullifyEmptyObjectProperties(data));
218
+ return response;
219
+ }
220
+ async create(data) {
221
+ const { data: response } = await this.client.post('analyses', nullifyEmptyObjectProperties(data));
222
+ return response;
223
+ }
224
+ async runCommand(id, command, data = {}) {
225
+ const { data: response } = await this.client.post(`analyses/${id}/command`, {
226
+ command,
227
+ ...data
730
228
  });
731
- };
732
- }
733
- class AnalysisBucketAPI extends BaseAPI {
734
- getMany(options) {
735
- return _async_to_generator$7(function*() {
736
- const response = yield this.client.get(`analysis-buckets${buildQuery(options)}`);
737
- return response.data;
738
- }).call(this);
739
- }
740
- getOne(id) {
741
- return _async_to_generator$7(function*() {
742
- const response = yield this.client.get(`analysis-buckets/${id}`);
743
- return response.data;
744
- }).call(this);
745
- }
746
- create(data) {
747
- return _async_to_generator$7(function*() {
748
- const { data: response } = yield this.client.post('analysis-buckets', data);
749
- return response;
750
- }).call(this);
751
- }
752
- delete(id) {
753
- return _async_to_generator$7(function*() {
754
- const response = yield this.client.delete(`analysis-buckets/${id}`);
755
- return response.data;
756
- }).call(this);
229
+ return response;
757
230
  }
758
- }
759
-
760
- /*
761
- * Copyright (c) 2021-2024.
762
- * Author Peter Placzek (tada5hi)
763
- * For the full copyright and license information,
764
- * view the LICENSE file that was distributed with this source code.
765
- */ function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
766
- try {
767
- var info = gen[key](arg);
768
- var value = info.value;
769
- } catch (error) {
770
- reject(error);
771
- return;
772
- }
773
- if (info.done) {
774
- resolve(value);
775
- } else {
776
- Promise.resolve(value).then(_next, _throw);
231
+ async streamFiles(id) {
232
+ const response = await this.client.get(this.getFilesDownloadPath(id), {
233
+ responseType: 'stream'
234
+ });
235
+ return response.data;
777
236
  }
778
- }
779
- function _async_to_generator$6(fn) {
780
- return function() {
781
- var self = this, args = arguments;
782
- return new Promise(function(resolve, reject) {
783
- var gen = fn.apply(self, args);
784
- function _next(value) {
785
- asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "next", value);
786
- }
787
- function _throw(err) {
788
- asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "throw", err);
789
- }
790
- _next(undefined);
237
+ async downloadResult(id) {
238
+ const response = await this.client.get(this.getResultDownloadPath(id), {
239
+ responseType: 'stream'
791
240
  });
792
- };
793
- }
794
- class AnalysisBucketFileAPI extends BaseAPI {
795
- getMany(options) {
796
- return _async_to_generator$6(function*() {
797
- const response = yield this.client.get(`analysis-bucket-files${buildQuery(options)}`);
798
- return response.data;
799
- }).call(this);
800
- }
801
- getOne(id) {
802
- return _async_to_generator$6(function*() {
803
- const response = yield this.client.get(`analysis-bucket-files/${id}`);
804
- return response.data;
805
- }).call(this);
806
- }
807
- delete(id) {
808
- return _async_to_generator$6(function*() {
809
- const response = yield this.client.delete(`analysis-bucket-files/${id}`);
810
- return response.data;
811
- }).call(this);
812
- }
813
- update(id, data) {
814
- return _async_to_generator$6(function*() {
815
- const { data: response } = yield this.client.post(`analysis-bucket-files/${id}`, nullifyEmptyObjectProperties(data));
816
- return response;
817
- }).call(this);
818
- }
819
- create(data) {
820
- return _async_to_generator$6(function*() {
821
- const { data: response } = yield this.client.post('analysis-bucket-files', nullifyEmptyObjectProperties(data));
822
- return response;
823
- }).call(this);
241
+ return response.data;
824
242
  }
825
243
  }
826
244
 
827
- /*
828
- * Copyright (c) 2021-2024.
829
- * Author Peter Placzek (tada5hi)
830
- * For the full copyright and license information,
831
- * view the LICENSE file that was distributed with this source code.
832
- */ function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
833
- try {
834
- var info = gen[key](arg);
835
- var value = info.value;
836
- } catch (error) {
837
- reject(error);
838
- return;
839
- }
840
- if (info.done) {
841
- resolve(value);
842
- } else {
843
- Promise.resolve(value).then(_next, _throw);
245
+ class AnalysisBucketAPI extends BaseAPI {
246
+ async getMany(options) {
247
+ const response = await this.client.get(`analysis-buckets${buildQuery(options)}`);
248
+ return response.data;
844
249
  }
845
- }
846
- function _async_to_generator$5(fn) {
847
- return function() {
848
- var self = this, args = arguments;
849
- return new Promise(function(resolve, reject) {
850
- var gen = fn.apply(self, args);
851
- function _next(value) {
852
- asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "next", value);
853
- }
854
- function _throw(err) {
855
- asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "throw", err);
856
- }
857
- _next(undefined);
858
- });
859
- };
860
- }
861
- class AnalysisLogAPI extends BaseAPI {
862
- getMany(options) {
863
- return _async_to_generator$5(function*() {
864
- const { data: response } = yield this.client.get(`analysis-logs${buildQuery(options)}`);
865
- return response;
866
- }).call(this);
250
+ async getOne(id) {
251
+ const response = await this.client.get(`analysis-buckets/${id}`);
252
+ return response.data;
867
253
  }
868
- delete(options) {
869
- return _async_to_generator$5(function*() {
870
- yield this.client.delete(`analysis-logs${buildQuery(options)}`);
871
- }).call(this);
254
+ async create(data) {
255
+ const { data: response } = await this.client.post('analysis-buckets', data);
256
+ return response;
257
+ }
258
+ async delete(id) {
259
+ const response = await this.client.delete(`analysis-buckets/${id}`);
260
+ return response.data;
872
261
  }
873
262
  }
874
263
 
875
- /*
876
- * Copyright (c) 2021-2024.
877
- * Author Peter Placzek (tada5hi)
878
- * For the full copyright and license information,
879
- * view the LICENSE file that was distributed with this source code.
880
- */ function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
881
- try {
882
- var info = gen[key](arg);
883
- var value = info.value;
884
- } catch (error) {
885
- reject(error);
886
- return;
887
- }
888
- if (info.done) {
889
- resolve(value);
890
- } else {
891
- Promise.resolve(value).then(_next, _throw);
264
+ class AnalysisBucketFileAPI extends BaseAPI {
265
+ async getMany(options) {
266
+ const response = await this.client.get(`analysis-bucket-files${buildQuery(options)}`);
267
+ return response.data;
892
268
  }
893
- }
894
- function _async_to_generator$4(fn) {
895
- return function() {
896
- var self = this, args = arguments;
897
- return new Promise(function(resolve, reject) {
898
- var gen = fn.apply(self, args);
899
- function _next(value) {
900
- asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "next", value);
901
- }
902
- function _throw(err) {
903
- asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "throw", err);
904
- }
905
- _next(undefined);
906
- });
907
- };
908
- }
909
- class AnalysisNodeAPI extends BaseAPI {
910
- getMany(options) {
911
- return _async_to_generator$4(function*() {
912
- const { data: response } = yield this.client.get(`analysis-nodes${buildQuery(options)}`);
913
- return response;
914
- }).call(this);
915
- }
916
- getOne(id) {
917
- return _async_to_generator$4(function*() {
918
- const { data: response } = yield this.client.get(`analysis-nodes/${id}`);
919
- return response;
920
- }).call(this);
921
- }
922
- delete(id) {
923
- return _async_to_generator$4(function*() {
924
- const { data: response } = yield this.client.delete(`analysis-nodes/${id}`);
925
- return response;
926
- }).call(this);
927
- }
928
- update(id, data) {
929
- return _async_to_generator$4(function*() {
930
- const { data: response } = yield this.client.post(`analysis-nodes/${id}`, data);
931
- return response;
932
- }).call(this);
933
- }
934
- create(data) {
935
- return _async_to_generator$4(function*() {
936
- const { data: response } = yield this.client.post('analysis-nodes', data);
937
- return response;
938
- }).call(this);
269
+ async getOne(id) {
270
+ const response = await this.client.get(`analysis-bucket-files/${id}`);
271
+ return response.data;
272
+ }
273
+ async delete(id) {
274
+ const response = await this.client.delete(`analysis-bucket-files/${id}`);
275
+ return response.data;
276
+ }
277
+ async update(id, data) {
278
+ const { data: response } = await this.client.post(`analysis-bucket-files/${id}`, nullifyEmptyObjectProperties(data));
279
+ return response;
280
+ }
281
+ async create(data) {
282
+ const { data: response } = await this.client.post('analysis-bucket-files', nullifyEmptyObjectProperties(data));
283
+ return response;
939
284
  }
940
285
  }
941
286
 
942
- /*
943
- * Copyright (c) 2021-2024.
944
- * Author Peter Placzek (tada5hi)
945
- * For the full copyright and license information,
946
- * view the LICENSE file that was distributed with this source code.
947
- */ function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
948
- try {
949
- var info = gen[key](arg);
950
- var value = info.value;
951
- } catch (error) {
952
- reject(error);
953
- return;
954
- }
955
- if (info.done) {
956
- resolve(value);
957
- } else {
958
- Promise.resolve(value).then(_next, _throw);
287
+ class AnalysisLogAPI extends BaseAPI {
288
+ async getMany(options) {
289
+ const { data: response } = await this.client.get(`analysis-logs${buildQuery(options)}`);
290
+ return response;
959
291
  }
960
- }
961
- function _async_to_generator$3(fn) {
962
- return function() {
963
- var self = this, args = arguments;
964
- return new Promise(function(resolve, reject) {
965
- var gen = fn.apply(self, args);
966
- function _next(value) {
967
- asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
968
- }
969
- function _throw(err) {
970
- asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
971
- }
972
- _next(undefined);
973
- });
974
- };
975
- }
976
- class AnalysisNodeEventAPI extends BaseAPI {
977
- getMany(options) {
978
- return _async_to_generator$3(function*() {
979
- const { data: response } = yield this.client.get(`analysis-node-events${buildQuery(options)}`);
980
- return response;
981
- }).call(this);
982
- }
983
- getOne(id) {
984
- return _async_to_generator$3(function*() {
985
- const { data: response } = yield this.client.get(`analysis-node-events/${id}`);
986
- return response;
987
- }).call(this);
292
+ async delete(options) {
293
+ await this.client.delete(`analysis-logs${buildQuery(options)}`);
988
294
  }
989
295
  }
990
296
 
991
- /*
992
- * Copyright (c) 2021-2024.
993
- * Author Peter Placzek (tada5hi)
994
- * For the full copyright and license information,
995
- * view the LICENSE file that was distributed with this source code.
996
- */ function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
997
- try {
998
- var info = gen[key](arg);
999
- var value = info.value;
1000
- } catch (error) {
1001
- reject(error);
1002
- return;
1003
- }
1004
- if (info.done) {
1005
- resolve(value);
1006
- } else {
1007
- Promise.resolve(value).then(_next, _throw);
297
+ class AnalysisNodeAPI extends BaseAPI {
298
+ async getMany(options) {
299
+ const { data: response } = await this.client.get(`analysis-nodes${buildQuery(options)}`);
300
+ return response;
1008
301
  }
1009
- }
1010
- function _async_to_generator$2(fn) {
1011
- return function() {
1012
- var self = this, args = arguments;
1013
- return new Promise(function(resolve, reject) {
1014
- var gen = fn.apply(self, args);
1015
- function _next(value) {
1016
- asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
1017
- }
1018
- function _throw(err) {
1019
- asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
1020
- }
1021
- _next(undefined);
1022
- });
1023
- };
1024
- }
1025
- class AnalysisNodeLogAPI extends BaseAPI {
1026
- getMany() {
1027
- return _async_to_generator$2(function*(options = {}) {
1028
- const { data: response } = yield this.client.get(`analysis-node-logs${buildQuery(options)}`);
1029
- return response;
1030
- }).apply(this, arguments);
1031
- }
1032
- delete() {
1033
- return _async_to_generator$2(function*(options = {}) {
1034
- yield this.client.delete(`analysis-node-logs${buildQuery(options)}`);
1035
- }).apply(this, arguments);
1036
- }
1037
- create(data) {
1038
- return _async_to_generator$2(function*() {
1039
- yield this.client.post('analysis-node-logs', data);
1040
- }).call(this);
302
+ async getOne(id) {
303
+ const { data: response } = await this.client.get(`analysis-nodes/${id}`);
304
+ return response;
305
+ }
306
+ async delete(id) {
307
+ const { data: response } = await this.client.delete(`analysis-nodes/${id}`);
308
+ return response;
309
+ }
310
+ async update(id, data) {
311
+ const { data: response } = await this.client.post(`analysis-nodes/${id}`, data);
312
+ return response;
313
+ }
314
+ async create(data) {
315
+ const { data: response } = await this.client.post('analysis-nodes', data);
316
+ return response;
1041
317
  }
1042
318
  }
1043
319
 
1044
- /*
1045
- * Copyright (c) 2021-2024.
1046
- * Author Peter Placzek (tada5hi)
1047
- * For the full copyright and license information,
1048
- * view the LICENSE file that was distributed with this source code.
1049
- */ function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
1050
- try {
1051
- var info = gen[key](arg);
1052
- var value = info.value;
1053
- } catch (error) {
1054
- reject(error);
1055
- return;
1056
- }
1057
- if (info.done) {
1058
- resolve(value);
1059
- } else {
1060
- Promise.resolve(value).then(_next, _throw);
320
+ class AnalysisNodeEventAPI extends BaseAPI {
321
+ async getMany(options) {
322
+ const { data: response } = await this.client.get(`analysis-node-events${buildQuery(options)}`);
323
+ return response;
1061
324
  }
1062
- }
1063
- function _async_to_generator$1(fn) {
1064
- return function() {
1065
- var self = this, args = arguments;
1066
- return new Promise(function(resolve, reject) {
1067
- var gen = fn.apply(self, args);
1068
- function _next(value) {
1069
- asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
1070
- }
1071
- function _throw(err) {
1072
- asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
1073
- }
1074
- _next(undefined);
1075
- });
1076
- };
1077
- }
1078
- class AnalysisPermissionAPI extends BaseAPI {
1079
- getMany(options) {
1080
- return _async_to_generator$1(function*() {
1081
- const { data: response } = yield this.client.get(`analysis-permissions${buildQuery(options)}`);
1082
- return response;
1083
- }).call(this);
1084
- }
1085
- getOne(id) {
1086
- return _async_to_generator$1(function*() {
1087
- const { data: response } = yield this.client.get(`analysis-permissions/${id}`);
1088
- return response;
1089
- }).call(this);
1090
- }
1091
- delete(id) {
1092
- return _async_to_generator$1(function*() {
1093
- const { data: response } = yield this.client.delete(`analysis-permissions/${id}`);
1094
- return response;
1095
- }).call(this);
1096
- }
1097
- update(id, data) {
1098
- return _async_to_generator$1(function*() {
1099
- const { data: response } = yield this.client.post(`analysis-permissions/${id}`, data);
1100
- return response;
1101
- }).call(this);
1102
- }
1103
- create(data) {
1104
- return _async_to_generator$1(function*() {
1105
- const { data: response } = yield this.client.post('analysis-permissions', data);
1106
- return response;
1107
- }).call(this);
325
+ async getOne(id) {
326
+ const { data: response } = await this.client.get(`analysis-node-events/${id}`);
327
+ return response;
1108
328
  }
1109
329
  }
1110
330
 
1111
- /*
1112
- * Copyright (c) 2021-2024.
1113
- * Author Peter Placzek (tada5hi)
1114
- * For the full copyright and license information,
1115
- * view the LICENSE file that was distributed with this source code.
1116
- */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1117
- try {
1118
- var info = gen[key](arg);
1119
- var value = info.value;
1120
- } catch (error) {
1121
- reject(error);
1122
- return;
1123
- }
1124
- if (info.done) {
1125
- resolve(value);
1126
- } else {
1127
- Promise.resolve(value).then(_next, _throw);
331
+ class AnalysisNodeLogAPI extends BaseAPI {
332
+ async getMany(options = {}) {
333
+ const { data: response } = await this.client.get(`analysis-node-logs${buildQuery(options)}`);
334
+ return response;
1128
335
  }
1129
- }
1130
- function _async_to_generator(fn) {
1131
- return function() {
1132
- var self = this, args = arguments;
1133
- return new Promise(function(resolve, reject) {
1134
- var gen = fn.apply(self, args);
1135
- function _next(value) {
1136
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
1137
- }
1138
- function _throw(err) {
1139
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
1140
- }
1141
- _next(undefined);
1142
- });
1143
- };
1144
- }
1145
- function _define_property$1(obj, key, value) {
1146
- if (key in obj) {
1147
- Object.defineProperty(obj, key, {
1148
- value: value,
1149
- enumerable: true,
1150
- configurable: true,
1151
- writable: true
1152
- });
1153
- } else {
1154
- obj[key] = value;
336
+ async delete(options = {}) {
337
+ await this.client.delete(`analysis-node-logs${buildQuery(options)}`);
1155
338
  }
1156
- return obj;
1157
- }
1158
- function _object_spread(target) {
1159
- for(var i = 1; i < arguments.length; i++){
1160
- var source = arguments[i] != null ? arguments[i] : {};
1161
- var ownKeys = Object.keys(source);
1162
- if (typeof Object.getOwnPropertySymbols === "function") {
1163
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1164
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1165
- }));
1166
- }
1167
- ownKeys.forEach(function(key) {
1168
- _define_property$1(target, key, source[key]);
1169
- });
339
+ async create(data) {
340
+ const { data: response } = await this.client.post('analysis-node-logs', data);
341
+ return response;
1170
342
  }
1171
- return target;
1172
343
  }
1173
- class ServiceAPI extends BaseAPI {
1174
- runCommand(id, command, data) {
1175
- return _async_to_generator(function*() {
1176
- data = data || {};
1177
- const { data: resultData } = yield this.client.post(`services/${id}/command`, nullifyEmptyObjectProperties(_object_spread({
1178
- command
1179
- }, data)));
1180
- return resultData;
1181
- }).call(this);
1182
- }
1183
- runRegistryCommand(command, data) {
1184
- return _async_to_generator(function*() {
1185
- return this.runCommand(ServiceID.REGISTRY, command, data);
1186
- }).call(this);
344
+
345
+ class AnalysisPermissionAPI extends BaseAPI {
346
+ async getMany(options) {
347
+ const { data: response } = await this.client.get(`analysis-permissions${buildQuery(options)}`);
348
+ return response;
349
+ }
350
+ async getOne(id) {
351
+ const { data: response } = await this.client.get(`analysis-permissions/${id}`);
352
+ return response;
353
+ }
354
+ async delete(id) {
355
+ const { data: response } = await this.client.delete(`analysis-permissions/${id}`);
356
+ return response;
357
+ }
358
+ async update(id, data) {
359
+ const { data: response } = await this.client.post(`analysis-permissions/${id}`, data);
360
+ return response;
361
+ }
362
+ async create(data) {
363
+ const { data: response } = await this.client.post('analysis-permissions', data);
364
+ return response;
1187
365
  }
1188
366
  }
1189
367
 
1190
- /*
1191
- * Copyright (c) 2022-2024.
1192
- * Author Peter Placzek (tada5hi)
1193
- * For the full copyright and license information,
1194
- * view the LICENSE file that was distributed with this source code.
1195
- */ function _define_property(obj, key, value) {
1196
- if (key in obj) {
1197
- Object.defineProperty(obj, key, {
1198
- value: value,
1199
- enumerable: true,
1200
- configurable: true,
1201
- writable: true
1202
- });
1203
- } else {
1204
- obj[key] = value;
368
+ class ServiceAPI extends BaseAPI {
369
+ async runCommand(id, command, data) {
370
+ data = data || {};
371
+ const { data: resultData } = await this.client.post(`services/${id}/command`, nullifyEmptyObjectProperties({
372
+ command,
373
+ ...data
374
+ }));
375
+ return resultData;
376
+ }
377
+ async runRegistryCommand(command, data) {
378
+ return this.runCommand(ServiceID.REGISTRY, command, data);
1205
379
  }
1206
- return obj;
1207
380
  }
381
+
1208
382
  class Client extends Client$1 {
383
+ masterImage;
384
+ masterImageGroup;
385
+ project;
386
+ projectNode;
387
+ registry;
388
+ registryProject;
389
+ node;
390
+ analysis;
391
+ analysisBucket;
392
+ analysisBucketFile;
393
+ analysisLog;
394
+ analysisNode;
395
+ analysisNodeEvent;
396
+ analysisNodeLog;
397
+ analysisPermission;
398
+ service;
1209
399
  constructor(config){
1210
- super(config), _define_property(this, "masterImage", void 0), _define_property(this, "masterImageGroup", void 0), _define_property(this, "project", void 0), _define_property(this, "projectNode", void 0), _define_property(this, "registry", void 0), _define_property(this, "registryProject", void 0), _define_property(this, "node", void 0), _define_property(this, "analysis", void 0), _define_property(this, "analysisBucket", void 0), _define_property(this, "analysisBucketFile", void 0), _define_property(this, "analysisLog", void 0), _define_property(this, "analysisNode", void 0), _define_property(this, "analysisNodeEvent", void 0), _define_property(this, "analysisNodeLog", void 0), _define_property(this, "analysisPermission", void 0), _define_property(this, "service", void 0);
400
+ super(config);
1211
401
  this.masterImage = new MasterImageAPI({
1212
402
  client: this
1213
403
  });