@privateaim/core-http-kit 0.8.21 → 0.8.22

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