@ordergroove/smi-serve 1.13.4 → 1.14.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/CHANGELOG.md +11 -0
- package/coverage/cobertura-coverage.xml +151 -121
- package/coverage/coverage.txt +6 -5
- package/package.json +2 -2
- package/smi-serve.js +5 -0
- package/src/partials/devmode.js +10 -1
- package/src/partials/entrypoint.js +6 -4
- package/src/serve.js +19 -0
- package/src/sspc.js +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.14.0](https://github.com/ordergroove/plush-toys/compare/@ordergroove/smi-serve@1.13.4...@ordergroove/smi-serve@1.14.0) (2026-05-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **smi-serve:** Use real merchant configs ([44690c2](https://github.com/ordergroove/plush-toys/commit/44690c2c6ebaa074fe89f0e6c5b591dce0f0ea01))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.13.4](https://github.com/ordergroove/plush-toys/compare/@ordergroove/smi-serve@1.13.3...@ordergroove/smi-serve@1.13.4) (2026-04-28)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<?xml version="1.0" ?>
|
|
2
2
|
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
|
|
3
|
-
<coverage lines-valid="
|
|
3
|
+
<coverage lines-valid="675" lines-covered="230" line-rate="0.3407" branches-valid="250" branches-covered="45" branch-rate="0.18" timestamp="1779888784032" complexity="0" version="0.1">
|
|
4
4
|
<sources>
|
|
5
5
|
<source>/home/jenkins/agent/workspace/Ordergroove_plush-toys_master/plush-toys/packages/smi-serve</source>
|
|
6
6
|
</sources>
|
|
7
7
|
<packages>
|
|
8
|
-
<package name="smi-serve" line-rate="0.
|
|
8
|
+
<package name="smi-serve" line-rate="0.36219999999999997" branch-rate="0.2045">
|
|
9
9
|
<classes>
|
|
10
10
|
<class name="auth-monitor.js" filename="src/auth-monitor.js" line-rate="0.12" branch-rate="0">
|
|
11
11
|
<methods>
|
|
@@ -865,106 +865,106 @@
|
|
|
865
865
|
<line number="84" hits="2" branch="false"/>
|
|
866
866
|
</lines>
|
|
867
867
|
</class>
|
|
868
|
-
<class name="serve.js" filename="src/serve.js" line-rate="0.
|
|
868
|
+
<class name="serve.js" filename="src/serve.js" line-rate="0.12689999999999999" branch-rate="0">
|
|
869
869
|
<methods>
|
|
870
870
|
<method name="getGlobals" hits="0" signature="()V">
|
|
871
871
|
<lines>
|
|
872
|
-
<line number="
|
|
872
|
+
<line number="15" hits="0"/>
|
|
873
873
|
</lines>
|
|
874
874
|
</method>
|
|
875
875
|
<method name="(anonymous_1)" hits="0" signature="()V">
|
|
876
876
|
<lines>
|
|
877
|
-
<line number="
|
|
877
|
+
<line number="56" hits="0"/>
|
|
878
878
|
</lines>
|
|
879
879
|
</method>
|
|
880
880
|
<method name="(anonymous_2)" hits="0" signature="()V">
|
|
881
881
|
<lines>
|
|
882
|
-
<line number="
|
|
882
|
+
<line number="61" hits="0"/>
|
|
883
883
|
</lines>
|
|
884
884
|
</method>
|
|
885
885
|
<method name="(anonymous_3)" hits="0" signature="()V">
|
|
886
886
|
<lines>
|
|
887
|
-
<line number="
|
|
887
|
+
<line number="71" hits="0"/>
|
|
888
888
|
</lines>
|
|
889
889
|
</method>
|
|
890
890
|
<method name="(anonymous_4)" hits="0" signature="()V">
|
|
891
891
|
<lines>
|
|
892
|
-
<line number="
|
|
892
|
+
<line number="85" hits="0"/>
|
|
893
893
|
</lines>
|
|
894
894
|
</method>
|
|
895
895
|
<method name="(anonymous_5)" hits="0" signature="()V">
|
|
896
896
|
<lines>
|
|
897
|
-
<line number="
|
|
897
|
+
<line number="90" hits="0"/>
|
|
898
898
|
</lines>
|
|
899
899
|
</method>
|
|
900
900
|
<method name="(anonymous_6)" hits="0" signature="()V">
|
|
901
901
|
<lines>
|
|
902
|
-
<line number="
|
|
902
|
+
<line number="91" hits="0"/>
|
|
903
903
|
</lines>
|
|
904
904
|
</method>
|
|
905
905
|
<method name="(anonymous_7)" hits="0" signature="()V">
|
|
906
906
|
<lines>
|
|
907
|
-
<line number="
|
|
907
|
+
<line number="98" hits="0"/>
|
|
908
908
|
</lines>
|
|
909
909
|
</method>
|
|
910
910
|
<method name="(anonymous_8)" hits="0" signature="()V">
|
|
911
911
|
<lines>
|
|
912
|
-
<line number="
|
|
912
|
+
<line number="101" hits="0"/>
|
|
913
913
|
</lines>
|
|
914
914
|
</method>
|
|
915
915
|
<method name="(anonymous_9)" hits="0" signature="()V">
|
|
916
916
|
<lines>
|
|
917
|
-
<line number="
|
|
917
|
+
<line number="134" hits="0"/>
|
|
918
918
|
</lines>
|
|
919
919
|
</method>
|
|
920
920
|
<method name="(anonymous_10)" hits="0" signature="()V">
|
|
921
921
|
<lines>
|
|
922
|
-
<line number="
|
|
922
|
+
<line number="140" hits="0"/>
|
|
923
923
|
</lines>
|
|
924
924
|
</method>
|
|
925
925
|
<method name="(anonymous_11)" hits="0" signature="()V">
|
|
926
926
|
<lines>
|
|
927
|
-
<line number="
|
|
927
|
+
<line number="148" hits="0"/>
|
|
928
928
|
</lines>
|
|
929
929
|
</method>
|
|
930
930
|
<method name="(anonymous_12)" hits="0" signature="()V">
|
|
931
931
|
<lines>
|
|
932
|
-
<line number="
|
|
932
|
+
<line number="159" hits="0"/>
|
|
933
933
|
</lines>
|
|
934
934
|
</method>
|
|
935
935
|
<method name="(anonymous_13)" hits="0" signature="()V">
|
|
936
936
|
<lines>
|
|
937
|
-
<line number="
|
|
937
|
+
<line number="187" hits="0"/>
|
|
938
938
|
</lines>
|
|
939
939
|
</method>
|
|
940
940
|
<method name="(anonymous_14)" hits="0" signature="()V">
|
|
941
941
|
<lines>
|
|
942
|
-
<line number="
|
|
942
|
+
<line number="190" hits="0"/>
|
|
943
943
|
</lines>
|
|
944
944
|
</method>
|
|
945
945
|
<method name="(anonymous_15)" hits="0" signature="()V">
|
|
946
946
|
<lines>
|
|
947
|
-
<line number="
|
|
947
|
+
<line number="191" hits="0"/>
|
|
948
948
|
</lines>
|
|
949
949
|
</method>
|
|
950
950
|
<method name="serve" hits="0" signature="()V">
|
|
951
951
|
<lines>
|
|
952
|
-
<line number="
|
|
952
|
+
<line number="206" hits="0"/>
|
|
953
953
|
</lines>
|
|
954
954
|
</method>
|
|
955
955
|
<method name="(anonymous_17)" hits="0" signature="()V">
|
|
956
956
|
<lines>
|
|
957
|
-
<line number="
|
|
957
|
+
<line number="294" hits="0"/>
|
|
958
958
|
</lines>
|
|
959
959
|
</method>
|
|
960
960
|
<method name="(anonymous_18)" hits="0" signature="()V">
|
|
961
961
|
<lines>
|
|
962
|
-
<line number="
|
|
962
|
+
<line number="309" hits="0"/>
|
|
963
963
|
</lines>
|
|
964
964
|
</method>
|
|
965
965
|
<method name="(anonymous_19)" hits="0" signature="()V">
|
|
966
966
|
<lines>
|
|
967
|
-
<line number="
|
|
967
|
+
<line number="317" hits="0"/>
|
|
968
968
|
</lines>
|
|
969
969
|
</method>
|
|
970
970
|
</methods>
|
|
@@ -980,110 +980,138 @@
|
|
|
980
980
|
<line number="10" hits="1" branch="false"/>
|
|
981
981
|
<line number="11" hits="1" branch="false"/>
|
|
982
982
|
<line number="12" hits="1" branch="false"/>
|
|
983
|
-
<line number="
|
|
984
|
-
<line number="
|
|
985
|
-
<line number="21" hits="0" branch="
|
|
986
|
-
<line number="
|
|
987
|
-
<line number="
|
|
988
|
-
<line number="
|
|
989
|
-
<line number="41" hits="0" branch="
|
|
990
|
-
<line number="
|
|
991
|
-
<line number="
|
|
992
|
-
<line number="56" hits="
|
|
993
|
-
<line number="57" hits="0" branch="
|
|
994
|
-
<line number="
|
|
995
|
-
<line number="
|
|
996
|
-
<line number="63" hits="0" branch="
|
|
997
|
-
<line number="64" hits="0" branch="
|
|
998
|
-
<line number="
|
|
999
|
-
<line number="
|
|
1000
|
-
<line number="
|
|
1001
|
-
<line number="73" hits="0" branch="
|
|
1002
|
-
<line number="74" hits="0" branch="
|
|
1003
|
-
<line number="
|
|
1004
|
-
<line number="
|
|
1005
|
-
<line number="
|
|
1006
|
-
<line number="
|
|
1007
|
-
<line number="85" hits="
|
|
1008
|
-
<line number="
|
|
1009
|
-
<line number="
|
|
1010
|
-
<line number="
|
|
1011
|
-
<line number="
|
|
1012
|
-
<line number="
|
|
1013
|
-
<line number="
|
|
1014
|
-
<line number="
|
|
1015
|
-
<line number="104" hits="0" branch="
|
|
1016
|
-
<line number="
|
|
1017
|
-
<line number="
|
|
983
|
+
<line number="13" hits="1" branch="false"/>
|
|
984
|
+
<line number="16" hits="0" branch="false"/>
|
|
985
|
+
<line number="21" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
986
|
+
<line number="22" hits="0" branch="false"/>
|
|
987
|
+
<line number="24" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
988
|
+
<line number="26" hits="0" branch="false"/>
|
|
989
|
+
<line number="41" hits="0" branch="false"/>
|
|
990
|
+
<line number="42" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
991
|
+
<line number="44" hits="0" branch="false"/>
|
|
992
|
+
<line number="56" hits="1" branch="false"/>
|
|
993
|
+
<line number="57" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
994
|
+
<line number="58" hits="0" branch="false"/>
|
|
995
|
+
<line number="61" hits="0" branch="false"/>
|
|
996
|
+
<line number="63" hits="0" branch="false"/>
|
|
997
|
+
<line number="64" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
998
|
+
<line number="65" hits="0" branch="false"/>
|
|
999
|
+
<line number="67" hits="0" branch="false"/>
|
|
1000
|
+
<line number="71" hits="0" branch="false"/>
|
|
1001
|
+
<line number="73" hits="0" branch="false"/>
|
|
1002
|
+
<line number="74" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1003
|
+
<line number="75" hits="0" branch="false"/>
|
|
1004
|
+
<line number="77" hits="0" branch="false"/>
|
|
1005
|
+
<line number="80" hits="0" branch="false"/>
|
|
1006
|
+
<line number="82" hits="0" branch="false"/>
|
|
1007
|
+
<line number="85" hits="1" branch="false"/>
|
|
1008
|
+
<line number="86" hits="0" branch="false"/>
|
|
1009
|
+
<line number="88" hits="0" branch="false"/>
|
|
1010
|
+
<line number="91" hits="0" branch="false"/>
|
|
1011
|
+
<line number="93" hits="0" branch="false"/>
|
|
1012
|
+
<line number="97" hits="0" branch="false"/>
|
|
1013
|
+
<line number="99" hits="0" branch="false"/>
|
|
1014
|
+
<line number="101" hits="0" branch="false"/>
|
|
1015
|
+
<line number="104" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1016
|
+
<line number="105" hits="0" branch="false"/>
|
|
1017
|
+
<line number="107" hits="0" branch="false"/>
|
|
1018
1018
|
<line number="111" hits="0" branch="false"/>
|
|
1019
1019
|
<line number="112" hits="0" branch="false"/>
|
|
1020
|
-
<line number="
|
|
1021
|
-
<line number="
|
|
1020
|
+
<line number="113" hits="0" branch="false"/>
|
|
1021
|
+
<line number="119" hits="0" branch="false"/>
|
|
1022
1022
|
<line number="133" hits="0" branch="false"/>
|
|
1023
1023
|
<line number="134" hits="0" branch="false"/>
|
|
1024
|
-
<line number="
|
|
1024
|
+
<line number="135" hits="0" branch="false"/>
|
|
1025
1025
|
<line number="140" hits="0" branch="false"/>
|
|
1026
|
-
<line number="
|
|
1026
|
+
<line number="141" hits="0" branch="false"/>
|
|
1027
1027
|
<line number="148" hits="0" branch="false"/>
|
|
1028
|
-
<line number="
|
|
1029
|
-
<line number="
|
|
1030
|
-
<line number="159" hits="
|
|
1031
|
-
<line number="
|
|
1028
|
+
<line number="149" hits="0" branch="false"/>
|
|
1029
|
+
<line number="156" hits="0" branch="false"/>
|
|
1030
|
+
<line number="159" hits="1" branch="false"/>
|
|
1031
|
+
<line number="160" hits="0" branch="false"/>
|
|
1032
1032
|
<line number="162" hits="0" branch="false"/>
|
|
1033
|
-
<line number="
|
|
1034
|
-
<line number="
|
|
1033
|
+
<line number="163" hits="0" branch="false"/>
|
|
1034
|
+
<line number="167" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1035
1035
|
<line number="171" hits="0" branch="false"/>
|
|
1036
|
-
<line number="
|
|
1037
|
-
<line number="
|
|
1038
|
-
<line number="
|
|
1036
|
+
<line number="172" hits="0" branch="false"/>
|
|
1037
|
+
<line number="174" hits="0" branch="false"/>
|
|
1038
|
+
<line number="176" hits="0" branch="false"/>
|
|
1039
1039
|
<line number="188" hits="0" branch="false"/>
|
|
1040
|
-
<line number="
|
|
1041
|
-
<line number="
|
|
1042
|
-
<line number="193" hits="0" branch="
|
|
1040
|
+
<line number="189" hits="0" branch="false"/>
|
|
1041
|
+
<line number="191" hits="0" branch="false"/>
|
|
1042
|
+
<line number="193" hits="0" branch="true" condition-coverage="0% (0/5)"/>
|
|
1043
1043
|
<line number="194" hits="0" branch="false"/>
|
|
1044
|
-
<line number="
|
|
1045
|
-
<line number="
|
|
1044
|
+
<line number="195" hits="0" branch="false"/>
|
|
1045
|
+
<line number="203" hits="0" branch="false"/>
|
|
1046
1046
|
<line number="207" hits="0" branch="false"/>
|
|
1047
|
-
<line number="
|
|
1047
|
+
<line number="208" hits="0" branch="false"/>
|
|
1048
1048
|
<line number="210" hits="0" branch="false"/>
|
|
1049
1049
|
<line number="211" hits="0" branch="false"/>
|
|
1050
|
-
<line number="
|
|
1051
|
-
<line number="214" hits="0" branch="
|
|
1052
|
-
<line number="
|
|
1053
|
-
<line number="
|
|
1050
|
+
<line number="212" hits="0" branch="false"/>
|
|
1051
|
+
<line number="214" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1052
|
+
<line number="215" hits="0" branch="false"/>
|
|
1053
|
+
<line number="218" hits="0" branch="false"/>
|
|
1054
1054
|
<line number="220" hits="0" branch="false"/>
|
|
1055
1055
|
<line number="221" hits="0" branch="false"/>
|
|
1056
|
-
<line number="
|
|
1056
|
+
<line number="222" hits="0" branch="false"/>
|
|
1057
1057
|
<line number="224" hits="0" branch="false"/>
|
|
1058
1058
|
<line number="227" hits="0" branch="false"/>
|
|
1059
|
-
<line number="
|
|
1060
|
-
<line number="
|
|
1061
|
-
<line number="
|
|
1062
|
-
<line number="
|
|
1063
|
-
<line number="
|
|
1064
|
-
<line number="
|
|
1065
|
-
<line number="
|
|
1066
|
-
<line number="
|
|
1059
|
+
<line number="228" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1060
|
+
<line number="229" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
1061
|
+
<line number="230" hits="0" branch="false"/>
|
|
1062
|
+
<line number="232" hits="0" branch="false"/>
|
|
1063
|
+
<line number="233" hits="0" branch="false"/>
|
|
1064
|
+
<line number="234" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1065
|
+
<line number="235" hits="0" branch="false"/>
|
|
1066
|
+
<line number="236" hits="0" branch="false"/>
|
|
1067
|
+
<line number="239" hits="0" branch="false"/>
|
|
1068
|
+
<line number="243" hits="0" branch="false"/>
|
|
1069
|
+
<line number="246" hits="0" branch="false"/>
|
|
1070
|
+
<line number="277" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1071
|
+
<line number="278" hits="0" branch="false"/>
|
|
1067
1072
|
<line number="281" hits="0" branch="false"/>
|
|
1068
|
-
<line number="
|
|
1069
|
-
<line number="
|
|
1073
|
+
<line number="283" hits="0" branch="false"/>
|
|
1074
|
+
<line number="286" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1070
1075
|
<line number="287" hits="0" branch="false"/>
|
|
1071
|
-
<line number="
|
|
1072
|
-
<line number="291" hits="0" branch="false"/>
|
|
1073
|
-
<line number="292" hits="0" branch="false"/>
|
|
1076
|
+
<line number="294" hits="0" branch="false"/>
|
|
1074
1077
|
<line number="295" hits="0" branch="false"/>
|
|
1075
|
-
<line number="298" hits="0" branch="false"/>
|
|
1076
|
-
<line number="299" hits="0" branch="false"/>
|
|
1077
1078
|
<line number="300" hits="0" branch="false"/>
|
|
1079
|
+
<line number="303" hits="0" branch="false"/>
|
|
1078
1080
|
<line number="304" hits="0" branch="false"/>
|
|
1081
|
+
<line number="306" hits="0" branch="false"/>
|
|
1079
1082
|
<line number="309" hits="0" branch="false"/>
|
|
1080
|
-
<line number="310" hits="0" branch="
|
|
1083
|
+
<line number="310" hits="0" branch="false"/>
|
|
1081
1084
|
<line number="311" hits="0" branch="false"/>
|
|
1082
|
-
<line number="312" hits="0" branch="false"/>
|
|
1083
|
-
<line number="313" hits="0" branch="false"/>
|
|
1084
1085
|
<line number="314" hits="0" branch="false"/>
|
|
1085
|
-
<line number="
|
|
1086
|
-
<line number="318" hits="
|
|
1086
|
+
<line number="317" hits="0" branch="false"/>
|
|
1087
|
+
<line number="318" hits="0" branch="false"/>
|
|
1088
|
+
<line number="319" hits="0" branch="false"/>
|
|
1089
|
+
<line number="323" hits="0" branch="false"/>
|
|
1090
|
+
<line number="328" hits="0" branch="false"/>
|
|
1091
|
+
<line number="329" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1092
|
+
<line number="330" hits="0" branch="false"/>
|
|
1093
|
+
<line number="331" hits="0" branch="false"/>
|
|
1094
|
+
<line number="332" hits="0" branch="false"/>
|
|
1095
|
+
<line number="333" hits="0" branch="false"/>
|
|
1096
|
+
<line number="335" hits="0" branch="false"/>
|
|
1097
|
+
<line number="337" hits="1" branch="false"/>
|
|
1098
|
+
</lines>
|
|
1099
|
+
</class>
|
|
1100
|
+
<class name="sspc.js" filename="src/sspc.js" line-rate="0.1666" branch-rate="0">
|
|
1101
|
+
<methods>
|
|
1102
|
+
<method name="getLiveCancelFlow" hits="0" signature="()V">
|
|
1103
|
+
<lines>
|
|
1104
|
+
<line number="11" hits="0"/>
|
|
1105
|
+
</lines>
|
|
1106
|
+
</method>
|
|
1107
|
+
</methods>
|
|
1108
|
+
<lines>
|
|
1109
|
+
<line number="12" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1110
|
+
<line number="13" hits="0" branch="false"/>
|
|
1111
|
+
<line number="16" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1112
|
+
<line number="17" hits="0" branch="false"/>
|
|
1113
|
+
<line number="18" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1114
|
+
<line number="21" hits="1" branch="false"/>
|
|
1087
1115
|
</lines>
|
|
1088
1116
|
</class>
|
|
1089
1117
|
<class name="utils.js" filename="src/utils.js" line-rate="0.4893" branch-rate="0.44439999999999996">
|
|
@@ -1289,12 +1317,13 @@
|
|
|
1289
1317
|
<methods>
|
|
1290
1318
|
</methods>
|
|
1291
1319
|
<lines>
|
|
1292
|
-
<line number="
|
|
1293
|
-
<line number="
|
|
1294
|
-
<line number="
|
|
1295
|
-
<line number="
|
|
1296
|
-
<line number="
|
|
1297
|
-
<line number="
|
|
1320
|
+
<line number="11" hits="0" branch="false"/>
|
|
1321
|
+
<line number="13" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1322
|
+
<line number="15" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1323
|
+
<line number="17" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1324
|
+
<line number="26" hits="0" branch="false"/>
|
|
1325
|
+
<line number="28" hits="0" branch="false"/>
|
|
1326
|
+
<line number="30" hits="0" branch="false"/>
|
|
1298
1327
|
</lines>
|
|
1299
1328
|
</class>
|
|
1300
1329
|
<class name="entrypoint.js" filename="src/partials/entrypoint.js" line-rate="0" branch-rate="0">
|
|
@@ -1321,27 +1350,27 @@
|
|
|
1321
1350
|
</method>
|
|
1322
1351
|
<method name="(anonymous_4)" hits="0" signature="()V">
|
|
1323
1352
|
<lines>
|
|
1324
|
-
<line number="
|
|
1353
|
+
<line number="71" hits="0"/>
|
|
1325
1354
|
</lines>
|
|
1326
1355
|
</method>
|
|
1327
1356
|
<method name="(anonymous_5)" hits="0" signature="()V">
|
|
1328
1357
|
<lines>
|
|
1329
|
-
<line number="
|
|
1358
|
+
<line number="80" hits="0"/>
|
|
1330
1359
|
</lines>
|
|
1331
1360
|
</method>
|
|
1332
1361
|
<method name="waitForScriptToLoad" hits="0" signature="()V">
|
|
1333
1362
|
<lines>
|
|
1334
|
-
<line number="
|
|
1363
|
+
<line number="86" hits="0"/>
|
|
1335
1364
|
</lines>
|
|
1336
1365
|
</method>
|
|
1337
1366
|
<method name="(anonymous_7)" hits="0" signature="()V">
|
|
1338
1367
|
<lines>
|
|
1339
|
-
<line number="
|
|
1368
|
+
<line number="87" hits="0"/>
|
|
1340
1369
|
</lines>
|
|
1341
1370
|
</method>
|
|
1342
1371
|
<method name="(anonymous_8)" hits="0" signature="()V">
|
|
1343
1372
|
<lines>
|
|
1344
|
-
<line number="
|
|
1373
|
+
<line number="90" hits="0"/>
|
|
1345
1374
|
</lines>
|
|
1346
1375
|
</method>
|
|
1347
1376
|
</methods>
|
|
@@ -1365,19 +1394,20 @@
|
|
|
1365
1394
|
<line number="62" hits="0" branch="false"/>
|
|
1366
1395
|
<line number="63" hits="0" branch="false"/>
|
|
1367
1396
|
<line number="64" hits="0" branch="false"/>
|
|
1368
|
-
<line number="69" hits="0" branch="
|
|
1369
|
-
<line number="
|
|
1370
|
-
<line number="72" hits="0" branch="
|
|
1371
|
-
<line number="
|
|
1372
|
-
<line number="
|
|
1373
|
-
<line number="79" hits="0" branch="false"/>
|
|
1397
|
+
<line number="69" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1398
|
+
<line number="71" hits="0" branch="false"/>
|
|
1399
|
+
<line number="72" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1400
|
+
<line number="74" hits="0" branch="false"/>
|
|
1401
|
+
<line number="77" hits="0" branch="false"/>
|
|
1374
1402
|
<line number="80" hits="0" branch="false"/>
|
|
1375
|
-
<line number="
|
|
1376
|
-
<line number="
|
|
1403
|
+
<line number="81" hits="0" branch="false"/>
|
|
1404
|
+
<line number="82" hits="0" branch="false"/>
|
|
1377
1405
|
<line number="87" hits="0" branch="false"/>
|
|
1378
1406
|
<line number="88" hits="0" branch="false"/>
|
|
1379
1407
|
<line number="89" hits="0" branch="false"/>
|
|
1408
|
+
<line number="90" hits="0" branch="false"/>
|
|
1380
1409
|
<line number="91" hits="0" branch="false"/>
|
|
1410
|
+
<line number="93" hits="0" branch="false"/>
|
|
1381
1411
|
</lines>
|
|
1382
1412
|
</class>
|
|
1383
1413
|
</classes>
|
package/coverage/coverage.txt
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---------------------|---------|----------|---------|---------|-------------------------------------------------------------------------
|
|
2
2
|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
3
3
|
---------------------|---------|----------|---------|---------|-------------------------------------------------------------------------
|
|
4
|
-
All files |
|
|
5
|
-
src |
|
|
4
|
+
All files | 33.81 | 18 | 25.78 | 34.07 |
|
|
5
|
+
src | 35.92 | 20.45 | 27.73 | 36.22 |
|
|
6
6
|
auth-monitor.js | 12 | 0 | 0 | 12 | 12-127
|
|
7
7
|
auth.js | 93.33 | 83.33 | 100 | 93.33 | 14
|
|
8
8
|
hmac-refresh.js | 28.57 | 0 | 0 | 28.57 | 14-29
|
|
@@ -12,9 +12,10 @@ All files | 34.46 | 19.23 | 25.98 | 34.75 |
|
|
|
12
12
|
pull-theme.js | 77.77 | 56.25 | 93.75 | 76.84 | 25-28,37-38,69-70,77,94,102-103,117,130,145,156-157,163-166,178,234-239
|
|
13
13
|
push-theme.js | 0 | 0 | 0 | 0 | 1-130
|
|
14
14
|
select-merchant.js | 50 | 35.29 | 22.22 | 55.88 | 19,31,38,43-81
|
|
15
|
-
serve.js |
|
|
15
|
+
serve.js | 12.69 | 0 | 0 | 12.69 | 16-44,57-82,86-156,160-335
|
|
16
|
+
sspc.js | 14.28 | 0 | 0 | 16.66 | 12-18
|
|
16
17
|
utils.js | 47.91 | 44.44 | 36.84 | 48.93 | 13,23-31,40,53-70,81-94,104,141-145,154-158,169-174,194-196
|
|
17
18
|
src/partials | 0 | 0 | 0 | 0 |
|
|
18
|
-
devmode.js | 0 | 0 | 100 | 0 |
|
|
19
|
-
entrypoint.js | 0 | 0 | 0 | 0 | 6-
|
|
19
|
+
devmode.js | 0 | 0 | 100 | 0 | 11-30
|
|
20
|
+
entrypoint.js | 0 | 0 | 0 | 0 | 6-93
|
|
20
21
|
---------------------|---------|----------|---------|---------|-------------------------------------------------------------------------
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordergroove/smi-serve",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "Utility to serve a Subscription Manager template locally",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Eugenio Lattanzio <eugenio.lattanzio@ordergroove.com>",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"memfs": "^4.8.2"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "c452ee5c393215ad94d031c5d027fa79dcf26fea"
|
|
38
38
|
}
|
package/smi-serve.js
CHANGED
|
@@ -198,6 +198,11 @@ async function program() {
|
|
|
198
198
|
description: 'Replace cancel subscription buttons with new cancel flow handler'
|
|
199
199
|
})
|
|
200
200
|
.hide('auto-cancel-flow')
|
|
201
|
+
.option('live-cancel-flow', {
|
|
202
|
+
type: 'boolean',
|
|
203
|
+
description: "Use the merchant's published cancel flow config instead of default-config.json"
|
|
204
|
+
})
|
|
205
|
+
.hide('live-cancel-flow')
|
|
201
206
|
.parse()
|
|
202
207
|
);
|
|
203
208
|
}
|
package/src/partials/devmode.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
// virtual JSON file containing build-time variables
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
OG_ENV,
|
|
4
|
+
OG_MERCHANT_ID,
|
|
5
|
+
OG_HMAC_AUTH,
|
|
6
|
+
OG_SMI_CORE_VERSION,
|
|
7
|
+
OG_LOCAL_ASSETS,
|
|
8
|
+
OG_CANCEL_FLOW_CONFIG
|
|
9
|
+
} from 'virtual:globals.json';
|
|
3
10
|
|
|
4
11
|
const params = new URLSearchParams(window.location.search);
|
|
5
12
|
|
|
@@ -19,3 +26,5 @@ export const auth_config = params.has('auth')
|
|
|
19
26
|
export const smi_core_version = OG_SMI_CORE_VERSION;
|
|
20
27
|
|
|
21
28
|
export const use_local_assets = OG_LOCAL_ASSETS;
|
|
29
|
+
|
|
30
|
+
export const cancel_flow_config = OG_CANCEL_FLOW_CONFIG;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ~/ refers to the working directory of the project using smi-serve
|
|
2
2
|
import mainTemplate from '~/views/main.liquid';
|
|
3
3
|
|
|
4
|
-
import { merchant_id, auth_config, smi_core_version, use_local_assets } from './devmode';
|
|
4
|
+
import { merchant_id, auth_config, smi_core_version, use_local_assets, cancel_flow_config } from './devmode';
|
|
5
5
|
|
|
6
6
|
const smiCoreUrl = use_local_assets
|
|
7
7
|
? `http://${window.location.hostname}:${window.location.port}/smi-core`
|
|
@@ -66,7 +66,9 @@ if (!window.og?.smi) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
let cancelFlowPromise;
|
|
69
|
-
let
|
|
69
|
+
let cancelFlowConfigPromise = cancel_flow_config
|
|
70
|
+
? Promise.resolve(cancel_flow_config)
|
|
71
|
+
: fetch(`${cancelFlowsUrl}/default-config.json`).then(response => response.json());
|
|
70
72
|
if (use_local_assets) {
|
|
71
73
|
// smi-serve builds cancel-flow as an ES Module
|
|
72
74
|
cancelFlowPromise = import(`${cancelFlowsUrl}/cancel-flow.js`);
|
|
@@ -76,8 +78,8 @@ if (!window.og?.smi) {
|
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
cancelFlowPromise.then(async () => {
|
|
79
|
-
const
|
|
80
|
-
window.og.cancelFlow.initializeCancelFlow(
|
|
81
|
+
const config = await cancelFlowConfigPromise;
|
|
82
|
+
window.og.cancelFlow.initializeCancelFlow(config);
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
85
|
|
package/src/serve.js
CHANGED
|
@@ -10,6 +10,7 @@ const { getValidLoginAndCurrentMerchant } = require('./auth');
|
|
|
10
10
|
const { open, getcwd, glob, readPackageJson, packageJsonKeys } = require('./utils');
|
|
11
11
|
const { impersonate } = require('./impersonate');
|
|
12
12
|
const { AuthMonitor } = require('./auth-monitor');
|
|
13
|
+
const { getLiveCancelFlow } = require('./sspc');
|
|
13
14
|
|
|
14
15
|
async function getGlobals(argv) {
|
|
15
16
|
let hmacAuth = "''",
|
|
@@ -221,6 +222,24 @@ async function serve(argv) {
|
|
|
221
222
|
fs.writeFileSync(smiIndexFile, smiIndexSource, { encoding: 'utf8' });
|
|
222
223
|
|
|
223
224
|
const { globals, impersonation } = await getGlobals(argv);
|
|
225
|
+
|
|
226
|
+
// When --live-cancel-flow is set, fetch the merchant's published cancel flow config instead of using default-config.json
|
|
227
|
+
globals.OG_CANCEL_FLOW_CONFIG = null;
|
|
228
|
+
if (argv.liveCancelFlow) {
|
|
229
|
+
if (!impersonation?.token || !impersonation?.merchant) {
|
|
230
|
+
throw new Error('--live-cancel-flow requires --impersonate to be set');
|
|
231
|
+
}
|
|
232
|
+
try {
|
|
233
|
+
const config = await getLiveCancelFlow(argv.env, impersonation.merchant.public_id, impersonation.token);
|
|
234
|
+
if (config) {
|
|
235
|
+
globals.OG_CANCEL_FLOW_CONFIG = config;
|
|
236
|
+
console.log("Using merchant's live cancel flow config");
|
|
237
|
+
}
|
|
238
|
+
} catch (err) {
|
|
239
|
+
console.warn('Could not fetch merchant cancel flow config:', err.message);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
224
243
|
const plugins = await getPlugins(argv, globals);
|
|
225
244
|
|
|
226
245
|
/** @type {import('esbuild').BuildOptions} */
|
package/src/sspc.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Fetches the merchant's live cancel flow config from SSPC.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} env - 'staging' or 'prod'
|
|
7
|
+
* @param {string} merchantPublicId - The merchant's public ID
|
|
8
|
+
* @param {string} token - Auth token for SSPC
|
|
9
|
+
* @returns {Promise<object|null>} The cancel flow config object, or null if not found
|
|
10
|
+
*/
|
|
11
|
+
async function getLiveCancelFlow(env, merchantPublicId, token) {
|
|
12
|
+
const apiBase = env === 'staging' ? 'https://staging.sspc.ordergroove.com' : 'https://sspc.ordergroove.com';
|
|
13
|
+
const resp = await fetch(`${apiBase}/configs/cancel-flow/?merchant_public_id=${merchantPublicId}`, {
|
|
14
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
15
|
+
});
|
|
16
|
+
if (!resp.ok) throw new Error(`SSPC responded with ${resp.status}`);
|
|
17
|
+
const data = await resp.json();
|
|
18
|
+
return data.configs ?? null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = { getLiveCancelFlow };
|