@zthun/romulator-api 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/files/files-module.d.mts +5 -0
- package/dist/files/files-service.d.mts +10 -0
- package/dist/main.cjs +103 -75
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +103 -75
- package/dist/main.js.map +1 -1
- package/package.json +6 -6
package/dist/main.js
CHANGED
|
@@ -27,7 +27,7 @@ function _ts_decorate$g(decorators, target, key, desc) {
|
|
|
27
27
|
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;
|
|
28
28
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
29
29
|
}
|
|
30
|
-
function _ts_metadata$
|
|
30
|
+
function _ts_metadata$b(k, v) {
|
|
31
31
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
32
32
|
}
|
|
33
33
|
class ZRomulatorConfigUpdateDto {
|
|
@@ -45,7 +45,7 @@ _ts_decorate$g([
|
|
|
45
45
|
message: "The contents of the config must be an object "
|
|
46
46
|
}),
|
|
47
47
|
IsNotEmptyObject(),
|
|
48
|
-
_ts_metadata$
|
|
48
|
+
_ts_metadata$b("design:type", typeof T === "undefined" ? Object : T)
|
|
49
49
|
], ZRomulatorConfigUpdateDto.prototype, "contents", void 0);
|
|
50
50
|
|
|
51
51
|
class ZDir {
|
|
@@ -78,10 +78,10 @@ function _ts_decorate$f(decorators, target, key, desc) {
|
|
|
78
78
|
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;
|
|
79
79
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
80
80
|
}
|
|
81
|
-
function _ts_metadata$
|
|
81
|
+
function _ts_metadata$a(k, v) {
|
|
82
82
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
83
83
|
}
|
|
84
|
-
function _ts_param$
|
|
84
|
+
function _ts_param$9(paramIndex, decorator) {
|
|
85
85
|
return function(target, key) {
|
|
86
86
|
decorator(target, key, paramIndex);
|
|
87
87
|
};
|
|
@@ -165,9 +165,9 @@ class ZRomulatorConfigsService {
|
|
|
165
165
|
}
|
|
166
166
|
ZRomulatorConfigsService = _ts_decorate$f([
|
|
167
167
|
Injectable(),
|
|
168
|
-
_ts_param$
|
|
169
|
-
_ts_metadata$
|
|
170
|
-
_ts_metadata$
|
|
168
|
+
_ts_param$9(0, Inject(ZLoggerToken)),
|
|
169
|
+
_ts_metadata$a("design:type", Function),
|
|
170
|
+
_ts_metadata$a("design:paramtypes", [
|
|
171
171
|
typeof IZLogger === "undefined" ? Object : IZLogger
|
|
172
172
|
])
|
|
173
173
|
], ZRomulatorConfigsService);
|
|
@@ -178,10 +178,10 @@ function _ts_decorate$e(decorators, target, key, desc) {
|
|
|
178
178
|
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;
|
|
179
179
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
180
180
|
}
|
|
181
|
-
function _ts_metadata$
|
|
181
|
+
function _ts_metadata$9(k, v) {
|
|
182
182
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
183
183
|
}
|
|
184
|
-
function _ts_param$
|
|
184
|
+
function _ts_param$8(paramIndex, decorator) {
|
|
185
185
|
return function(target, key) {
|
|
186
186
|
decorator(target, key, paramIndex);
|
|
187
187
|
};
|
|
@@ -204,12 +204,12 @@ class ZRomulatorConfigsController {
|
|
|
204
204
|
}
|
|
205
205
|
_ts_decorate$e([
|
|
206
206
|
Get(),
|
|
207
|
-
_ts_param$
|
|
208
|
-
_ts_metadata$
|
|
209
|
-
_ts_metadata$
|
|
207
|
+
_ts_param$8(0, Query()),
|
|
208
|
+
_ts_metadata$9("design:type", Function),
|
|
209
|
+
_ts_metadata$9("design:paramtypes", [
|
|
210
210
|
typeof IZDataRequestQuery === "undefined" ? Object : IZDataRequestQuery
|
|
211
211
|
]),
|
|
212
|
-
_ts_metadata$
|
|
212
|
+
_ts_metadata$9("design:returntype", Promise)
|
|
213
213
|
], ZRomulatorConfigsController.prototype, "list", null);
|
|
214
214
|
_ts_decorate$e([
|
|
215
215
|
ApiParam({
|
|
@@ -228,14 +228,14 @@ _ts_decorate$e([
|
|
|
228
228
|
skipNullProperties: false,
|
|
229
229
|
skipUndefinedProperties: false
|
|
230
230
|
})),
|
|
231
|
-
_ts_param$
|
|
232
|
-
_ts_param$
|
|
233
|
-
_ts_metadata$
|
|
234
|
-
_ts_metadata$
|
|
231
|
+
_ts_param$8(0, Param("identification")),
|
|
232
|
+
_ts_param$8(1, Body()),
|
|
233
|
+
_ts_metadata$9("design:type", Function),
|
|
234
|
+
_ts_metadata$9("design:paramtypes", [
|
|
235
235
|
typeof ZRomulatorConfigId === "undefined" ? Object : ZRomulatorConfigId,
|
|
236
236
|
typeof ZRomulatorConfigUpdateDto === "undefined" ? Object : ZRomulatorConfigUpdateDto
|
|
237
237
|
]),
|
|
238
|
-
_ts_metadata$
|
|
238
|
+
_ts_metadata$9("design:returntype", Promise)
|
|
239
239
|
], ZRomulatorConfigsController.prototype, "update", null);
|
|
240
240
|
_ts_decorate$e([
|
|
241
241
|
ApiParam({
|
|
@@ -244,18 +244,18 @@ _ts_decorate$e([
|
|
|
244
244
|
description: "The id of the config"
|
|
245
245
|
}),
|
|
246
246
|
Get(":identification"),
|
|
247
|
-
_ts_param$
|
|
248
|
-
_ts_metadata$
|
|
249
|
-
_ts_metadata$
|
|
247
|
+
_ts_param$8(0, Param("identification")),
|
|
248
|
+
_ts_metadata$9("design:type", Function),
|
|
249
|
+
_ts_metadata$9("design:paramtypes", [
|
|
250
250
|
typeof ZRomulatorConfigId === "undefined" ? Object : ZRomulatorConfigId
|
|
251
251
|
]),
|
|
252
|
-
_ts_metadata$
|
|
252
|
+
_ts_metadata$9("design:returntype", Promise)
|
|
253
253
|
], ZRomulatorConfigsController.prototype, "get", null);
|
|
254
254
|
ZRomulatorConfigsController = _ts_decorate$e([
|
|
255
255
|
Controller("configs"),
|
|
256
|
-
_ts_param$
|
|
257
|
-
_ts_metadata$
|
|
258
|
-
_ts_metadata$
|
|
256
|
+
_ts_param$8(0, Inject(ZRomulatorConfigsToken)),
|
|
257
|
+
_ts_metadata$9("design:type", Function),
|
|
258
|
+
_ts_metadata$9("design:paramtypes", [
|
|
259
259
|
typeof IZRomulatorConfigsService === "undefined" ? Object : IZRomulatorConfigsService
|
|
260
260
|
])
|
|
261
261
|
], ZRomulatorConfigsController);
|
|
@@ -295,7 +295,7 @@ function _ts_decorate$c(decorators, target, key, desc) {
|
|
|
295
295
|
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;
|
|
296
296
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
297
297
|
}
|
|
298
|
-
function _ts_metadata$
|
|
298
|
+
function _ts_metadata$8(k, v) {
|
|
299
299
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
300
300
|
}
|
|
301
301
|
const KnownSystem = "@zthunworks/romulator/known-system";
|
|
@@ -393,45 +393,45 @@ const KnownSystem = "@zthunworks/romulator/known-system";
|
|
|
393
393
|
}
|
|
394
394
|
_ts_decorate$c([
|
|
395
395
|
ZTag(KnownSystem),
|
|
396
|
-
_ts_metadata$
|
|
397
|
-
_ts_metadata$
|
|
398
|
-
_ts_metadata$
|
|
396
|
+
_ts_metadata$8("design:type", Function),
|
|
397
|
+
_ts_metadata$8("design:paramtypes", []),
|
|
398
|
+
_ts_metadata$8("design:returntype", void 0)
|
|
399
399
|
], ZRomulatorSystemKnown, "nes", null);
|
|
400
400
|
_ts_decorate$c([
|
|
401
401
|
ZTag(KnownSystem),
|
|
402
|
-
_ts_metadata$
|
|
403
|
-
_ts_metadata$
|
|
404
|
-
_ts_metadata$
|
|
402
|
+
_ts_metadata$8("design:type", Function),
|
|
403
|
+
_ts_metadata$8("design:paramtypes", []),
|
|
404
|
+
_ts_metadata$8("design:returntype", void 0)
|
|
405
405
|
], ZRomulatorSystemKnown, "snes", null);
|
|
406
406
|
_ts_decorate$c([
|
|
407
407
|
ZTag(KnownSystem),
|
|
408
|
-
_ts_metadata$
|
|
409
|
-
_ts_metadata$
|
|
410
|
-
_ts_metadata$
|
|
408
|
+
_ts_metadata$8("design:type", Function),
|
|
409
|
+
_ts_metadata$8("design:paramtypes", []),
|
|
410
|
+
_ts_metadata$8("design:returntype", void 0)
|
|
411
411
|
], ZRomulatorSystemKnown, "n64", null);
|
|
412
412
|
_ts_decorate$c([
|
|
413
413
|
ZTag(KnownSystem),
|
|
414
|
-
_ts_metadata$
|
|
415
|
-
_ts_metadata$
|
|
416
|
-
_ts_metadata$
|
|
414
|
+
_ts_metadata$8("design:type", Function),
|
|
415
|
+
_ts_metadata$8("design:paramtypes", []),
|
|
416
|
+
_ts_metadata$8("design:returntype", void 0)
|
|
417
417
|
], ZRomulatorSystemKnown, "gc", null);
|
|
418
418
|
_ts_decorate$c([
|
|
419
419
|
ZTag(KnownSystem),
|
|
420
|
-
_ts_metadata$
|
|
421
|
-
_ts_metadata$
|
|
422
|
-
_ts_metadata$
|
|
420
|
+
_ts_metadata$8("design:type", Function),
|
|
421
|
+
_ts_metadata$8("design:paramtypes", []),
|
|
422
|
+
_ts_metadata$8("design:returntype", void 0)
|
|
423
423
|
], ZRomulatorSystemKnown, "wii", null);
|
|
424
424
|
_ts_decorate$c([
|
|
425
425
|
ZTag(KnownSystem),
|
|
426
|
-
_ts_metadata$
|
|
427
|
-
_ts_metadata$
|
|
428
|
-
_ts_metadata$
|
|
426
|
+
_ts_metadata$8("design:type", Function),
|
|
427
|
+
_ts_metadata$8("design:paramtypes", []),
|
|
428
|
+
_ts_metadata$8("design:returntype", void 0)
|
|
429
429
|
], ZRomulatorSystemKnown, "wiiu", null);
|
|
430
430
|
_ts_decorate$c([
|
|
431
431
|
ZTag(KnownSystem),
|
|
432
|
-
_ts_metadata$
|
|
433
|
-
_ts_metadata$
|
|
434
|
-
_ts_metadata$
|
|
432
|
+
_ts_metadata$8("design:type", Function),
|
|
433
|
+
_ts_metadata$8("design:paramtypes", []),
|
|
434
|
+
_ts_metadata$8("design:returntype", void 0)
|
|
435
435
|
], ZRomulatorSystemKnown, "switch", null);
|
|
436
436
|
|
|
437
437
|
/**
|
|
@@ -460,10 +460,10 @@ function _ts_decorate$b(decorators, target, key, desc) {
|
|
|
460
460
|
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;
|
|
461
461
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
462
462
|
}
|
|
463
|
-
function _ts_metadata$
|
|
463
|
+
function _ts_metadata$7(k, v) {
|
|
464
464
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
465
465
|
}
|
|
466
|
-
function _ts_param$
|
|
466
|
+
function _ts_param$7(paramIndex, decorator) {
|
|
467
467
|
return function(target, key) {
|
|
468
468
|
decorator(target, key, paramIndex);
|
|
469
469
|
};
|
|
@@ -521,11 +521,11 @@ class ZRomulatorGamesService {
|
|
|
521
521
|
}
|
|
522
522
|
ZRomulatorGamesService = _ts_decorate$b([
|
|
523
523
|
Injectable(),
|
|
524
|
-
_ts_param$
|
|
525
|
-
_ts_param$
|
|
526
|
-
_ts_param$
|
|
527
|
-
_ts_metadata$
|
|
528
|
-
_ts_metadata$
|
|
524
|
+
_ts_param$7(0, Inject(ZFileSystemToken)),
|
|
525
|
+
_ts_param$7(1, Inject(ZRomulatorConfigsToken)),
|
|
526
|
+
_ts_param$7(2, Inject(ZLoggerToken)),
|
|
527
|
+
_ts_metadata$7("design:type", Function),
|
|
528
|
+
_ts_metadata$7("design:paramtypes", [
|
|
529
529
|
typeof IZFileSystemService === "undefined" ? Object : IZFileSystemService,
|
|
530
530
|
typeof IZRomulatorConfigsService === "undefined" ? Object : IZRomulatorConfigsService,
|
|
531
531
|
typeof IZLogger === "undefined" ? Object : IZLogger
|
|
@@ -538,10 +538,10 @@ function _ts_decorate$a(decorators, target, key, desc) {
|
|
|
538
538
|
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;
|
|
539
539
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
540
540
|
}
|
|
541
|
-
function _ts_metadata$
|
|
541
|
+
function _ts_metadata$6(k, v) {
|
|
542
542
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
543
543
|
}
|
|
544
|
-
function _ts_param$
|
|
544
|
+
function _ts_param$6(paramIndex, decorator) {
|
|
545
545
|
return function(target, key) {
|
|
546
546
|
decorator(target, key, paramIndex);
|
|
547
547
|
};
|
|
@@ -560,27 +560,27 @@ class ZRomulatorGamesController {
|
|
|
560
560
|
}
|
|
561
561
|
_ts_decorate$a([
|
|
562
562
|
Get(),
|
|
563
|
-
_ts_param$
|
|
564
|
-
_ts_metadata$
|
|
565
|
-
_ts_metadata$
|
|
563
|
+
_ts_param$6(0, Query()),
|
|
564
|
+
_ts_metadata$6("design:type", Function),
|
|
565
|
+
_ts_metadata$6("design:paramtypes", [
|
|
566
566
|
typeof IZDataRequestQuery === "undefined" ? Object : IZDataRequestQuery
|
|
567
567
|
]),
|
|
568
|
-
_ts_metadata$
|
|
568
|
+
_ts_metadata$6("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
569
569
|
], ZRomulatorGamesController.prototype, "list", null);
|
|
570
570
|
_ts_decorate$a([
|
|
571
571
|
Get(":identification"),
|
|
572
|
-
_ts_param$
|
|
573
|
-
_ts_metadata$
|
|
574
|
-
_ts_metadata$
|
|
572
|
+
_ts_param$6(0, Param("identification")),
|
|
573
|
+
_ts_metadata$6("design:type", Function),
|
|
574
|
+
_ts_metadata$6("design:paramtypes", [
|
|
575
575
|
String
|
|
576
576
|
]),
|
|
577
|
-
_ts_metadata$
|
|
577
|
+
_ts_metadata$6("design:returntype", void 0)
|
|
578
578
|
], ZRomulatorGamesController.prototype, "get", null);
|
|
579
579
|
ZRomulatorGamesController = _ts_decorate$a([
|
|
580
580
|
Controller("games"),
|
|
581
|
-
_ts_param$
|
|
582
|
-
_ts_metadata$
|
|
583
|
-
_ts_metadata$
|
|
581
|
+
_ts_param$6(0, Inject(ZRomulatorGamesToken)),
|
|
582
|
+
_ts_metadata$6("design:type", Function),
|
|
583
|
+
_ts_metadata$6("design:paramtypes", [
|
|
584
584
|
typeof IZRomulatorGamesService === "undefined" ? Object : IZRomulatorGamesService
|
|
585
585
|
])
|
|
586
586
|
], ZRomulatorGamesController);
|
|
@@ -618,10 +618,10 @@ function _ts_decorate$8(decorators, target, key, desc) {
|
|
|
618
618
|
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;
|
|
619
619
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
620
620
|
}
|
|
621
|
-
function _ts_metadata$
|
|
621
|
+
function _ts_metadata$5(k, v) {
|
|
622
622
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
623
623
|
}
|
|
624
|
-
function _ts_param$
|
|
624
|
+
function _ts_param$5(paramIndex, decorator) {
|
|
625
625
|
return function(target, key) {
|
|
626
626
|
decorator(target, key, paramIndex);
|
|
627
627
|
};
|
|
@@ -646,7 +646,6 @@ class ZRomulatorFilesService {
|
|
|
646
646
|
...slugs.map((s)=>`${s}/*.*`)
|
|
647
647
|
];
|
|
648
648
|
this._systems = Object.values(ZRomulatorSystemId);
|
|
649
|
-
this.seed();
|
|
650
649
|
}
|
|
651
650
|
async gamesFolder() {
|
|
652
651
|
const config = await this._configs.get(ZRomulatorConfigId$1.Games);
|
|
@@ -674,6 +673,12 @@ class ZRomulatorFilesService {
|
|
|
674
673
|
const nodes = await repository.retrieve(request);
|
|
675
674
|
return path == null ? nodes : firstDefined(null, first(nodes));
|
|
676
675
|
}
|
|
676
|
+
async init() {
|
|
677
|
+
await this.seed();
|
|
678
|
+
}
|
|
679
|
+
async dispose() {
|
|
680
|
+
await this._repository.reset();
|
|
681
|
+
}
|
|
677
682
|
async seed() {
|
|
678
683
|
const path = await this.gamesFolder();
|
|
679
684
|
if (this._repository.path !== path) {
|
|
@@ -706,10 +711,10 @@ class ZRomulatorFilesService {
|
|
|
706
711
|
}
|
|
707
712
|
ZRomulatorFilesService = _ts_decorate$8([
|
|
708
713
|
Injectable(),
|
|
709
|
-
_ts_param$
|
|
710
|
-
_ts_param$
|
|
711
|
-
_ts_metadata$
|
|
712
|
-
_ts_metadata$
|
|
714
|
+
_ts_param$5(0, Inject(ZRomulatorConfigsToken)),
|
|
715
|
+
_ts_param$5(1, Inject(ZFileSystemToken)),
|
|
716
|
+
_ts_metadata$5("design:type", Function),
|
|
717
|
+
_ts_metadata$5("design:paramtypes", [
|
|
713
718
|
typeof IZRomulatorConfigsService === "undefined" ? Object : IZRomulatorConfigsService,
|
|
714
719
|
typeof IZFileSystemService === "undefined" ? Object : IZFileSystemService
|
|
715
720
|
])
|
|
@@ -721,7 +726,25 @@ function _ts_decorate$7(decorators, target, key, desc) {
|
|
|
721
726
|
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;
|
|
722
727
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
723
728
|
}
|
|
729
|
+
function _ts_metadata$4(k, v) {
|
|
730
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
731
|
+
}
|
|
732
|
+
function _ts_param$4(paramIndex, decorator) {
|
|
733
|
+
return function(target, key) {
|
|
734
|
+
decorator(target, key, paramIndex);
|
|
735
|
+
};
|
|
736
|
+
}
|
|
724
737
|
class ZRomulatorFilesModule {
|
|
738
|
+
_files;
|
|
739
|
+
constructor(_files){
|
|
740
|
+
this._files = _files;
|
|
741
|
+
}
|
|
742
|
+
async onModuleInit() {
|
|
743
|
+
await this._files.init();
|
|
744
|
+
}
|
|
745
|
+
async onModuleDestroy() {
|
|
746
|
+
await this._files.dispose();
|
|
747
|
+
}
|
|
725
748
|
}
|
|
726
749
|
ZRomulatorFilesModule = _ts_decorate$7([
|
|
727
750
|
Module({
|
|
@@ -738,7 +761,12 @@ ZRomulatorFilesModule = _ts_decorate$7([
|
|
|
738
761
|
exports: [
|
|
739
762
|
ZRomulatorFilesToken
|
|
740
763
|
]
|
|
741
|
-
})
|
|
764
|
+
}),
|
|
765
|
+
_ts_param$4(0, Inject(ZRomulatorFilesToken)),
|
|
766
|
+
_ts_metadata$4("design:type", Function),
|
|
767
|
+
_ts_metadata$4("design:paramtypes", [
|
|
768
|
+
typeof IZRomulatorFilesService === "undefined" ? Object : IZRomulatorFilesService
|
|
769
|
+
])
|
|
742
770
|
], ZRomulatorFilesModule);
|
|
743
771
|
|
|
744
772
|
function _ts_decorate$6(decorators, target, key, desc) {
|