webpipe-js 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +26 -8
- package/dist/index.mjs +26 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -659,14 +659,6 @@ function printDescribe(describe) {
|
|
|
659
659
|
}
|
|
660
660
|
function prettyPrint(program) {
|
|
661
661
|
const lines = [];
|
|
662
|
-
program.routes.forEach((route) => {
|
|
663
|
-
lines.push(printRoute(route));
|
|
664
|
-
lines.push("");
|
|
665
|
-
});
|
|
666
|
-
program.describes.forEach((describe) => {
|
|
667
|
-
lines.push(printDescribe(describe));
|
|
668
|
-
lines.push("");
|
|
669
|
-
});
|
|
670
662
|
if (program.configs.length > 0) {
|
|
671
663
|
lines.push("## Config");
|
|
672
664
|
program.configs.forEach((config) => {
|
|
@@ -674,6 +666,10 @@ function prettyPrint(program) {
|
|
|
674
666
|
lines.push("");
|
|
675
667
|
});
|
|
676
668
|
}
|
|
669
|
+
program.routes.forEach((route) => {
|
|
670
|
+
lines.push(printRoute(route));
|
|
671
|
+
lines.push("");
|
|
672
|
+
});
|
|
677
673
|
program.pipelines.forEach((pipeline) => {
|
|
678
674
|
lines.push(printPipeline(pipeline));
|
|
679
675
|
lines.push("");
|
|
@@ -682,6 +678,10 @@ function prettyPrint(program) {
|
|
|
682
678
|
lines.push(printVariable(variable));
|
|
683
679
|
});
|
|
684
680
|
if (program.variables.length > 0) lines.push("");
|
|
681
|
+
program.describes.forEach((describe) => {
|
|
682
|
+
lines.push(printDescribe(describe));
|
|
683
|
+
lines.push("");
|
|
684
|
+
});
|
|
685
685
|
return lines.join("\n").trim();
|
|
686
686
|
}
|
|
687
687
|
function formatConfigValue(value) {
|
|
@@ -716,10 +716,28 @@ function formatStepConfig(config) {
|
|
|
716
716
|
return `\`${config}\``;
|
|
717
717
|
} else if (config.includes(" ")) {
|
|
718
718
|
return `"${config}"`;
|
|
719
|
+
} else if (isAuthStringValue(config)) {
|
|
720
|
+
return `"${config}"`;
|
|
719
721
|
} else {
|
|
720
722
|
return config;
|
|
721
723
|
}
|
|
722
724
|
}
|
|
725
|
+
function isAuthStringValue(config) {
|
|
726
|
+
const authValues = [
|
|
727
|
+
"login",
|
|
728
|
+
"logout",
|
|
729
|
+
"register",
|
|
730
|
+
"required",
|
|
731
|
+
"optional"
|
|
732
|
+
];
|
|
733
|
+
if (authValues.includes(config)) {
|
|
734
|
+
return true;
|
|
735
|
+
}
|
|
736
|
+
if (config.startsWith("type:")) {
|
|
737
|
+
return true;
|
|
738
|
+
}
|
|
739
|
+
return false;
|
|
740
|
+
}
|
|
723
741
|
function formatPipelineRef(ref) {
|
|
724
742
|
if (ref.kind === "Named") {
|
|
725
743
|
return [` |> pipeline: ${ref.name}`];
|
package/dist/index.mjs
CHANGED
|
@@ -616,14 +616,6 @@ function printDescribe(describe) {
|
|
|
616
616
|
}
|
|
617
617
|
function prettyPrint(program) {
|
|
618
618
|
const lines = [];
|
|
619
|
-
program.routes.forEach((route) => {
|
|
620
|
-
lines.push(printRoute(route));
|
|
621
|
-
lines.push("");
|
|
622
|
-
});
|
|
623
|
-
program.describes.forEach((describe) => {
|
|
624
|
-
lines.push(printDescribe(describe));
|
|
625
|
-
lines.push("");
|
|
626
|
-
});
|
|
627
619
|
if (program.configs.length > 0) {
|
|
628
620
|
lines.push("## Config");
|
|
629
621
|
program.configs.forEach((config) => {
|
|
@@ -631,6 +623,10 @@ function prettyPrint(program) {
|
|
|
631
623
|
lines.push("");
|
|
632
624
|
});
|
|
633
625
|
}
|
|
626
|
+
program.routes.forEach((route) => {
|
|
627
|
+
lines.push(printRoute(route));
|
|
628
|
+
lines.push("");
|
|
629
|
+
});
|
|
634
630
|
program.pipelines.forEach((pipeline) => {
|
|
635
631
|
lines.push(printPipeline(pipeline));
|
|
636
632
|
lines.push("");
|
|
@@ -639,6 +635,10 @@ function prettyPrint(program) {
|
|
|
639
635
|
lines.push(printVariable(variable));
|
|
640
636
|
});
|
|
641
637
|
if (program.variables.length > 0) lines.push("");
|
|
638
|
+
program.describes.forEach((describe) => {
|
|
639
|
+
lines.push(printDescribe(describe));
|
|
640
|
+
lines.push("");
|
|
641
|
+
});
|
|
642
642
|
return lines.join("\n").trim();
|
|
643
643
|
}
|
|
644
644
|
function formatConfigValue(value) {
|
|
@@ -673,10 +673,28 @@ function formatStepConfig(config) {
|
|
|
673
673
|
return `\`${config}\``;
|
|
674
674
|
} else if (config.includes(" ")) {
|
|
675
675
|
return `"${config}"`;
|
|
676
|
+
} else if (isAuthStringValue(config)) {
|
|
677
|
+
return `"${config}"`;
|
|
676
678
|
} else {
|
|
677
679
|
return config;
|
|
678
680
|
}
|
|
679
681
|
}
|
|
682
|
+
function isAuthStringValue(config) {
|
|
683
|
+
const authValues = [
|
|
684
|
+
"login",
|
|
685
|
+
"logout",
|
|
686
|
+
"register",
|
|
687
|
+
"required",
|
|
688
|
+
"optional"
|
|
689
|
+
];
|
|
690
|
+
if (authValues.includes(config)) {
|
|
691
|
+
return true;
|
|
692
|
+
}
|
|
693
|
+
if (config.startsWith("type:")) {
|
|
694
|
+
return true;
|
|
695
|
+
}
|
|
696
|
+
return false;
|
|
697
|
+
}
|
|
680
698
|
function formatPipelineRef(ref) {
|
|
681
699
|
if (ref.kind === "Named") {
|
|
682
700
|
return [` |> pipeline: ${ref.name}`];
|