@zthun/romulator-api 1.18.3 → 1.18.5
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/dir/dir.d.ts +1 -0
- package/dist/jobs/jobs-controller.d.mts +8 -0
- package/dist/jobs/jobs-module.d.mts +6 -0
- package/dist/jobs/jobs-repository.d.mts +33 -0
- package/dist/jobs/jobs-service.d.mts +16 -0
- package/dist/main.cjs +455 -129
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +458 -132
- package/dist/main.js.map +1 -1
- package/package.json +24 -24
package/dist/main.cjs
CHANGED
|
@@ -23,7 +23,7 @@ const mimeTypes = require('mime-types');
|
|
|
23
23
|
const node_fs = require('node:fs');
|
|
24
24
|
const node_stream = require('node:stream');
|
|
25
25
|
|
|
26
|
-
function _define_property$
|
|
26
|
+
function _define_property$g(obj, key, value) {
|
|
27
27
|
if (key in obj) {
|
|
28
28
|
Object.defineProperty(obj, key, {
|
|
29
29
|
value: value,
|
|
@@ -36,21 +36,21 @@ function _define_property$c(obj, key, value) {
|
|
|
36
36
|
}
|
|
37
37
|
return obj;
|
|
38
38
|
}
|
|
39
|
-
function _ts_decorate$
|
|
39
|
+
function _ts_decorate$l(decorators, target, key, desc) {
|
|
40
40
|
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
41
41
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
42
42
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
43
43
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
44
44
|
}
|
|
45
|
-
function _ts_metadata$
|
|
45
|
+
function _ts_metadata$f(k, v) {
|
|
46
46
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
47
47
|
}
|
|
48
48
|
class ZRomulatorConfigUpdateDto {
|
|
49
49
|
constructor(){
|
|
50
|
-
_define_property$
|
|
50
|
+
_define_property$g(this, "contents", void 0);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
_ts_decorate$
|
|
53
|
+
_ts_decorate$l([
|
|
54
54
|
swagger.ApiProperty({
|
|
55
55
|
type: "object",
|
|
56
56
|
properties: {}
|
|
@@ -62,7 +62,7 @@ _ts_decorate$i([
|
|
|
62
62
|
message: "The contents of the config must be an object "
|
|
63
63
|
}),
|
|
64
64
|
classValidator.IsNotEmptyObject(),
|
|
65
|
-
_ts_metadata$
|
|
65
|
+
_ts_metadata$f("design:type", typeof T === "undefined" ? Object : T)
|
|
66
66
|
], ZRomulatorConfigUpdateDto.prototype, "contents", void 0);
|
|
67
67
|
|
|
68
68
|
class ZDir {
|
|
@@ -72,6 +72,9 @@ class ZDir {
|
|
|
72
72
|
static configs() {
|
|
73
73
|
return node_path.resolve(ZDir.application(), "configs");
|
|
74
74
|
}
|
|
75
|
+
static jobs() {
|
|
76
|
+
return node_path.resolve(ZDir.application(), "jobs");
|
|
77
|
+
}
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
class ZRomulatorConfigKnown {
|
|
@@ -89,7 +92,7 @@ class ZRomulatorConfigKnown {
|
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
function _define_property$
|
|
95
|
+
function _define_property$f(obj, key, value) {
|
|
93
96
|
if (key in obj) {
|
|
94
97
|
Object.defineProperty(obj, key, {
|
|
95
98
|
value: value,
|
|
@@ -102,16 +105,16 @@ function _define_property$b(obj, key, value) {
|
|
|
102
105
|
}
|
|
103
106
|
return obj;
|
|
104
107
|
}
|
|
105
|
-
function _ts_decorate$
|
|
108
|
+
function _ts_decorate$k(decorators, target, key, desc) {
|
|
106
109
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
107
110
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
108
111
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
109
112
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
110
113
|
}
|
|
111
|
-
function _ts_metadata$
|
|
114
|
+
function _ts_metadata$e(k, v) {
|
|
112
115
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
113
116
|
}
|
|
114
|
-
function _ts_param$
|
|
117
|
+
function _ts_param$e(paramIndex, decorator) {
|
|
115
118
|
return function(target, key) {
|
|
116
119
|
decorator(target, key, paramIndex);
|
|
117
120
|
};
|
|
@@ -189,20 +192,20 @@ class ZRomulatorConfigsService {
|
|
|
189
192
|
return config;
|
|
190
193
|
}
|
|
191
194
|
constructor(_logger){
|
|
192
|
-
_define_property$
|
|
195
|
+
_define_property$f(this, "_logger", void 0);
|
|
193
196
|
this._logger = new lumberjackyLog.ZLoggerContext("ZRomulatorConfigsService", _logger);
|
|
194
197
|
}
|
|
195
198
|
}
|
|
196
|
-
ZRomulatorConfigsService = _ts_decorate$
|
|
199
|
+
ZRomulatorConfigsService = _ts_decorate$k([
|
|
197
200
|
common.Injectable(),
|
|
198
|
-
_ts_param$
|
|
199
|
-
_ts_metadata$
|
|
200
|
-
_ts_metadata$
|
|
201
|
+
_ts_param$e(0, common.Inject(lumberjackyNest.ZLoggerToken)),
|
|
202
|
+
_ts_metadata$e("design:type", Function),
|
|
203
|
+
_ts_metadata$e("design:paramtypes", [
|
|
201
204
|
typeof IZLogger === "undefined" ? Object : IZLogger
|
|
202
205
|
])
|
|
203
206
|
], ZRomulatorConfigsService);
|
|
204
207
|
|
|
205
|
-
function _define_property$
|
|
208
|
+
function _define_property$e(obj, key, value) {
|
|
206
209
|
if (key in obj) {
|
|
207
210
|
Object.defineProperty(obj, key, {
|
|
208
211
|
value: value,
|
|
@@ -215,16 +218,16 @@ function _define_property$a(obj, key, value) {
|
|
|
215
218
|
}
|
|
216
219
|
return obj;
|
|
217
220
|
}
|
|
218
|
-
function _ts_decorate$
|
|
221
|
+
function _ts_decorate$j(decorators, target, key, desc) {
|
|
219
222
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
220
223
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
221
224
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
222
225
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
223
226
|
}
|
|
224
|
-
function _ts_metadata$
|
|
227
|
+
function _ts_metadata$d(k, v) {
|
|
225
228
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
226
229
|
}
|
|
227
|
-
function _ts_param$
|
|
230
|
+
function _ts_param$d(paramIndex, decorator) {
|
|
228
231
|
return function(target, key) {
|
|
229
232
|
decorator(target, key, paramIndex);
|
|
230
233
|
};
|
|
@@ -241,20 +244,20 @@ class ZRomulatorConfigsController {
|
|
|
241
244
|
return await this._configs.get(identification);
|
|
242
245
|
}
|
|
243
246
|
constructor(_configs){
|
|
244
|
-
_define_property$
|
|
247
|
+
_define_property$e(this, "_configs", void 0);
|
|
245
248
|
this._configs = _configs;
|
|
246
249
|
}
|
|
247
250
|
}
|
|
248
|
-
_ts_decorate$
|
|
251
|
+
_ts_decorate$j([
|
|
249
252
|
common.Get(),
|
|
250
|
-
_ts_param$
|
|
251
|
-
_ts_metadata$
|
|
252
|
-
_ts_metadata$
|
|
253
|
+
_ts_param$d(0, common.Query()),
|
|
254
|
+
_ts_metadata$d("design:type", Function),
|
|
255
|
+
_ts_metadata$d("design:paramtypes", [
|
|
253
256
|
typeof IZDataRequestQuery === "undefined" ? Object : IZDataRequestQuery
|
|
254
257
|
]),
|
|
255
|
-
_ts_metadata$
|
|
258
|
+
_ts_metadata$d("design:returntype", Promise)
|
|
256
259
|
], ZRomulatorConfigsController.prototype, "list", null);
|
|
257
|
-
_ts_decorate$
|
|
260
|
+
_ts_decorate$j([
|
|
258
261
|
swagger.ApiParam({
|
|
259
262
|
type: "string",
|
|
260
263
|
name: "identification",
|
|
@@ -271,39 +274,40 @@ _ts_decorate$g([
|
|
|
271
274
|
skipNullProperties: false,
|
|
272
275
|
skipUndefinedProperties: false
|
|
273
276
|
})),
|
|
274
|
-
_ts_param$
|
|
275
|
-
_ts_param$
|
|
276
|
-
_ts_metadata$
|
|
277
|
-
_ts_metadata$
|
|
277
|
+
_ts_param$d(0, common.Param("identification")),
|
|
278
|
+
_ts_param$d(1, common.Body()),
|
|
279
|
+
_ts_metadata$d("design:type", Function),
|
|
280
|
+
_ts_metadata$d("design:paramtypes", [
|
|
278
281
|
typeof ZRomulatorConfigId === "undefined" ? Object : ZRomulatorConfigId,
|
|
279
282
|
typeof ZRomulatorConfigUpdateDto === "undefined" ? Object : ZRomulatorConfigUpdateDto
|
|
280
283
|
]),
|
|
281
|
-
_ts_metadata$
|
|
284
|
+
_ts_metadata$d("design:returntype", Promise)
|
|
282
285
|
], ZRomulatorConfigsController.prototype, "update", null);
|
|
283
|
-
_ts_decorate$
|
|
286
|
+
_ts_decorate$j([
|
|
284
287
|
swagger.ApiParam({
|
|
285
288
|
type: "string",
|
|
286
289
|
name: "identification",
|
|
287
290
|
description: "The id of the config"
|
|
288
291
|
}),
|
|
289
292
|
common.Get(":identification"),
|
|
290
|
-
_ts_param$
|
|
291
|
-
_ts_metadata$
|
|
292
|
-
_ts_metadata$
|
|
293
|
+
_ts_param$d(0, common.Param("identification")),
|
|
294
|
+
_ts_metadata$d("design:type", Function),
|
|
295
|
+
_ts_metadata$d("design:paramtypes", [
|
|
293
296
|
typeof ZRomulatorConfigId === "undefined" ? Object : ZRomulatorConfigId
|
|
294
297
|
]),
|
|
295
|
-
_ts_metadata$
|
|
298
|
+
_ts_metadata$d("design:returntype", Promise)
|
|
296
299
|
], ZRomulatorConfigsController.prototype, "get", null);
|
|
297
|
-
ZRomulatorConfigsController = _ts_decorate$
|
|
300
|
+
ZRomulatorConfigsController = _ts_decorate$j([
|
|
301
|
+
swagger.ApiTags("Configs"),
|
|
298
302
|
common.Controller("configs"),
|
|
299
|
-
_ts_param$
|
|
300
|
-
_ts_metadata$
|
|
301
|
-
_ts_metadata$
|
|
303
|
+
_ts_param$d(0, common.Inject(ZRomulatorConfigsToken)),
|
|
304
|
+
_ts_metadata$d("design:type", Function),
|
|
305
|
+
_ts_metadata$d("design:paramtypes", [
|
|
302
306
|
typeof IZRomulatorConfigsService === "undefined" ? Object : IZRomulatorConfigsService
|
|
303
307
|
])
|
|
304
308
|
], ZRomulatorConfigsController);
|
|
305
309
|
|
|
306
|
-
function _ts_decorate$
|
|
310
|
+
function _ts_decorate$i(decorators, target, key, desc) {
|
|
307
311
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
308
312
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
309
313
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -311,7 +315,7 @@ function _ts_decorate$f(decorators, target, key, desc) {
|
|
|
311
315
|
}
|
|
312
316
|
class ZRomulatorConfigsModule {
|
|
313
317
|
}
|
|
314
|
-
ZRomulatorConfigsModule = _ts_decorate$
|
|
318
|
+
ZRomulatorConfigsModule = _ts_decorate$i([
|
|
315
319
|
common.Module({
|
|
316
320
|
imports: [
|
|
317
321
|
crumbtrailNest.ZFileSystemModule,
|
|
@@ -332,7 +336,7 @@ ZRomulatorConfigsModule = _ts_decorate$f([
|
|
|
332
336
|
})
|
|
333
337
|
], ZRomulatorConfigsModule);
|
|
334
338
|
|
|
335
|
-
function _define_property$
|
|
339
|
+
function _define_property$d(obj, key, value) {
|
|
336
340
|
if (key in obj) {
|
|
337
341
|
Object.defineProperty(obj, key, {
|
|
338
342
|
value: value,
|
|
@@ -345,16 +349,16 @@ function _define_property$9(obj, key, value) {
|
|
|
345
349
|
}
|
|
346
350
|
return obj;
|
|
347
351
|
}
|
|
348
|
-
function _ts_decorate$
|
|
352
|
+
function _ts_decorate$h(decorators, target, key, desc) {
|
|
349
353
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
350
354
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
351
355
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
352
356
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
353
357
|
}
|
|
354
|
-
function _ts_metadata$
|
|
358
|
+
function _ts_metadata$c(k, v) {
|
|
355
359
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
356
360
|
}
|
|
357
|
-
function _ts_param$
|
|
361
|
+
function _ts_param$c(paramIndex, decorator) {
|
|
358
362
|
return function(target, key) {
|
|
359
363
|
decorator(target, key, paramIndex);
|
|
360
364
|
};
|
|
@@ -444,15 +448,15 @@ class ZRomulatorFilesRepository {
|
|
|
444
448
|
return lodashEs.flatten(results);
|
|
445
449
|
}
|
|
446
450
|
constructor(_configs, _fileSystem, logger){
|
|
447
|
-
_define_property$
|
|
448
|
-
_define_property$
|
|
449
|
-
_define_property$
|
|
450
|
-
_define_property$
|
|
451
|
-
_define_property$
|
|
452
|
-
_define_property$
|
|
453
|
-
_define_property$
|
|
454
|
-
_define_property$
|
|
455
|
-
_define_property$
|
|
451
|
+
_define_property$d(this, "_configs", void 0);
|
|
452
|
+
_define_property$d(this, "_fileSystem", void 0);
|
|
453
|
+
_define_property$d(this, "logger", void 0);
|
|
454
|
+
_define_property$d(this, "_logger", void 0);
|
|
455
|
+
_define_property$d(this, "_repository", void 0);
|
|
456
|
+
_define_property$d(this, "_folderStream", void 0);
|
|
457
|
+
_define_property$d(this, "_fileStream", void 0);
|
|
458
|
+
_define_property$d(this, "_globs", void 0);
|
|
459
|
+
_define_property$d(this, "_systems", void 0);
|
|
456
460
|
this._configs = _configs;
|
|
457
461
|
this._fileSystem = _fileSystem;
|
|
458
462
|
this.logger = logger;
|
|
@@ -474,22 +478,22 @@ class ZRomulatorFilesRepository {
|
|
|
474
478
|
this._logger = new lumberjackyLog.ZLoggerContext("ZRomulatorFilesRepository", logger);
|
|
475
479
|
}
|
|
476
480
|
}
|
|
477
|
-
_define_property$
|
|
478
|
-
_define_property$
|
|
479
|
-
ZRomulatorFilesRepository = _ts_decorate$
|
|
481
|
+
_define_property$d(ZRomulatorFilesRepository, "MediaFolderName", ".media");
|
|
482
|
+
_define_property$d(ZRomulatorFilesRepository, "InfoFolderName", ".info");
|
|
483
|
+
ZRomulatorFilesRepository = _ts_decorate$h([
|
|
480
484
|
common.Injectable(),
|
|
481
|
-
_ts_param$
|
|
482
|
-
_ts_param$
|
|
483
|
-
_ts_param$
|
|
484
|
-
_ts_metadata$
|
|
485
|
-
_ts_metadata$
|
|
485
|
+
_ts_param$c(0, common.Inject(ZRomulatorConfigsToken)),
|
|
486
|
+
_ts_param$c(1, common.Inject(crumbtrailNest.ZFileSystemToken)),
|
|
487
|
+
_ts_param$c(2, common.Inject(lumberjackyNest.ZLoggerToken)),
|
|
488
|
+
_ts_metadata$c("design:type", Function),
|
|
489
|
+
_ts_metadata$c("design:paramtypes", [
|
|
486
490
|
typeof IZRomulatorConfigsService === "undefined" ? Object : IZRomulatorConfigsService,
|
|
487
491
|
typeof IZFileSystemService === "undefined" ? Object : IZFileSystemService,
|
|
488
492
|
typeof IZLogger === "undefined" ? Object : IZLogger
|
|
489
493
|
])
|
|
490
494
|
], ZRomulatorFilesRepository);
|
|
491
495
|
|
|
492
|
-
function _define_property$
|
|
496
|
+
function _define_property$c(obj, key, value) {
|
|
493
497
|
if (key in obj) {
|
|
494
498
|
Object.defineProperty(obj, key, {
|
|
495
499
|
value: value,
|
|
@@ -502,16 +506,16 @@ function _define_property$8(obj, key, value) {
|
|
|
502
506
|
}
|
|
503
507
|
return obj;
|
|
504
508
|
}
|
|
505
|
-
function _ts_decorate$
|
|
509
|
+
function _ts_decorate$g(decorators, target, key, desc) {
|
|
506
510
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
507
511
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
508
512
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
509
513
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
510
514
|
}
|
|
511
|
-
function _ts_metadata$
|
|
515
|
+
function _ts_metadata$b(k, v) {
|
|
512
516
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
513
517
|
}
|
|
514
|
-
function _ts_param$
|
|
518
|
+
function _ts_param$b(paramIndex, decorator) {
|
|
515
519
|
return function(target, key) {
|
|
516
520
|
decorator(target, key, paramIndex);
|
|
517
521
|
};
|
|
@@ -540,20 +544,20 @@ class ZRomulatorFilesSystemsRepository {
|
|
|
540
544
|
/**
|
|
541
545
|
* Initializes a new instance of this object.
|
|
542
546
|
*/ constructor(_filesRepository){
|
|
543
|
-
_define_property$
|
|
547
|
+
_define_property$c(this, "_filesRepository", void 0);
|
|
544
548
|
this._filesRepository = _filesRepository;
|
|
545
549
|
}
|
|
546
550
|
}
|
|
547
|
-
ZRomulatorFilesSystemsRepository = _ts_decorate$
|
|
551
|
+
ZRomulatorFilesSystemsRepository = _ts_decorate$g([
|
|
548
552
|
common.Injectable(),
|
|
549
|
-
_ts_param$
|
|
550
|
-
_ts_metadata$
|
|
551
|
-
_ts_metadata$
|
|
553
|
+
_ts_param$b(0, common.Inject(ZRomulatorFilesRepositoryToken)),
|
|
554
|
+
_ts_metadata$b("design:type", Function),
|
|
555
|
+
_ts_metadata$b("design:paramtypes", [
|
|
552
556
|
typeof IZRomulatorFilesRepository === "undefined" ? Object : IZRomulatorFilesRepository
|
|
553
557
|
])
|
|
554
558
|
], ZRomulatorFilesSystemsRepository);
|
|
555
559
|
|
|
556
|
-
function _define_property$
|
|
560
|
+
function _define_property$b(obj, key, value) {
|
|
557
561
|
if (key in obj) {
|
|
558
562
|
Object.defineProperty(obj, key, {
|
|
559
563
|
value: value,
|
|
@@ -566,16 +570,16 @@ function _define_property$7(obj, key, value) {
|
|
|
566
570
|
}
|
|
567
571
|
return obj;
|
|
568
572
|
}
|
|
569
|
-
function _ts_decorate$
|
|
573
|
+
function _ts_decorate$f(decorators, target, key, desc) {
|
|
570
574
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
571
575
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
572
576
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
573
577
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
574
578
|
}
|
|
575
|
-
function _ts_metadata$
|
|
579
|
+
function _ts_metadata$a(k, v) {
|
|
576
580
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
577
581
|
}
|
|
578
|
-
function _ts_param$
|
|
582
|
+
function _ts_param$a(paramIndex, decorator) {
|
|
579
583
|
return function(target, key) {
|
|
580
584
|
decorator(target, key, paramIndex);
|
|
581
585
|
};
|
|
@@ -616,24 +620,24 @@ class ZRomulatorFilesGamesRepository {
|
|
|
616
620
|
]));
|
|
617
621
|
}
|
|
618
622
|
constructor(_systemsRepository, _filesRepository){
|
|
619
|
-
_define_property$
|
|
620
|
-
_define_property$
|
|
623
|
+
_define_property$b(this, "_systemsRepository", void 0);
|
|
624
|
+
_define_property$b(this, "_filesRepository", void 0);
|
|
621
625
|
this._systemsRepository = _systemsRepository;
|
|
622
626
|
this._filesRepository = _filesRepository;
|
|
623
627
|
}
|
|
624
628
|
}
|
|
625
|
-
ZRomulatorFilesGamesRepository = _ts_decorate$
|
|
629
|
+
ZRomulatorFilesGamesRepository = _ts_decorate$f([
|
|
626
630
|
common.Injectable(),
|
|
627
|
-
_ts_param$
|
|
628
|
-
_ts_param$
|
|
629
|
-
_ts_metadata$
|
|
630
|
-
_ts_metadata$
|
|
631
|
+
_ts_param$a(0, common.Inject(ZRomulatorFilesSystemsRepositoryToken)),
|
|
632
|
+
_ts_param$a(1, common.Inject(ZRomulatorFilesRepositoryToken)),
|
|
633
|
+
_ts_metadata$a("design:type", Function),
|
|
634
|
+
_ts_metadata$a("design:paramtypes", [
|
|
631
635
|
typeof IZRomulatorFilesSystemsRepository === "undefined" ? Object : IZRomulatorFilesSystemsRepository,
|
|
632
636
|
typeof IZRomulatorFilesRepository === "undefined" ? Object : IZRomulatorFilesRepository
|
|
633
637
|
])
|
|
634
638
|
], ZRomulatorFilesGamesRepository);
|
|
635
639
|
|
|
636
|
-
function _define_property$
|
|
640
|
+
function _define_property$a(obj, key, value) {
|
|
637
641
|
if (key in obj) {
|
|
638
642
|
Object.defineProperty(obj, key, {
|
|
639
643
|
value: value,
|
|
@@ -646,16 +650,16 @@ function _define_property$6(obj, key, value) {
|
|
|
646
650
|
}
|
|
647
651
|
return obj;
|
|
648
652
|
}
|
|
649
|
-
function _ts_decorate$
|
|
653
|
+
function _ts_decorate$e(decorators, target, key, desc) {
|
|
650
654
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
651
655
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
652
656
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
653
657
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
654
658
|
}
|
|
655
|
-
function _ts_metadata$
|
|
659
|
+
function _ts_metadata$9(k, v) {
|
|
656
660
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
657
661
|
}
|
|
658
|
-
function _ts_param$
|
|
662
|
+
function _ts_param$9(paramIndex, decorator) {
|
|
659
663
|
return function(target, key) {
|
|
660
664
|
decorator(target, key, paramIndex);
|
|
661
665
|
};
|
|
@@ -668,11 +672,11 @@ class ZRomulatorFilesModule {
|
|
|
668
672
|
await this._files.dispose();
|
|
669
673
|
}
|
|
670
674
|
constructor(_files){
|
|
671
|
-
_define_property$
|
|
675
|
+
_define_property$a(this, "_files", void 0);
|
|
672
676
|
this._files = _files;
|
|
673
677
|
}
|
|
674
678
|
}
|
|
675
|
-
ZRomulatorFilesModule = _ts_decorate$
|
|
679
|
+
ZRomulatorFilesModule = _ts_decorate$e([
|
|
676
680
|
common.Module({
|
|
677
681
|
imports: [
|
|
678
682
|
crumbtrailNest.ZFileSystemModule,
|
|
@@ -699,14 +703,14 @@ ZRomulatorFilesModule = _ts_decorate$b([
|
|
|
699
703
|
ZRomulatorFilesGamesRepositoryToken
|
|
700
704
|
]
|
|
701
705
|
}),
|
|
702
|
-
_ts_param$
|
|
703
|
-
_ts_metadata$
|
|
704
|
-
_ts_metadata$
|
|
706
|
+
_ts_param$9(0, common.Inject(ZRomulatorFilesRepositoryToken)),
|
|
707
|
+
_ts_metadata$9("design:type", Function),
|
|
708
|
+
_ts_metadata$9("design:paramtypes", [
|
|
705
709
|
typeof IZRomulatorFilesRepository === "undefined" ? Object : IZRomulatorFilesRepository
|
|
706
710
|
])
|
|
707
711
|
], ZRomulatorFilesModule);
|
|
708
712
|
|
|
709
|
-
function _define_property$
|
|
713
|
+
function _define_property$9(obj, key, value) {
|
|
710
714
|
if (key in obj) {
|
|
711
715
|
Object.defineProperty(obj, key, {
|
|
712
716
|
value: value,
|
|
@@ -719,16 +723,16 @@ function _define_property$5(obj, key, value) {
|
|
|
719
723
|
}
|
|
720
724
|
return obj;
|
|
721
725
|
}
|
|
722
|
-
function _ts_decorate$
|
|
726
|
+
function _ts_decorate$d(decorators, target, key, desc) {
|
|
723
727
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
724
728
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
725
729
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
726
730
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
727
731
|
}
|
|
728
|
-
function _ts_metadata$
|
|
732
|
+
function _ts_metadata$8(k, v) {
|
|
729
733
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
730
734
|
}
|
|
731
|
-
function _ts_param$
|
|
735
|
+
function _ts_param$8(paramIndex, decorator) {
|
|
732
736
|
return function(target, key) {
|
|
733
737
|
decorator(target, key, paramIndex);
|
|
734
738
|
};
|
|
@@ -776,30 +780,30 @@ class ZRomulatorGamesService {
|
|
|
776
780
|
return game;
|
|
777
781
|
}
|
|
778
782
|
constructor(_systemsRepository, _filesRepository, logger){
|
|
779
|
-
_define_property$
|
|
780
|
-
_define_property$
|
|
781
|
-
_define_property$
|
|
782
|
-
_define_property$
|
|
783
|
+
_define_property$9(this, "_systemsRepository", void 0);
|
|
784
|
+
_define_property$9(this, "_filesRepository", void 0);
|
|
785
|
+
_define_property$9(this, "logger", void 0);
|
|
786
|
+
_define_property$9(this, "_logger", void 0);
|
|
783
787
|
this._systemsRepository = _systemsRepository;
|
|
784
788
|
this._filesRepository = _filesRepository;
|
|
785
789
|
this.logger = logger;
|
|
786
790
|
this._logger = new lumberjackyLog.ZLoggerContext("ZRomulatorGamesService", logger);
|
|
787
791
|
}
|
|
788
792
|
}
|
|
789
|
-
ZRomulatorGamesService = _ts_decorate$
|
|
793
|
+
ZRomulatorGamesService = _ts_decorate$d([
|
|
790
794
|
common.Injectable(),
|
|
791
|
-
_ts_param$
|
|
792
|
-
_ts_param$
|
|
793
|
-
_ts_param$
|
|
794
|
-
_ts_metadata$
|
|
795
|
-
_ts_metadata$
|
|
795
|
+
_ts_param$8(0, common.Inject(ZRomulatorFilesSystemsRepositoryToken)),
|
|
796
|
+
_ts_param$8(1, common.Inject(ZRomulatorFilesGamesRepositoryToken)),
|
|
797
|
+
_ts_param$8(2, common.Inject(lumberjackyNest.ZLoggerToken)),
|
|
798
|
+
_ts_metadata$8("design:type", Function),
|
|
799
|
+
_ts_metadata$8("design:paramtypes", [
|
|
796
800
|
typeof IZRomulatorFilesSystemsRepository === "undefined" ? Object : IZRomulatorFilesSystemsRepository,
|
|
797
801
|
typeof IZRomulatorFilesGamesRepository === "undefined" ? Object : IZRomulatorFilesGamesRepository,
|
|
798
802
|
typeof IZLogger === "undefined" ? Object : IZLogger
|
|
799
803
|
])
|
|
800
804
|
], ZRomulatorGamesService);
|
|
801
805
|
|
|
802
|
-
function _define_property$
|
|
806
|
+
function _define_property$8(obj, key, value) {
|
|
803
807
|
if (key in obj) {
|
|
804
808
|
Object.defineProperty(obj, key, {
|
|
805
809
|
value: value,
|
|
@@ -812,16 +816,16 @@ function _define_property$4(obj, key, value) {
|
|
|
812
816
|
}
|
|
813
817
|
return obj;
|
|
814
818
|
}
|
|
815
|
-
function _ts_decorate$
|
|
819
|
+
function _ts_decorate$c(decorators, target, key, desc) {
|
|
816
820
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
817
821
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
818
822
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
819
823
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
820
824
|
}
|
|
821
|
-
function _ts_metadata$
|
|
825
|
+
function _ts_metadata$7(k, v) {
|
|
822
826
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
823
827
|
}
|
|
824
|
-
function _ts_param$
|
|
828
|
+
function _ts_param$7(paramIndex, decorator) {
|
|
825
829
|
return function(target, key) {
|
|
826
830
|
decorator(target, key, paramIndex);
|
|
827
831
|
};
|
|
@@ -834,38 +838,39 @@ class ZRomulatorGamesController {
|
|
|
834
838
|
return this._games.get(identification);
|
|
835
839
|
}
|
|
836
840
|
constructor(_games){
|
|
837
|
-
_define_property$
|
|
841
|
+
_define_property$8(this, "_games", void 0);
|
|
838
842
|
this._games = _games;
|
|
839
843
|
}
|
|
840
844
|
}
|
|
841
|
-
_ts_decorate$
|
|
845
|
+
_ts_decorate$c([
|
|
842
846
|
common.Get(),
|
|
843
|
-
_ts_param$
|
|
844
|
-
_ts_metadata$
|
|
845
|
-
_ts_metadata$
|
|
847
|
+
_ts_param$7(0, common.Query()),
|
|
848
|
+
_ts_metadata$7("design:type", Function),
|
|
849
|
+
_ts_metadata$7("design:paramtypes", [
|
|
846
850
|
typeof IZDataRequestQuery === "undefined" ? Object : IZDataRequestQuery
|
|
847
851
|
]),
|
|
848
|
-
_ts_metadata$
|
|
852
|
+
_ts_metadata$7("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
849
853
|
], ZRomulatorGamesController.prototype, "list", null);
|
|
850
|
-
_ts_decorate$
|
|
854
|
+
_ts_decorate$c([
|
|
851
855
|
common.Get(":identification"),
|
|
852
|
-
_ts_param$
|
|
853
|
-
_ts_metadata$
|
|
854
|
-
_ts_metadata$
|
|
856
|
+
_ts_param$7(0, common.Param("identification")),
|
|
857
|
+
_ts_metadata$7("design:type", Function),
|
|
858
|
+
_ts_metadata$7("design:paramtypes", [
|
|
855
859
|
String
|
|
856
860
|
]),
|
|
857
|
-
_ts_metadata$
|
|
861
|
+
_ts_metadata$7("design:returntype", void 0)
|
|
858
862
|
], ZRomulatorGamesController.prototype, "get", null);
|
|
859
|
-
ZRomulatorGamesController = _ts_decorate$
|
|
863
|
+
ZRomulatorGamesController = _ts_decorate$c([
|
|
864
|
+
swagger.ApiTags("Games"),
|
|
860
865
|
common.Controller("games"),
|
|
861
|
-
_ts_param$
|
|
862
|
-
_ts_metadata$
|
|
863
|
-
_ts_metadata$
|
|
866
|
+
_ts_param$7(0, common.Inject(ZRomulatorGamesToken)),
|
|
867
|
+
_ts_metadata$7("design:type", Function),
|
|
868
|
+
_ts_metadata$7("design:paramtypes", [
|
|
864
869
|
typeof IZRomulatorGamesService === "undefined" ? Object : IZRomulatorGamesService
|
|
865
870
|
])
|
|
866
871
|
], ZRomulatorGamesController);
|
|
867
872
|
|
|
868
|
-
function _ts_decorate$
|
|
873
|
+
function _ts_decorate$b(decorators, target, key, desc) {
|
|
869
874
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
870
875
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
871
876
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -873,7 +878,7 @@ function _ts_decorate$8(decorators, target, key, desc) {
|
|
|
873
878
|
}
|
|
874
879
|
class ZRomulatorGamesModule {
|
|
875
880
|
}
|
|
876
|
-
ZRomulatorGamesModule = _ts_decorate$
|
|
881
|
+
ZRomulatorGamesModule = _ts_decorate$b([
|
|
877
882
|
common.Module({
|
|
878
883
|
imports: [
|
|
879
884
|
ZRomulatorFilesModule,
|
|
@@ -891,6 +896,325 @@ ZRomulatorGamesModule = _ts_decorate$8([
|
|
|
891
896
|
})
|
|
892
897
|
], ZRomulatorGamesModule);
|
|
893
898
|
|
|
899
|
+
function _define_property$7(obj, key, value) {
|
|
900
|
+
if (key in obj) {
|
|
901
|
+
Object.defineProperty(obj, key, {
|
|
902
|
+
value: value,
|
|
903
|
+
enumerable: true,
|
|
904
|
+
configurable: true,
|
|
905
|
+
writable: true
|
|
906
|
+
});
|
|
907
|
+
} else {
|
|
908
|
+
obj[key] = value;
|
|
909
|
+
}
|
|
910
|
+
return obj;
|
|
911
|
+
}
|
|
912
|
+
const ZRomulatorJobsRepositoryToken = Symbol("jobs-repository");
|
|
913
|
+
/**
|
|
914
|
+
* The implementation of the IZRomulatorJobsRepository.
|
|
915
|
+
*/ class ZRomulatorJobsRepository {
|
|
916
|
+
async init() {
|
|
917
|
+
const dir = ZDir.jobs();
|
|
918
|
+
await new crumbtrailFs.ZStreamFolder().write(dir);
|
|
919
|
+
await this._files.initialize(dir, [
|
|
920
|
+
"**/*.rjb"
|
|
921
|
+
]);
|
|
922
|
+
}
|
|
923
|
+
async jobs() {
|
|
924
|
+
const req = new helpfulQuery.ZDataRequestBuilder().build();
|
|
925
|
+
const candidates = await this._files.retrieve(req);
|
|
926
|
+
// Most of these will be cached by the file stream the
|
|
927
|
+
// first time this method is invoked. Job files are generally
|
|
928
|
+
// VERY small (less than 100kb).
|
|
929
|
+
const streams = candidates.map((node)=>node.path).map((path)=>this._stream.read(path));
|
|
930
|
+
const results = await Promise.allSettled(streams);
|
|
931
|
+
const jobs = [];
|
|
932
|
+
for(let i = 0; i < results.length; ++i){
|
|
933
|
+
const file = candidates[i];
|
|
934
|
+
const result = results[i];
|
|
935
|
+
const value = lodashEs.get(result, "value")?.toString("utf-8");
|
|
936
|
+
const content = helpfulFn.tryJsonParse(value);
|
|
937
|
+
if (content == null) {
|
|
938
|
+
continue;
|
|
939
|
+
}
|
|
940
|
+
const id = lodashEs.get(content, "id");
|
|
941
|
+
const type = lodashEs.get(content, "type");
|
|
942
|
+
if (!id || !romulatorClient.isJobType(type)) {
|
|
943
|
+
continue;
|
|
944
|
+
}
|
|
945
|
+
const context = lodashEs.get(content, "context");
|
|
946
|
+
const job = new romulatorClient.ZJobBuilder().id(id).type(type).context(context).createdAt(file.created).build();
|
|
947
|
+
jobs.push(job);
|
|
948
|
+
}
|
|
949
|
+
return jobs;
|
|
950
|
+
}
|
|
951
|
+
constructor(){
|
|
952
|
+
_define_property$7(this, "_files", new crumbtrailFs.ZFileRepository());
|
|
953
|
+
_define_property$7(this, "_stream", new crumbtrailFs.ZStreamFile());
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
function _define_property$6(obj, key, value) {
|
|
958
|
+
if (key in obj) {
|
|
959
|
+
Object.defineProperty(obj, key, {
|
|
960
|
+
value: value,
|
|
961
|
+
enumerable: true,
|
|
962
|
+
configurable: true,
|
|
963
|
+
writable: true
|
|
964
|
+
});
|
|
965
|
+
} else {
|
|
966
|
+
obj[key] = value;
|
|
967
|
+
}
|
|
968
|
+
return obj;
|
|
969
|
+
}
|
|
970
|
+
function _ts_decorate$a(decorators, target, key, desc) {
|
|
971
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
972
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
973
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
974
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
975
|
+
}
|
|
976
|
+
function _ts_metadata$6(k, v) {
|
|
977
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
978
|
+
}
|
|
979
|
+
function _ts_param$6(paramIndex, decorator) {
|
|
980
|
+
return function(target, key) {
|
|
981
|
+
decorator(target, key, paramIndex);
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
const ZRomulatorJobsToken = Symbol("romulator-jobs-service");
|
|
985
|
+
class ZRomulatorJobsService {
|
|
986
|
+
async list(req) {
|
|
987
|
+
let msg = "Querying jobs";
|
|
988
|
+
this._logger.log(new lumberjackyLog.ZLogEntryBuilder().info().message(msg).build());
|
|
989
|
+
const sort = new helpfulQuery.ZSortBuilder().sorts(helpfulFn.firstDefined([], req.sort)).ascending("createdAt").build();
|
|
990
|
+
const options = new helpfulQuery.ZDataSourceStaticOptionsBuilder().search(new helpfulQuery.ZDataSearchFields()).build();
|
|
991
|
+
const time = new Date();
|
|
992
|
+
const jobs = await this._files.jobs();
|
|
993
|
+
const span = new Date().getTime() - time.getTime();
|
|
994
|
+
msg = `Found ${jobs.length} jobs. Search took ${span} milliseconds`;
|
|
995
|
+
this._logger.log(new lumberjackyLog.ZLogEntryBuilder().info().message(msg).build());
|
|
996
|
+
const source = new helpfulQuery.ZDataSourceStatic(jobs, options);
|
|
997
|
+
const request = new helpfulQuery.ZDataRequestBuilder().copy(req).sort(sort).build();
|
|
998
|
+
const data = await source.retrieve(request);
|
|
999
|
+
const count = await source.count(request);
|
|
1000
|
+
return new helpfulQuery.ZPageBuilder().data(data).count(count).build();
|
|
1001
|
+
}
|
|
1002
|
+
async get(id) {
|
|
1003
|
+
const time = new Date();
|
|
1004
|
+
let msg = `Searching for job with id, ${id}`;
|
|
1005
|
+
const jobs = await this._files.jobs();
|
|
1006
|
+
const [candidate] = jobs.filter((j)=>j.id === id);
|
|
1007
|
+
const span = new Date().getTime() - time.getTime();
|
|
1008
|
+
if (candidate == null) {
|
|
1009
|
+
msg = `Job, ${id}, was not found.`;
|
|
1010
|
+
this._logger.log(new lumberjackyLog.ZLogEntryBuilder().warning().message(msg).build());
|
|
1011
|
+
throw new common.NotFoundException(msg);
|
|
1012
|
+
}
|
|
1013
|
+
msg = `Found ${candidate.type} job after ${span} milliseconds`;
|
|
1014
|
+
this._logger.log(new lumberjackyLog.ZLogEntryBuilder().info().message(msg).build());
|
|
1015
|
+
return candidate;
|
|
1016
|
+
}
|
|
1017
|
+
constructor(logger, _files){
|
|
1018
|
+
_define_property$6(this, "_files", void 0);
|
|
1019
|
+
_define_property$6(this, "_logger", void 0);
|
|
1020
|
+
this._files = _files;
|
|
1021
|
+
this._logger = new lumberjackyLog.ZLoggerContext("ZRomulatorJobsService", logger);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
ZRomulatorJobsService = _ts_decorate$a([
|
|
1025
|
+
common.Injectable(),
|
|
1026
|
+
_ts_param$6(0, common.Inject(lumberjackyNest.ZLoggerToken)),
|
|
1027
|
+
_ts_param$6(1, common.Inject(ZRomulatorJobsRepositoryToken)),
|
|
1028
|
+
_ts_metadata$6("design:type", Function),
|
|
1029
|
+
_ts_metadata$6("design:paramtypes", [
|
|
1030
|
+
typeof IZLogger === "undefined" ? Object : IZLogger,
|
|
1031
|
+
typeof IZRomulatorJobsRepository === "undefined" ? Object : IZRomulatorJobsRepository
|
|
1032
|
+
])
|
|
1033
|
+
], ZRomulatorJobsService);
|
|
1034
|
+
|
|
1035
|
+
function _define_property$5(obj, key, value) {
|
|
1036
|
+
if (key in obj) {
|
|
1037
|
+
Object.defineProperty(obj, key, {
|
|
1038
|
+
value: value,
|
|
1039
|
+
enumerable: true,
|
|
1040
|
+
configurable: true,
|
|
1041
|
+
writable: true
|
|
1042
|
+
});
|
|
1043
|
+
} else {
|
|
1044
|
+
obj[key] = value;
|
|
1045
|
+
}
|
|
1046
|
+
return obj;
|
|
1047
|
+
}
|
|
1048
|
+
function _ts_decorate$9(decorators, target, key, desc) {
|
|
1049
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1050
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1051
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1052
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1053
|
+
}
|
|
1054
|
+
function _ts_metadata$5(k, v) {
|
|
1055
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
1056
|
+
}
|
|
1057
|
+
function _ts_param$5(paramIndex, decorator) {
|
|
1058
|
+
return function(target, key) {
|
|
1059
|
+
decorator(target, key, paramIndex);
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
class ZRomulatorJobsController {
|
|
1063
|
+
list(params) {
|
|
1064
|
+
const request = new helpfulQuery.ZDataRequestBuilder().query(params).build();
|
|
1065
|
+
return this._jobs.list(request);
|
|
1066
|
+
}
|
|
1067
|
+
get(id) {
|
|
1068
|
+
return this._jobs.get(id);
|
|
1069
|
+
}
|
|
1070
|
+
constructor(_jobs){
|
|
1071
|
+
_define_property$5(this, "_jobs", void 0);
|
|
1072
|
+
this._jobs = _jobs;
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
_ts_decorate$9([
|
|
1076
|
+
swagger.ApiQuery({
|
|
1077
|
+
name: "page",
|
|
1078
|
+
required: false,
|
|
1079
|
+
type: Number,
|
|
1080
|
+
example: 1,
|
|
1081
|
+
description: "Page number (1-based)"
|
|
1082
|
+
}),
|
|
1083
|
+
swagger.ApiQuery({
|
|
1084
|
+
name: "size",
|
|
1085
|
+
required: false,
|
|
1086
|
+
type: Number,
|
|
1087
|
+
example: 20,
|
|
1088
|
+
description: "Items per page. Defaults to Infinity"
|
|
1089
|
+
}),
|
|
1090
|
+
swagger.ApiQuery({
|
|
1091
|
+
name: "search",
|
|
1092
|
+
required: false,
|
|
1093
|
+
type: String,
|
|
1094
|
+
description: "Search query"
|
|
1095
|
+
}),
|
|
1096
|
+
swagger.ApiQuery({
|
|
1097
|
+
name: "sort",
|
|
1098
|
+
required: false,
|
|
1099
|
+
type: String,
|
|
1100
|
+
description: "Sort criterion"
|
|
1101
|
+
}),
|
|
1102
|
+
swagger.ApiQuery({
|
|
1103
|
+
name: "filter",
|
|
1104
|
+
required: false,
|
|
1105
|
+
type: String,
|
|
1106
|
+
description: "Filter criterion"
|
|
1107
|
+
}),
|
|
1108
|
+
swagger.ApiResponse({
|
|
1109
|
+
status: webigailHttp.ZHttpCodeSuccess.OK,
|
|
1110
|
+
description: "Returns the requested page of jobs and the total count"
|
|
1111
|
+
}),
|
|
1112
|
+
common.Get(),
|
|
1113
|
+
_ts_param$5(0, common.Query()),
|
|
1114
|
+
_ts_metadata$5("design:type", Function),
|
|
1115
|
+
_ts_metadata$5("design:paramtypes", [
|
|
1116
|
+
typeof IZDataRequestQuery === "undefined" ? Object : IZDataRequestQuery
|
|
1117
|
+
]),
|
|
1118
|
+
_ts_metadata$5("design:returntype", void 0)
|
|
1119
|
+
], ZRomulatorJobsController.prototype, "list", null);
|
|
1120
|
+
_ts_decorate$9([
|
|
1121
|
+
swagger.ApiParam({
|
|
1122
|
+
type: "string",
|
|
1123
|
+
name: "id",
|
|
1124
|
+
description: "The id of the job"
|
|
1125
|
+
}),
|
|
1126
|
+
swagger.ApiResponse({
|
|
1127
|
+
status: webigailHttp.ZHttpCodeSuccess.OK,
|
|
1128
|
+
description: "Returns the job by id"
|
|
1129
|
+
}),
|
|
1130
|
+
swagger.ApiResponse({
|
|
1131
|
+
status: webigailHttp.ZHttpCodeClient.NotFound,
|
|
1132
|
+
description: "Job not found"
|
|
1133
|
+
}),
|
|
1134
|
+
common.Get(":id"),
|
|
1135
|
+
_ts_param$5(0, common.Param("id")),
|
|
1136
|
+
_ts_metadata$5("design:type", Function),
|
|
1137
|
+
_ts_metadata$5("design:paramtypes", [
|
|
1138
|
+
String
|
|
1139
|
+
]),
|
|
1140
|
+
_ts_metadata$5("design:returntype", void 0)
|
|
1141
|
+
], ZRomulatorJobsController.prototype, "get", null);
|
|
1142
|
+
ZRomulatorJobsController = _ts_decorate$9([
|
|
1143
|
+
swagger.ApiTags("Jobs"),
|
|
1144
|
+
common.Controller("jobs"),
|
|
1145
|
+
_ts_param$5(0, common.Inject(ZRomulatorJobsToken)),
|
|
1146
|
+
_ts_metadata$5("design:type", Function),
|
|
1147
|
+
_ts_metadata$5("design:paramtypes", [
|
|
1148
|
+
typeof IZRomulatorJobsService === "undefined" ? Object : IZRomulatorJobsService
|
|
1149
|
+
])
|
|
1150
|
+
], ZRomulatorJobsController);
|
|
1151
|
+
|
|
1152
|
+
function _define_property$4(obj, key, value) {
|
|
1153
|
+
if (key in obj) {
|
|
1154
|
+
Object.defineProperty(obj, key, {
|
|
1155
|
+
value: value,
|
|
1156
|
+
enumerable: true,
|
|
1157
|
+
configurable: true,
|
|
1158
|
+
writable: true
|
|
1159
|
+
});
|
|
1160
|
+
} else {
|
|
1161
|
+
obj[key] = value;
|
|
1162
|
+
}
|
|
1163
|
+
return obj;
|
|
1164
|
+
}
|
|
1165
|
+
function _ts_decorate$8(decorators, target, key, desc) {
|
|
1166
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1167
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1168
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1169
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1170
|
+
}
|
|
1171
|
+
function _ts_metadata$4(k, v) {
|
|
1172
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
1173
|
+
}
|
|
1174
|
+
function _ts_param$4(paramIndex, decorator) {
|
|
1175
|
+
return function(target, key) {
|
|
1176
|
+
decorator(target, key, paramIndex);
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
class ZRomulatorJobsModule {
|
|
1180
|
+
async onModuleInit() {
|
|
1181
|
+
await this._jobs.init();
|
|
1182
|
+
}
|
|
1183
|
+
constructor(_jobs){
|
|
1184
|
+
_define_property$4(this, "_jobs", void 0);
|
|
1185
|
+
this._jobs = _jobs;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
ZRomulatorJobsModule = _ts_decorate$8([
|
|
1189
|
+
common.Module({
|
|
1190
|
+
imports: [
|
|
1191
|
+
lumberjackyNest.ZLoggerModule,
|
|
1192
|
+
ZRomulatorFilesModule
|
|
1193
|
+
],
|
|
1194
|
+
controllers: [
|
|
1195
|
+
ZRomulatorJobsController
|
|
1196
|
+
],
|
|
1197
|
+
providers: [
|
|
1198
|
+
{
|
|
1199
|
+
provide: ZRomulatorJobsToken,
|
|
1200
|
+
useClass: ZRomulatorJobsService
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
provide: ZRomulatorJobsRepositoryToken,
|
|
1204
|
+
useClass: ZRomulatorJobsRepository
|
|
1205
|
+
}
|
|
1206
|
+
],
|
|
1207
|
+
exports: [
|
|
1208
|
+
ZRomulatorJobsToken
|
|
1209
|
+
]
|
|
1210
|
+
}),
|
|
1211
|
+
_ts_param$4(0, common.Inject(ZRomulatorJobsRepositoryToken)),
|
|
1212
|
+
_ts_metadata$4("design:type", Function),
|
|
1213
|
+
_ts_metadata$4("design:paramtypes", [
|
|
1214
|
+
typeof IZRomulatorJobsRepository === "undefined" ? Object : IZRomulatorJobsRepository
|
|
1215
|
+
])
|
|
1216
|
+
], ZRomulatorJobsModule);
|
|
1217
|
+
|
|
894
1218
|
function _ts_decorate$7(decorators, target, key, desc) {
|
|
895
1219
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
896
1220
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -991,7 +1315,7 @@ class ZRomulatorMediaService {
|
|
|
991
1315
|
}
|
|
992
1316
|
async get(id) {
|
|
993
1317
|
const time = new Date();
|
|
994
|
-
let log = `Searching for media with id ${id}.`;
|
|
1318
|
+
let log = `Searching for media with id, ${id}.`;
|
|
995
1319
|
this._logger.log(new lumberjackyLog.ZLogEntryBuilder().info().message(log).build());
|
|
996
1320
|
const media = await this.query(id);
|
|
997
1321
|
const span = new Date().getTime() - time.getTime();
|
|
@@ -1407,6 +1731,7 @@ _ts_decorate$2([
|
|
|
1407
1731
|
_ts_metadata("design:returntype", void 0)
|
|
1408
1732
|
], ZRomulatorSystemsController.prototype, "get", null);
|
|
1409
1733
|
ZRomulatorSystemsController = _ts_decorate$2([
|
|
1734
|
+
swagger.ApiTags("Systems"),
|
|
1410
1735
|
common.Controller("systems"),
|
|
1411
1736
|
_ts_param(0, common.Inject(ZRomulatorSystemsToken)),
|
|
1412
1737
|
_ts_metadata("design:type", Function),
|
|
@@ -1458,7 +1783,8 @@ ZRomulatorModule = _ts_decorate([
|
|
|
1458
1783
|
ZRomulatorSystemsModule,
|
|
1459
1784
|
ZRomulatorConfigsModule,
|
|
1460
1785
|
ZRomulatorMediaModule,
|
|
1461
|
-
ZRomulatorGamesModule
|
|
1786
|
+
ZRomulatorGamesModule,
|
|
1787
|
+
ZRomulatorJobsModule
|
|
1462
1788
|
]
|
|
1463
1789
|
})
|
|
1464
1790
|
], ZRomulatorModule);
|