@cenk1cenk2/oclif-common 6.0.3 → 6.1.0
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.d.ts +6 -6
- package/dist/index.js +261 -292
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -185,10 +185,10 @@ declare class ParserService {
|
|
|
185
185
|
private readonly logger;
|
|
186
186
|
parsers: ClassType<GenericParser>[];
|
|
187
187
|
constructor(moduleRef: ModuleRef, fs: FileSystemService, logger: LoggerService);
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
byFt(file: string): GenericParser;
|
|
189
|
+
fetch<T extends GenericParser>(Parser: ClassType<T>): T;
|
|
190
|
+
inject<T extends GenericParser>(Parser: ClassType<T>): Promise<T>;
|
|
191
|
+
register(...parsers: ClassType<GenericParser>[]): Promise<void>;
|
|
192
192
|
read<T = unknown>(file: string): Promise<T>;
|
|
193
193
|
write<T = LockableData>(file: string, data: T): Promise<void>;
|
|
194
194
|
parse<T = unknown>(file: string, data: string | Buffer): Promise<T>;
|
|
@@ -328,7 +328,7 @@ declare class ValidatorService {
|
|
|
328
328
|
private logValidationError;
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
declare function setup(): void
|
|
331
|
+
declare function setup(): Promise<void>;
|
|
332
332
|
|
|
333
333
|
interface CliModuleOptions {
|
|
334
334
|
config: ConfigModuleOptions;
|
|
@@ -343,7 +343,7 @@ declare class CliModule {
|
|
|
343
343
|
declare class ShouldRunBeforeHook {
|
|
344
344
|
shouldRunBefore(): void | Promise<void>;
|
|
345
345
|
}
|
|
346
|
-
declare class ShouldRunAfterHook<Ctx> {
|
|
346
|
+
declare class ShouldRunAfterHook<Ctx extends ListrContext = ListrContext> {
|
|
347
347
|
shouldRunAfter(ctx: Ctx): void | Promise<void>;
|
|
348
348
|
}
|
|
349
349
|
declare class RegisterHook {
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
5
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
6
|
-
}) : x)(function(x) {
|
|
7
|
-
if (typeof require !== "undefined")
|
|
8
|
-
return require.apply(this, arguments);
|
|
9
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
10
|
-
});
|
|
11
4
|
var __publicField = (obj, key, value) => {
|
|
12
5
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
13
6
|
return value;
|
|
@@ -34,7 +27,7 @@ var HelpGroups;
|
|
|
34
27
|
})(HelpGroups || (HelpGroups = {}));
|
|
35
28
|
|
|
36
29
|
// src/lib/config/config.service.ts
|
|
37
|
-
import { Inject as Inject2, Injectable as
|
|
30
|
+
import { Inject as Inject2, Injectable as Injectable5 } from "@nestjs/common";
|
|
38
31
|
import op from "object-path-immutable";
|
|
39
32
|
import { join } from "path";
|
|
40
33
|
|
|
@@ -406,12 +399,13 @@ LoggerModule = _ts_decorate3([
|
|
|
406
399
|
], LoggerModule);
|
|
407
400
|
|
|
408
401
|
// src/lib/parser/parser.service.ts
|
|
409
|
-
import { Injectable as
|
|
402
|
+
import { Injectable as Injectable4 } from "@nestjs/common";
|
|
410
403
|
import { ModuleRef } from "@nestjs/core";
|
|
411
404
|
|
|
412
|
-
// src/lib/
|
|
405
|
+
// src/lib/fs/filesystem.service.ts
|
|
413
406
|
import { Injectable as Injectable3 } from "@nestjs/common";
|
|
414
|
-
import
|
|
407
|
+
import fs from "fs-extra";
|
|
408
|
+
import { extname, dirname } from "path";
|
|
415
409
|
function _ts_decorate4(decorators, target, key, desc) {
|
|
416
410
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
417
411
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -429,164 +423,7 @@ function _ts_metadata3(k, v) {
|
|
|
429
423
|
}
|
|
430
424
|
__name(_ts_metadata3, "_ts_metadata");
|
|
431
425
|
var _a4;
|
|
432
|
-
var
|
|
433
|
-
constructor(logger) {
|
|
434
|
-
__publicField(this, "logger");
|
|
435
|
-
__publicField(this, "LINE");
|
|
436
|
-
this.logger = logger;
|
|
437
|
-
this.LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
|
|
438
|
-
this.logger.setup(this.constructor.name);
|
|
439
|
-
}
|
|
440
|
-
parse(data) {
|
|
441
|
-
try {
|
|
442
|
-
return data.toString().split(EOL2).reduce((o, line) => {
|
|
443
|
-
const match = this.LINE.exec(line);
|
|
444
|
-
const key = match[1];
|
|
445
|
-
const value = match[2] ?? "";
|
|
446
|
-
return {
|
|
447
|
-
...o,
|
|
448
|
-
[key]: value
|
|
449
|
-
};
|
|
450
|
-
}, {});
|
|
451
|
-
} catch (e) {
|
|
452
|
-
this.logger.trace("Error during parsing environment file: %s", e.message);
|
|
453
|
-
throw e;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
stringify(data) {
|
|
457
|
-
return Object.entries(data).map(([k, v]) => `${k}=${v}`).join(EOL2) + EOL2;
|
|
458
|
-
}
|
|
459
|
-
}, __name(_a4, "EnvironmentVariableParser"), __publicField(_a4, "extensions", [
|
|
460
|
-
"env"
|
|
461
|
-
]), _a4);
|
|
462
|
-
EnvironmentVariableParser = _ts_decorate4([
|
|
463
|
-
Injectable3(),
|
|
464
|
-
_ts_metadata3("design:type", Function),
|
|
465
|
-
_ts_metadata3("design:paramtypes", [
|
|
466
|
-
typeof LoggerService === "undefined" ? Object : LoggerService
|
|
467
|
-
])
|
|
468
|
-
], EnvironmentVariableParser);
|
|
469
|
-
|
|
470
|
-
// src/lib/parser/fts/json-parser.service.ts
|
|
471
|
-
import { Injectable as Injectable4 } from "@nestjs/common";
|
|
472
|
-
function _ts_decorate5(decorators, target, key, desc) {
|
|
473
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
474
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
475
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
476
|
-
else
|
|
477
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
478
|
-
if (d = decorators[i])
|
|
479
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
480
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
481
|
-
}
|
|
482
|
-
__name(_ts_decorate5, "_ts_decorate");
|
|
483
|
-
function _ts_metadata4(k, v) {
|
|
484
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
485
|
-
return Reflect.metadata(k, v);
|
|
486
|
-
}
|
|
487
|
-
__name(_ts_metadata4, "_ts_metadata");
|
|
488
|
-
var _a5;
|
|
489
|
-
var JsonParser = (_a5 = class {
|
|
490
|
-
constructor(logger) {
|
|
491
|
-
__publicField(this, "logger");
|
|
492
|
-
this.logger = logger;
|
|
493
|
-
this.logger.setup(this.constructor.name);
|
|
494
|
-
}
|
|
495
|
-
parse(data) {
|
|
496
|
-
try {
|
|
497
|
-
return JSON.parse(data.toString());
|
|
498
|
-
} catch (e) {
|
|
499
|
-
this.logger.trace("Error during parsing JSON file: %s", e.message);
|
|
500
|
-
throw e;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
stringify(data) {
|
|
504
|
-
return JSON.stringify(data, null, 2);
|
|
505
|
-
}
|
|
506
|
-
}, __name(_a5, "JsonParser"), __publicField(_a5, "extensions", [
|
|
507
|
-
"json"
|
|
508
|
-
]), _a5);
|
|
509
|
-
JsonParser = _ts_decorate5([
|
|
510
|
-
Injectable4(),
|
|
511
|
-
_ts_metadata4("design:type", Function),
|
|
512
|
-
_ts_metadata4("design:paramtypes", [
|
|
513
|
-
typeof LoggerService === "undefined" ? Object : LoggerService
|
|
514
|
-
])
|
|
515
|
-
], JsonParser);
|
|
516
|
-
|
|
517
|
-
// src/lib/parser/fts/yaml-parser.service.ts
|
|
518
|
-
import { Injectable as Injectable5 } from "@nestjs/common";
|
|
519
|
-
import { parse, stringify } from "yaml";
|
|
520
|
-
function _ts_decorate6(decorators, target, key, desc) {
|
|
521
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
522
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
523
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
524
|
-
else
|
|
525
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
526
|
-
if (d = decorators[i])
|
|
527
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
528
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
529
|
-
}
|
|
530
|
-
__name(_ts_decorate6, "_ts_decorate");
|
|
531
|
-
function _ts_metadata5(k, v) {
|
|
532
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
533
|
-
return Reflect.metadata(k, v);
|
|
534
|
-
}
|
|
535
|
-
__name(_ts_metadata5, "_ts_metadata");
|
|
536
|
-
var _a6;
|
|
537
|
-
var YamlParser = (_a6 = class {
|
|
538
|
-
constructor(logger) {
|
|
539
|
-
__publicField(this, "logger");
|
|
540
|
-
this.logger = logger;
|
|
541
|
-
this.logger.setup(this.constructor.name);
|
|
542
|
-
}
|
|
543
|
-
parse(data) {
|
|
544
|
-
try {
|
|
545
|
-
return parse(data.toString());
|
|
546
|
-
} catch (e) {
|
|
547
|
-
this.logger.trace("Error during parsing YAML file: %s", e.message);
|
|
548
|
-
throw e;
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
stringify(data) {
|
|
552
|
-
return stringify(data, {
|
|
553
|
-
prettyErrors: true
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
}, __name(_a6, "YamlParser"), __publicField(_a6, "extensions", [
|
|
557
|
-
"yaml",
|
|
558
|
-
"yml"
|
|
559
|
-
]), _a6);
|
|
560
|
-
YamlParser = _ts_decorate6([
|
|
561
|
-
Injectable5(),
|
|
562
|
-
_ts_metadata5("design:type", Function),
|
|
563
|
-
_ts_metadata5("design:paramtypes", [
|
|
564
|
-
typeof LoggerService === "undefined" ? Object : LoggerService
|
|
565
|
-
])
|
|
566
|
-
], YamlParser);
|
|
567
|
-
|
|
568
|
-
// src/lib/fs/filesystem.service.ts
|
|
569
|
-
import { Injectable as Injectable6 } from "@nestjs/common";
|
|
570
|
-
import fs from "fs-extra";
|
|
571
|
-
import { extname, dirname } from "path";
|
|
572
|
-
function _ts_decorate7(decorators, target, key, desc) {
|
|
573
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
574
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
575
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
576
|
-
else
|
|
577
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
578
|
-
if (d = decorators[i])
|
|
579
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
580
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
581
|
-
}
|
|
582
|
-
__name(_ts_decorate7, "_ts_decorate");
|
|
583
|
-
function _ts_metadata6(k, v) {
|
|
584
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
585
|
-
return Reflect.metadata(k, v);
|
|
586
|
-
}
|
|
587
|
-
__name(_ts_metadata6, "_ts_metadata");
|
|
588
|
-
var _a7;
|
|
589
|
-
var FileSystemService = (_a7 = class {
|
|
426
|
+
var FileSystemService = (_a4 = class {
|
|
590
427
|
constructor(logger) {
|
|
591
428
|
__publicField(this, "logger");
|
|
592
429
|
__publicField(this, "extra");
|
|
@@ -714,18 +551,18 @@ var FileSystemService = (_a7 = class {
|
|
|
714
551
|
throw new Error(`Error while creating the directory "${directory}": ${e.message}`);
|
|
715
552
|
}
|
|
716
553
|
}
|
|
717
|
-
}, __name(
|
|
718
|
-
FileSystemService =
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
554
|
+
}, __name(_a4, "FileSystemService"), _a4);
|
|
555
|
+
FileSystemService = _ts_decorate4([
|
|
556
|
+
Injectable3(),
|
|
557
|
+
_ts_metadata3("design:type", Function),
|
|
558
|
+
_ts_metadata3("design:paramtypes", [
|
|
722
559
|
typeof LoggerService === "undefined" ? Object : LoggerService
|
|
723
560
|
])
|
|
724
561
|
], FileSystemService);
|
|
725
562
|
|
|
726
563
|
// src/lib/fs/filesystem.module.ts
|
|
727
564
|
import { Global as Global2, Module as Module2 } from "@nestjs/common";
|
|
728
|
-
function
|
|
565
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
729
566
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
730
567
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
731
568
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -735,11 +572,11 @@ function _ts_decorate8(decorators, target, key, desc) {
|
|
|
735
572
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
736
573
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
737
574
|
}
|
|
738
|
-
__name(
|
|
739
|
-
var
|
|
740
|
-
var FilesystemModule = (
|
|
741
|
-
}, __name(
|
|
742
|
-
FilesystemModule =
|
|
575
|
+
__name(_ts_decorate5, "_ts_decorate");
|
|
576
|
+
var _a5;
|
|
577
|
+
var FilesystemModule = (_a5 = class {
|
|
578
|
+
}, __name(_a5, "FilesystemModule"), _a5);
|
|
579
|
+
FilesystemModule = _ts_decorate5([
|
|
743
580
|
Global2(),
|
|
744
581
|
Module2({
|
|
745
582
|
providers: [
|
|
@@ -752,7 +589,7 @@ FilesystemModule = _ts_decorate8([
|
|
|
752
589
|
], FilesystemModule);
|
|
753
590
|
|
|
754
591
|
// src/lib/parser/parser.service.ts
|
|
755
|
-
function
|
|
592
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
756
593
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
757
594
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
758
595
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -762,14 +599,14 @@ function _ts_decorate9(decorators, target, key, desc) {
|
|
|
762
599
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
763
600
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
764
601
|
}
|
|
765
|
-
__name(
|
|
766
|
-
function
|
|
602
|
+
__name(_ts_decorate6, "_ts_decorate");
|
|
603
|
+
function _ts_metadata4(k, v) {
|
|
767
604
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
768
605
|
return Reflect.metadata(k, v);
|
|
769
606
|
}
|
|
770
|
-
__name(
|
|
771
|
-
var
|
|
772
|
-
var ParserService = (
|
|
607
|
+
__name(_ts_metadata4, "_ts_metadata");
|
|
608
|
+
var _a6;
|
|
609
|
+
var ParserService = (_a6 = class {
|
|
773
610
|
constructor(moduleRef, fs2, logger) {
|
|
774
611
|
__publicField(this, "moduleRef");
|
|
775
612
|
__publicField(this, "fs");
|
|
@@ -778,32 +615,28 @@ var ParserService = (_a9 = class {
|
|
|
778
615
|
this.moduleRef = moduleRef;
|
|
779
616
|
this.fs = fs2;
|
|
780
617
|
this.logger = logger;
|
|
781
|
-
this.parsers = [
|
|
782
|
-
YamlParser,
|
|
783
|
-
JsonParser,
|
|
784
|
-
EnvironmentVariableParser
|
|
785
|
-
];
|
|
618
|
+
this.parsers = [];
|
|
786
619
|
this.logger.setup(this.constructor.name);
|
|
787
620
|
}
|
|
788
|
-
|
|
621
|
+
byFt(file) {
|
|
789
622
|
const ext = (file.includes(".") ? this.fs.extname(file) : file).replace(/^\./, "");
|
|
790
623
|
const Parser = this.parsers.find((parser) => parser.extensions.includes(ext));
|
|
791
624
|
if (!Parser) {
|
|
792
625
|
throw new Error(`Parser for the extension is not configured: ${ext}`);
|
|
793
626
|
}
|
|
794
|
-
return this.
|
|
627
|
+
return this.fetch(Parser);
|
|
628
|
+
}
|
|
629
|
+
fetch(Parser) {
|
|
630
|
+
return this.moduleRef.get(Parser);
|
|
795
631
|
}
|
|
796
|
-
async
|
|
632
|
+
async inject(Parser) {
|
|
797
633
|
const parser = await this.moduleRef.create(Parser);
|
|
798
634
|
return parser;
|
|
799
635
|
}
|
|
800
|
-
|
|
801
|
-
this.parsers = parsers;
|
|
802
|
-
this.logger.trace("Set parsers: %s", this.parsers.map((p) => p.name));
|
|
803
|
-
}
|
|
804
|
-
addParsers(...parsers) {
|
|
636
|
+
async register(...parsers) {
|
|
805
637
|
this.parsers.push(...parsers);
|
|
806
|
-
|
|
638
|
+
await Promise.all(parsers.map(async (parser) => this.inject(parser)));
|
|
639
|
+
this.logger.trace("Registered parsers: %o", this.parsers.map((p) => p.name));
|
|
807
640
|
}
|
|
808
641
|
async read(file) {
|
|
809
642
|
return this.parse(file, await this.fs.read(file));
|
|
@@ -812,20 +645,20 @@ var ParserService = (_a9 = class {
|
|
|
812
645
|
return this.fs.write(file, await this.stringify(file, data));
|
|
813
646
|
}
|
|
814
647
|
async parse(file, data) {
|
|
815
|
-
const parser =
|
|
648
|
+
const parser = this.byFt(file);
|
|
816
649
|
this.logger.trace("Parsing file: %s -> %s", file, parser.constructor.name);
|
|
817
650
|
return parser.parse(data);
|
|
818
651
|
}
|
|
819
652
|
async stringify(file, data) {
|
|
820
|
-
const parser =
|
|
653
|
+
const parser = this.byFt(file);
|
|
821
654
|
this.logger.trace("Stringifying file: %s -> %s", file, parser.constructor.name);
|
|
822
655
|
return parser.stringify(data);
|
|
823
656
|
}
|
|
824
|
-
}, __name(
|
|
825
|
-
ParserService =
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
657
|
+
}, __name(_a6, "ParserService"), _a6);
|
|
658
|
+
ParserService = _ts_decorate6([
|
|
659
|
+
Injectable4(),
|
|
660
|
+
_ts_metadata4("design:type", Function),
|
|
661
|
+
_ts_metadata4("design:paramtypes", [
|
|
829
662
|
typeof ModuleRef === "undefined" ? Object : ModuleRef,
|
|
830
663
|
typeof FileSystemService === "undefined" ? Object : FileSystemService,
|
|
831
664
|
typeof LoggerService === "undefined" ? Object : LoggerService
|
|
@@ -910,7 +743,7 @@ __name(uniqueArrayFilter, "uniqueArrayFilter");
|
|
|
910
743
|
import { ux } from "@oclif/core";
|
|
911
744
|
|
|
912
745
|
// src/lib/config/config.service.ts
|
|
913
|
-
function
|
|
746
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
914
747
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
915
748
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
916
749
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -920,20 +753,20 @@ function _ts_decorate10(decorators, target, key, desc) {
|
|
|
920
753
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
921
754
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
922
755
|
}
|
|
923
|
-
__name(
|
|
924
|
-
function
|
|
756
|
+
__name(_ts_decorate7, "_ts_decorate");
|
|
757
|
+
function _ts_metadata5(k, v) {
|
|
925
758
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
926
759
|
return Reflect.metadata(k, v);
|
|
927
760
|
}
|
|
928
|
-
__name(
|
|
761
|
+
__name(_ts_metadata5, "_ts_metadata");
|
|
929
762
|
function _ts_param2(paramIndex, decorator) {
|
|
930
763
|
return function(target, key) {
|
|
931
764
|
decorator(target, key, paramIndex);
|
|
932
765
|
};
|
|
933
766
|
}
|
|
934
767
|
__name(_ts_param2, "_ts_param");
|
|
935
|
-
var
|
|
936
|
-
var ConfigService = (
|
|
768
|
+
var _a7;
|
|
769
|
+
var ConfigService = (_a7 = class {
|
|
937
770
|
constructor(parser, logger, options) {
|
|
938
771
|
__publicField(this, "parser");
|
|
939
772
|
__publicField(this, "logger");
|
|
@@ -1081,12 +914,12 @@ var ConfigService = (_a10 = class {
|
|
|
1081
914
|
async write(path, data) {
|
|
1082
915
|
return this.parser.write(path, data);
|
|
1083
916
|
}
|
|
1084
|
-
}, __name(
|
|
1085
|
-
ConfigService =
|
|
1086
|
-
|
|
917
|
+
}, __name(_a7, "ConfigService"), _a7);
|
|
918
|
+
ConfigService = _ts_decorate7([
|
|
919
|
+
Injectable5(),
|
|
1087
920
|
_ts_param2(2, Inject2(TOKEN_CONFIG_MODULE_OPTIONS)),
|
|
1088
|
-
|
|
1089
|
-
|
|
921
|
+
_ts_metadata5("design:type", Function),
|
|
922
|
+
_ts_metadata5("design:paramtypes", [
|
|
1090
923
|
typeof ParserService === "undefined" ? Object : ParserService,
|
|
1091
924
|
typeof LoggerService === "undefined" ? Object : LoggerService,
|
|
1092
925
|
typeof ConfigModuleOptions === "undefined" ? Object : ConfigModuleOptions
|
|
@@ -1098,7 +931,7 @@ import { Global as Global4, Module as Module4 } from "@nestjs/common";
|
|
|
1098
931
|
|
|
1099
932
|
// src/lib/parser/parser.module.ts
|
|
1100
933
|
import { Global as Global3, Module as Module3 } from "@nestjs/common";
|
|
1101
|
-
function
|
|
934
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
1102
935
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1103
936
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1104
937
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1108,11 +941,11 @@ function _ts_decorate11(decorators, target, key, desc) {
|
|
|
1108
941
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1109
942
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1110
943
|
}
|
|
1111
|
-
__name(
|
|
1112
|
-
var
|
|
1113
|
-
var ParserModule = (
|
|
1114
|
-
}, __name(
|
|
1115
|
-
ParserModule =
|
|
944
|
+
__name(_ts_decorate8, "_ts_decorate");
|
|
945
|
+
var _a8;
|
|
946
|
+
var ParserModule = (_a8 = class {
|
|
947
|
+
}, __name(_a8, "ParserModule"), _a8);
|
|
948
|
+
ParserModule = _ts_decorate8([
|
|
1116
949
|
Global3(),
|
|
1117
950
|
Module3({
|
|
1118
951
|
imports: [
|
|
@@ -1128,7 +961,7 @@ ParserModule = _ts_decorate11([
|
|
|
1128
961
|
], ParserModule);
|
|
1129
962
|
|
|
1130
963
|
// src/lib/config/config.module.ts
|
|
1131
|
-
function
|
|
964
|
+
function _ts_decorate9(decorators, target, key, desc) {
|
|
1132
965
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1133
966
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1134
967
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1138,11 +971,11 @@ function _ts_decorate12(decorators, target, key, desc) {
|
|
|
1138
971
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1139
972
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1140
973
|
}
|
|
1141
|
-
__name(
|
|
1142
|
-
var
|
|
1143
|
-
var ConfigModule = (
|
|
1144
|
-
}, __name(
|
|
1145
|
-
ConfigModule =
|
|
974
|
+
__name(_ts_decorate9, "_ts_decorate");
|
|
975
|
+
var _a9;
|
|
976
|
+
var ConfigModule = (_a9 = class {
|
|
977
|
+
}, __name(_a9, "ConfigModule"), _a9);
|
|
978
|
+
ConfigModule = _ts_decorate9([
|
|
1146
979
|
Global4(),
|
|
1147
980
|
Module4({
|
|
1148
981
|
imports: [
|
|
@@ -1158,9 +991,9 @@ ConfigModule = _ts_decorate12([
|
|
|
1158
991
|
], ConfigModule);
|
|
1159
992
|
|
|
1160
993
|
// src/lib/locker/locker.service.ts
|
|
1161
|
-
import { Injectable as
|
|
994
|
+
import { Injectable as Injectable6 } from "@nestjs/common";
|
|
1162
995
|
import op2 from "object-path-immutable";
|
|
1163
|
-
function
|
|
996
|
+
function _ts_decorate10(decorators, target, key, desc) {
|
|
1164
997
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1165
998
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1166
999
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1170,14 +1003,14 @@ function _ts_decorate13(decorators, target, key, desc) {
|
|
|
1170
1003
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1171
1004
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1172
1005
|
}
|
|
1173
|
-
__name(
|
|
1174
|
-
function
|
|
1006
|
+
__name(_ts_decorate10, "_ts_decorate");
|
|
1007
|
+
function _ts_metadata6(k, v) {
|
|
1175
1008
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1176
1009
|
return Reflect.metadata(k, v);
|
|
1177
1010
|
}
|
|
1178
|
-
__name(
|
|
1179
|
-
var
|
|
1180
|
-
var LockerService = (
|
|
1011
|
+
__name(_ts_metadata6, "_ts_metadata");
|
|
1012
|
+
var _a10;
|
|
1013
|
+
var LockerService = (_a10 = class {
|
|
1181
1014
|
constructor(logger, fs2, options) {
|
|
1182
1015
|
__publicField(this, "logger");
|
|
1183
1016
|
__publicField(this, "fs");
|
|
@@ -1318,11 +1151,11 @@ var LockerService = (_a13 = class {
|
|
|
1318
1151
|
}
|
|
1319
1152
|
return [];
|
|
1320
1153
|
}
|
|
1321
|
-
}, __name(
|
|
1322
|
-
LockerService =
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1154
|
+
}, __name(_a10, "LockerService"), _a10);
|
|
1155
|
+
LockerService = _ts_decorate10([
|
|
1156
|
+
Injectable6(),
|
|
1157
|
+
_ts_metadata6("design:type", Function),
|
|
1158
|
+
_ts_metadata6("design:paramtypes", [
|
|
1326
1159
|
typeof LoggerService === "undefined" ? Object : LoggerService,
|
|
1327
1160
|
typeof FileSystemService === "undefined" ? Object : FileSystemService,
|
|
1328
1161
|
typeof LockerServiceOptions === "undefined" ? Object : LockerServiceOptions
|
|
@@ -1331,7 +1164,7 @@ LockerService = _ts_decorate13([
|
|
|
1331
1164
|
|
|
1332
1165
|
// src/lib/locker/locker.module.ts
|
|
1333
1166
|
import { Module as Module5 } from "@nestjs/common";
|
|
1334
|
-
function
|
|
1167
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
1335
1168
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1336
1169
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1337
1170
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1341,13 +1174,13 @@ function _ts_decorate14(decorators, target, key, desc) {
|
|
|
1341
1174
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1342
1175
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1343
1176
|
}
|
|
1344
|
-
__name(
|
|
1345
|
-
var
|
|
1346
|
-
var LockerModule = (
|
|
1177
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
1178
|
+
var _a11;
|
|
1179
|
+
var LockerModule = (_a11 = class {
|
|
1347
1180
|
static forFeature(options) {
|
|
1348
1181
|
const token = options.token ?? LockerService;
|
|
1349
1182
|
return {
|
|
1350
|
-
module:
|
|
1183
|
+
module: _a11,
|
|
1351
1184
|
providers: [
|
|
1352
1185
|
{
|
|
1353
1186
|
provide: token,
|
|
@@ -1360,8 +1193,8 @@ var LockerModule = (_a14 = class {
|
|
|
1360
1193
|
]
|
|
1361
1194
|
};
|
|
1362
1195
|
}
|
|
1363
|
-
}, __name(
|
|
1364
|
-
LockerModule =
|
|
1196
|
+
}, __name(_a11, "LockerModule"), _a11);
|
|
1197
|
+
LockerModule = _ts_decorate11([
|
|
1365
1198
|
Module5({})
|
|
1366
1199
|
], LockerModule);
|
|
1367
1200
|
|
|
@@ -1372,10 +1205,10 @@ var TOKEN_LOGO_GENERATOR = Symbol("TOKEN_LOGO_GENERATOR");
|
|
|
1372
1205
|
import { Module as Module6 } from "@nestjs/common";
|
|
1373
1206
|
|
|
1374
1207
|
// src/lib/logo/logo.service.ts
|
|
1375
|
-
import { Injectable as
|
|
1208
|
+
import { Injectable as Injectable7 } from "@nestjs/common";
|
|
1376
1209
|
import { ModuleRef as ModuleRef2 } from "@nestjs/core";
|
|
1377
|
-
import { EOL as
|
|
1378
|
-
function
|
|
1210
|
+
import { EOL as EOL2 } from "os";
|
|
1211
|
+
function _ts_decorate12(decorators, target, key, desc) {
|
|
1379
1212
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1380
1213
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1381
1214
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1385,14 +1218,14 @@ function _ts_decorate15(decorators, target, key, desc) {
|
|
|
1385
1218
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1386
1219
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1387
1220
|
}
|
|
1388
|
-
__name(
|
|
1389
|
-
function
|
|
1221
|
+
__name(_ts_decorate12, "_ts_decorate");
|
|
1222
|
+
function _ts_metadata7(k, v) {
|
|
1390
1223
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1391
1224
|
return Reflect.metadata(k, v);
|
|
1392
1225
|
}
|
|
1393
|
-
__name(
|
|
1394
|
-
var
|
|
1395
|
-
var LogoService = (
|
|
1226
|
+
__name(_ts_metadata7, "_ts_metadata");
|
|
1227
|
+
var _a12;
|
|
1228
|
+
var LogoService = (_a12 = class {
|
|
1396
1229
|
constructor(cs, moduleRef) {
|
|
1397
1230
|
__publicField(this, "cs");
|
|
1398
1231
|
__publicField(this, "generator");
|
|
@@ -1417,20 +1250,20 @@ var LogoService = (_a15 = class {
|
|
|
1417
1250
|
return this.cs.isJson || this.cs.isSilent;
|
|
1418
1251
|
}
|
|
1419
1252
|
write(...data) {
|
|
1420
|
-
process.stdout.write(data.join(" ") +
|
|
1253
|
+
process.stdout.write(data.join(" ") + EOL2);
|
|
1421
1254
|
}
|
|
1422
|
-
}, __name(
|
|
1423
|
-
LogoService =
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1255
|
+
}, __name(_a12, "LogoService"), _a12);
|
|
1256
|
+
LogoService = _ts_decorate12([
|
|
1257
|
+
Injectable7(),
|
|
1258
|
+
_ts_metadata7("design:type", Function),
|
|
1259
|
+
_ts_metadata7("design:paramtypes", [
|
|
1427
1260
|
typeof ConfigService === "undefined" ? Object : ConfigService,
|
|
1428
1261
|
typeof ModuleRef2 === "undefined" ? Object : ModuleRef2
|
|
1429
1262
|
])
|
|
1430
1263
|
], LogoService);
|
|
1431
1264
|
|
|
1432
1265
|
// src/lib/logo/logo.module.ts
|
|
1433
|
-
function
|
|
1266
|
+
function _ts_decorate13(decorators, target, key, desc) {
|
|
1434
1267
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1435
1268
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1436
1269
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1440,11 +1273,11 @@ function _ts_decorate16(decorators, target, key, desc) {
|
|
|
1440
1273
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1441
1274
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1442
1275
|
}
|
|
1443
|
-
__name(
|
|
1444
|
-
var
|
|
1445
|
-
var LogoModule = (
|
|
1446
|
-
}, __name(
|
|
1447
|
-
LogoModule =
|
|
1276
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
1277
|
+
var _a13;
|
|
1278
|
+
var LogoModule = (_a13 = class {
|
|
1279
|
+
}, __name(_a13, "LogoModule"), _a13);
|
|
1280
|
+
LogoModule = _ts_decorate13([
|
|
1448
1281
|
Module6({
|
|
1449
1282
|
providers: [
|
|
1450
1283
|
LogoService
|
|
@@ -1455,6 +1288,162 @@ LogoModule = _ts_decorate16([
|
|
|
1455
1288
|
})
|
|
1456
1289
|
], LogoModule);
|
|
1457
1290
|
|
|
1291
|
+
// src/lib/parser/fts/env-parser.service.ts
|
|
1292
|
+
import { Injectable as Injectable8 } from "@nestjs/common";
|
|
1293
|
+
import { EOL as EOL3 } from "os";
|
|
1294
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
1295
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1296
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1297
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1298
|
+
else
|
|
1299
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1300
|
+
if (d = decorators[i])
|
|
1301
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1302
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1303
|
+
}
|
|
1304
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
1305
|
+
function _ts_metadata8(k, v) {
|
|
1306
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1307
|
+
return Reflect.metadata(k, v);
|
|
1308
|
+
}
|
|
1309
|
+
__name(_ts_metadata8, "_ts_metadata");
|
|
1310
|
+
var _a14;
|
|
1311
|
+
var EnvironmentVariableParser = (_a14 = class {
|
|
1312
|
+
constructor(logger) {
|
|
1313
|
+
__publicField(this, "logger");
|
|
1314
|
+
__publicField(this, "LINE");
|
|
1315
|
+
this.logger = logger;
|
|
1316
|
+
this.LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
|
|
1317
|
+
this.logger.setup(this.constructor.name);
|
|
1318
|
+
}
|
|
1319
|
+
parse(data) {
|
|
1320
|
+
try {
|
|
1321
|
+
return data.toString().split(EOL3).reduce((o, line) => {
|
|
1322
|
+
const match = this.LINE.exec(line);
|
|
1323
|
+
const key = match[1];
|
|
1324
|
+
const value = match[2] ?? "";
|
|
1325
|
+
return {
|
|
1326
|
+
...o,
|
|
1327
|
+
[key]: value
|
|
1328
|
+
};
|
|
1329
|
+
}, {});
|
|
1330
|
+
} catch (e) {
|
|
1331
|
+
this.logger.trace("Error during parsing environment file: %s", e.message);
|
|
1332
|
+
throw e;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
stringify(data) {
|
|
1336
|
+
return Object.entries(data).map(([k, v]) => `${k}=${v}`).join(EOL3) + EOL3;
|
|
1337
|
+
}
|
|
1338
|
+
}, __name(_a14, "EnvironmentVariableParser"), __publicField(_a14, "extensions", [
|
|
1339
|
+
"env"
|
|
1340
|
+
]), _a14);
|
|
1341
|
+
EnvironmentVariableParser = _ts_decorate14([
|
|
1342
|
+
Injectable8(),
|
|
1343
|
+
_ts_metadata8("design:type", Function),
|
|
1344
|
+
_ts_metadata8("design:paramtypes", [
|
|
1345
|
+
typeof LoggerService === "undefined" ? Object : LoggerService
|
|
1346
|
+
])
|
|
1347
|
+
], EnvironmentVariableParser);
|
|
1348
|
+
|
|
1349
|
+
// src/lib/parser/fts/json-parser.service.ts
|
|
1350
|
+
import { Injectable as Injectable9 } from "@nestjs/common";
|
|
1351
|
+
function _ts_decorate15(decorators, target, key, desc) {
|
|
1352
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1353
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1354
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1355
|
+
else
|
|
1356
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1357
|
+
if (d = decorators[i])
|
|
1358
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1359
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1360
|
+
}
|
|
1361
|
+
__name(_ts_decorate15, "_ts_decorate");
|
|
1362
|
+
function _ts_metadata9(k, v) {
|
|
1363
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1364
|
+
return Reflect.metadata(k, v);
|
|
1365
|
+
}
|
|
1366
|
+
__name(_ts_metadata9, "_ts_metadata");
|
|
1367
|
+
var _a15;
|
|
1368
|
+
var JsonParser = (_a15 = class {
|
|
1369
|
+
constructor(logger) {
|
|
1370
|
+
__publicField(this, "logger");
|
|
1371
|
+
this.logger = logger;
|
|
1372
|
+
this.logger.setup(this.constructor.name);
|
|
1373
|
+
}
|
|
1374
|
+
parse(data) {
|
|
1375
|
+
try {
|
|
1376
|
+
return JSON.parse(data.toString());
|
|
1377
|
+
} catch (e) {
|
|
1378
|
+
this.logger.trace("Error during parsing JSON file: %s", e.message);
|
|
1379
|
+
throw e;
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
stringify(data) {
|
|
1383
|
+
return JSON.stringify(data, null, 2);
|
|
1384
|
+
}
|
|
1385
|
+
}, __name(_a15, "JsonParser"), __publicField(_a15, "extensions", [
|
|
1386
|
+
"json"
|
|
1387
|
+
]), _a15);
|
|
1388
|
+
JsonParser = _ts_decorate15([
|
|
1389
|
+
Injectable9(),
|
|
1390
|
+
_ts_metadata9("design:type", Function),
|
|
1391
|
+
_ts_metadata9("design:paramtypes", [
|
|
1392
|
+
typeof LoggerService === "undefined" ? Object : LoggerService
|
|
1393
|
+
])
|
|
1394
|
+
], JsonParser);
|
|
1395
|
+
|
|
1396
|
+
// src/lib/parser/fts/yaml-parser.service.ts
|
|
1397
|
+
import { Injectable as Injectable10 } from "@nestjs/common";
|
|
1398
|
+
import { parse, stringify } from "yaml";
|
|
1399
|
+
function _ts_decorate16(decorators, target, key, desc) {
|
|
1400
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1401
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1402
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1403
|
+
else
|
|
1404
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1405
|
+
if (d = decorators[i])
|
|
1406
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1407
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1408
|
+
}
|
|
1409
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
1410
|
+
function _ts_metadata10(k, v) {
|
|
1411
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1412
|
+
return Reflect.metadata(k, v);
|
|
1413
|
+
}
|
|
1414
|
+
__name(_ts_metadata10, "_ts_metadata");
|
|
1415
|
+
var _a16;
|
|
1416
|
+
var YamlParser = (_a16 = class {
|
|
1417
|
+
constructor(logger) {
|
|
1418
|
+
__publicField(this, "logger");
|
|
1419
|
+
this.logger = logger;
|
|
1420
|
+
this.logger.setup(this.constructor.name);
|
|
1421
|
+
}
|
|
1422
|
+
parse(data) {
|
|
1423
|
+
try {
|
|
1424
|
+
return parse(data.toString());
|
|
1425
|
+
} catch (e) {
|
|
1426
|
+
this.logger.trace("Error during parsing YAML file: %s", e.message);
|
|
1427
|
+
throw e;
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
stringify(data) {
|
|
1431
|
+
return stringify(data, {
|
|
1432
|
+
prettyErrors: true
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
}, __name(_a16, "YamlParser"), __publicField(_a16, "extensions", [
|
|
1436
|
+
"yaml",
|
|
1437
|
+
"yml"
|
|
1438
|
+
]), _a16);
|
|
1439
|
+
YamlParser = _ts_decorate16([
|
|
1440
|
+
Injectable10(),
|
|
1441
|
+
_ts_metadata10("design:type", Function),
|
|
1442
|
+
_ts_metadata10("design:paramtypes", [
|
|
1443
|
+
typeof LoggerService === "undefined" ? Object : LoggerService
|
|
1444
|
+
])
|
|
1445
|
+
], YamlParser);
|
|
1446
|
+
|
|
1458
1447
|
// src/lib/validator/validator.constants.ts
|
|
1459
1448
|
var TOKEN_VALIDATOR_SERVICE_OPTIONS = Symbol("TOKEN_VALIDATOR_SERVICE_OPTIONS");
|
|
1460
1449
|
|
|
@@ -1582,35 +1571,15 @@ ValidatorModule = _ts_decorate18([
|
|
|
1582
1571
|
], ValidatorModule);
|
|
1583
1572
|
|
|
1584
1573
|
// src/lib/setup.ts
|
|
1585
|
-
function setup() {
|
|
1574
|
+
async function setup() {
|
|
1586
1575
|
const inspect = process.argv.indexOf("--inspect");
|
|
1587
1576
|
if (inspect !== -1) {
|
|
1588
|
-
|
|
1577
|
+
await import("inspector").then((mod) => mod.open());
|
|
1589
1578
|
process.argv.splice(inspect, 1);
|
|
1590
1579
|
}
|
|
1591
|
-
const verbose = process.argv.indexOf("--verbose");
|
|
1592
|
-
if (verbose !== -1) {
|
|
1593
|
-
process.env.LOG_LEVEL = "verbose";
|
|
1594
|
-
process.argv.splice(verbose, 1);
|
|
1595
|
-
}
|
|
1596
|
-
const debug = process.argv.indexOf("--debug");
|
|
1597
|
-
if (debug !== -1) {
|
|
1598
|
-
process.env.LOG_LEVEL = "debug";
|
|
1599
|
-
process.argv.splice(debug, 1);
|
|
1600
|
-
}
|
|
1601
|
-
const trace = process.argv.indexOf("--trace");
|
|
1602
|
-
if (trace !== -1) {
|
|
1603
|
-
process.env.LOG_LEVEL = "trace";
|
|
1604
|
-
process.argv.splice(trace, 1);
|
|
1605
|
-
}
|
|
1606
|
-
const silent = process.argv.indexOf("--silent");
|
|
1607
|
-
if (silent !== -1) {
|
|
1608
|
-
process.env.LOG_LEVEL = "silent";
|
|
1609
|
-
process.argv.splice(silent, 1);
|
|
1610
|
-
}
|
|
1611
1580
|
const sourceMaps = process.argv.indexOf("--source-map");
|
|
1612
1581
|
if (sourceMaps !== -1) {
|
|
1613
|
-
|
|
1582
|
+
await import("source-map-support").then((mod) => mod.install());
|
|
1614
1583
|
process.argv.splice(sourceMaps, 1);
|
|
1615
1584
|
}
|
|
1616
1585
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cenk1cenk2/oclif-common",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Oclif common package for oclif2 projects.",
|
|
5
5
|
"repository": "https://gitlab.kilic.dev/libraries/oclif-tools",
|
|
6
6
|
"type": "module",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"execa": "^8.0.1",
|
|
81
81
|
"fs-extra": "^11.1.1",
|
|
82
82
|
"listr2": "^7.0.2",
|
|
83
|
+
"source-map-support": "^0.5.21",
|
|
83
84
|
"yaml": "^2.3.3"
|
|
84
85
|
}
|
|
85
86
|
}
|