@teambit/express 0.0.1141 → 0.0.1142

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="0" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.harmony/express@0.0.1141" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.harmony/express@0.0.1142" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.harmony/express-preview"]=t():e["teambit.harmony/express-preview"]=t()}(self,(()=>(()=>{"use strict";var e={5242:(e,t,o)=>{var r={id:"teambit.harmony/express@0.0.1141",homepage:"https://bit.cloud/teambit/harmony/express",exported:!0};function n(){const e=i(o(41594));return n=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,n.__bit_component=r,i.__bit_component=r;const s=()=>n().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},n().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/express.svg"}));s.__bit_component=r,t.Logo=s},41594:e=>{e.exports=React}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};o.r(r),o.d(r,{compositions:()=>f,compositions_metadata:()=>y,overview:()=>m});var n={};o.r(n),o.d(n,{default:()=>d});var i=o(5242);o(41594);const s=MdxJsReact,a=TeambitMdxUiMdxScopeContext;var p=["components"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},c.apply(null,arguments)}var u={},l="wrapper";function d(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;o[r]=e[r]}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.includes(o)||{}.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}(e,p);return(0,s.mdx)(l,c({},u,o,{components:t,mdxType:"MDXLayout"}),(0,s.mdx)(a.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}d.isMDXComponent=!0;const f=[i],m=[n],y={compositions:[{displayName:"Logo",identifier:"Logo"}]};return r})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.harmony/express-preview"]=t():e["teambit.harmony/express-preview"]=t()}(self,(()=>(()=>{"use strict";var e={12633:(e,t,o)=>{var r={id:"teambit.harmony/express@0.0.1142",homepage:"https://bit.cloud/teambit/harmony/express",exported:!0};function n(){const e=i(o(41594));return n=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,n.__bit_component=r,i.__bit_component=r;const s=()=>n().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},n().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/express.svg"}));s.__bit_component=r,t.Logo=s},41594:e=>{e.exports=React}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};o.r(r),o.d(r,{compositions:()=>f,compositions_metadata:()=>y,overview:()=>m});var n={};o.r(n),o.d(n,{default:()=>d});var i=o(12633);o(41594);const s=MdxJsReact,a=TeambitMdxUiMdxScopeContext;var p=["components"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},c.apply(null,arguments)}var u={},l="wrapper";function d(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;o[r]=e[r]}return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.includes(o)||{}.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}(e,p);return(0,s.mdx)(l,c({},u,o,{components:t,mdxType:"MDXLayout"}),(0,s.mdx)(a.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}d.isMDXComponent=!0;const f=[i],m=[n],y={compositions:[{displayName:"Logo",identifier:"Logo"}]};return r})()));
@@ -823,14 +823,76 @@
823
823
  "__schema": "FunctionLikeSchema",
824
824
  "location": {
825
825
  "filePath": "express.main.runtime.ts",
826
- "line": 58,
826
+ "line": 54,
827
+ "character": 3
828
+ },
829
+ "signature": "(method) ExpressMain.static(root: string, opts?: any): any",
830
+ "name": "static",
831
+ "params": [
832
+ {
833
+ "__schema": "ParameterSchema",
834
+ "location": {
835
+ "filePath": "express.main.runtime.ts",
836
+ "line": 54,
837
+ "character": 10
838
+ },
839
+ "name": "root",
840
+ "type": {
841
+ "__schema": "KeywordTypeSchema",
842
+ "location": {
843
+ "filePath": "express.main.runtime.ts",
844
+ "line": 54,
845
+ "character": 16
846
+ },
847
+ "name": "string"
848
+ },
849
+ "isOptional": false,
850
+ "isSpread": false
851
+ },
852
+ {
853
+ "__schema": "ParameterSchema",
854
+ "location": {
855
+ "filePath": "express.main.runtime.ts",
856
+ "line": 54,
857
+ "character": 24
858
+ },
859
+ "name": "opts",
860
+ "type": {
861
+ "__schema": "KeywordTypeSchema",
862
+ "location": {
863
+ "filePath": "express.main.runtime.ts",
864
+ "line": 54,
865
+ "character": 31
866
+ },
867
+ "name": "any"
868
+ },
869
+ "isOptional": true,
870
+ "isSpread": false
871
+ }
872
+ ],
873
+ "returnType": {
874
+ "__schema": "KeywordTypeSchema",
875
+ "location": {
876
+ "filePath": "express.main.runtime.ts",
877
+ "line": 54,
878
+ "character": 37
879
+ },
880
+ "name": "any"
881
+ },
882
+ "modifiers": []
883
+ },
884
+ {
885
+ "__schema": "FunctionLikeSchema",
886
+ "location": {
887
+ "filePath": "express.main.runtime.ts",
888
+ "line": 62,
827
889
  "character": 3
828
890
  },
829
891
  "doc": {
830
892
  "__schema": "DocSchema",
831
893
  "location": {
832
894
  "filePath": "express.main.runtime.ts",
833
- "line": 54,
895
+ "line": 58,
834
896
  "character": 3
835
897
  },
836
898
  "raw": "/**\n * register a new express routes.\n * route will be added as `/api/${route}`\n */",
@@ -844,7 +906,7 @@
844
906
  "__schema": "ParameterSchema",
845
907
  "location": {
846
908
  "filePath": "express.main.runtime.ts",
847
- "line": 58,
909
+ "line": 62,
848
910
  "character": 12
849
911
  },
850
912
  "name": "routes",
@@ -852,14 +914,14 @@
852
914
  "__schema": "TypeArraySchema",
853
915
  "location": {
854
916
  "filePath": "express.main.runtime.ts",
855
- "line": 58,
917
+ "line": 62,
856
918
  "character": 20
857
919
  },
858
920
  "type": {
859
921
  "__schema": "TypeRefSchema",
860
922
  "location": {
861
923
  "filePath": "express.main.runtime.ts",
862
- "line": 58,
924
+ "line": 62,
863
925
  "character": 20
864
926
  },
865
927
  "name": "Route"
@@ -873,7 +935,7 @@
873
935
  "__schema": "TypeRefSchema",
874
936
  "location": {
875
937
  "filePath": "express.main.runtime.ts",
876
- "line": 58,
938
+ "line": 62,
877
939
  "character": 3
878
940
  },
879
941
  "name": "ExpressMain"
@@ -884,14 +946,14 @@
884
946
  "__schema": "FunctionLikeSchema",
885
947
  "location": {
886
948
  "filePath": "express.main.runtime.ts",
887
- "line": 66,
949
+ "line": 70,
888
950
  "character": 3
889
951
  },
890
952
  "doc": {
891
953
  "__schema": "DocSchema",
892
954
  "location": {
893
955
  "filePath": "express.main.runtime.ts",
894
- "line": 63,
956
+ "line": 67,
895
957
  "character": 3
896
958
  },
897
959
  "raw": "/**\n * register a new middleware into express.\n */",
@@ -905,7 +967,7 @@
905
967
  "__schema": "ParameterSchema",
906
968
  "location": {
907
969
  "filePath": "express.main.runtime.ts",
908
- "line": 66,
970
+ "line": 70,
909
971
  "character": 22
910
972
  },
911
973
  "name": "middlewares",
@@ -913,14 +975,14 @@
913
975
  "__schema": "TypeArraySchema",
914
976
  "location": {
915
977
  "filePath": "express.main.runtime.ts",
916
- "line": 66,
978
+ "line": 70,
917
979
  "character": 35
918
980
  },
919
981
  "type": {
920
982
  "__schema": "TypeRefSchema",
921
983
  "location": {
922
984
  "filePath": "express.main.runtime.ts",
923
- "line": 66,
985
+ "line": 70,
924
986
  "character": 35
925
987
  },
926
988
  "name": "MiddlewareManifest"
@@ -934,7 +996,7 @@
934
996
  "__schema": "TypeRefSchema",
935
997
  "location": {
936
998
  "filePath": "express.main.runtime.ts",
937
- "line": 66,
999
+ "line": 70,
938
1000
  "character": 3
939
1001
  },
940
1002
  "name": "ExpressMain"
@@ -945,7 +1007,7 @@
945
1007
  "__schema": "FunctionLikeSchema",
946
1008
  "location": {
947
1009
  "filePath": "express.main.runtime.ts",
948
- "line": 85,
1010
+ "line": 89,
949
1011
  "character": 3
950
1012
  },
951
1013
  "signature": "(method) ExpressMain.createApp(expressApp?: Express, options?: {\n disableBodyParser: true;\n}): Express",
@@ -955,7 +1017,7 @@
955
1017
  "__schema": "ParameterSchema",
956
1018
  "location": {
957
1019
  "filePath": "express.main.runtime.ts",
958
- "line": 85,
1020
+ "line": 89,
959
1021
  "character": 13
960
1022
  },
961
1023
  "name": "expressApp",
@@ -963,7 +1025,7 @@
963
1025
  "__schema": "TypeRefSchema",
964
1026
  "location": {
965
1027
  "filePath": "express.main.runtime.ts",
966
- "line": 85,
1028
+ "line": 89,
967
1029
  "character": 26
968
1030
  },
969
1031
  "name": "Express",
@@ -976,7 +1038,7 @@
976
1038
  "__schema": "ParameterSchema",
977
1039
  "location": {
978
1040
  "filePath": "express.main.runtime.ts",
979
- "line": 85,
1041
+ "line": 89,
980
1042
  "character": 35
981
1043
  },
982
1044
  "name": "options",
@@ -984,7 +1046,7 @@
984
1046
  "__schema": "TypeLiteralSchema",
985
1047
  "location": {
986
1048
  "filePath": "express.main.runtime.ts",
987
- "line": 85,
1049
+ "line": 89,
988
1050
  "character": 45
989
1051
  },
990
1052
  "members": [
@@ -992,7 +1054,7 @@
992
1054
  "__schema": "VariableLikeSchema",
993
1055
  "location": {
994
1056
  "filePath": "express.main.runtime.ts",
995
- "line": 85,
1057
+ "line": 89,
996
1058
  "character": 47
997
1059
  },
998
1060
  "signature": "(property) disableBodyParser: true",
@@ -1001,7 +1063,7 @@
1001
1063
  "__schema": "LiteralTypeSchema",
1002
1064
  "location": {
1003
1065
  "filePath": "express.main.runtime.ts",
1004
- "line": 85,
1066
+ "line": 89,
1005
1067
  "character": 66
1006
1068
  },
1007
1069
  "name": "true"
@@ -1018,7 +1080,7 @@
1018
1080
  "__schema": "TypeRefSchema",
1019
1081
  "location": {
1020
1082
  "filePath": "express.main.runtime.ts",
1021
- "line": 85,
1083
+ "line": 89,
1022
1084
  "character": 3
1023
1085
  },
1024
1086
  "name": "Express",
@@ -1030,7 +1092,7 @@
1030
1092
  "__schema": "VariableLikeSchema",
1031
1093
  "location": {
1032
1094
  "filePath": "express.main.runtime.ts",
1033
- "line": 155,
1095
+ "line": 159,
1034
1096
  "character": 3
1035
1097
  },
1036
1098
  "signature": "(property) ExpressMain.slots: (((registerFn: () => string) => SlotRegistry<Route[]>) | ((registerFn: () => string) => SlotRegistry<MiddlewareManifest[]>))[]",
@@ -1039,7 +1101,7 @@
1039
1101
  "__schema": "InferenceTypeSchema",
1040
1102
  "location": {
1041
1103
  "filePath": "express.main.runtime.ts",
1042
- "line": 155,
1104
+ "line": 159,
1043
1105
  "character": 3
1044
1106
  },
1045
1107
  "type": "(((registerFn: () => string) => SlotRegistry<Route[]>) | ((registerFn: () => string) => SlotRegistry<MiddlewareManifest[]>))[]"
@@ -1051,7 +1113,7 @@
1051
1113
  "__schema": "VariableLikeSchema",
1052
1114
  "location": {
1053
1115
  "filePath": "express.main.runtime.ts",
1054
- "line": 156,
1116
+ "line": 160,
1055
1117
  "character": 3
1056
1118
  },
1057
1119
  "signature": "(property) ExpressMain.dependencies: Aspect[]",
@@ -1060,7 +1122,7 @@
1060
1122
  "__schema": "InferenceTypeSchema",
1061
1123
  "location": {
1062
1124
  "filePath": "express.main.runtime.ts",
1063
- "line": 156,
1125
+ "line": 160,
1064
1126
  "character": 3
1065
1127
  },
1066
1128
  "type": "Aspect[]"
@@ -1072,7 +1134,7 @@
1072
1134
  "__schema": "VariableLikeSchema",
1073
1135
  "location": {
1074
1136
  "filePath": "express.main.runtime.ts",
1075
- "line": 158,
1137
+ "line": 162,
1076
1138
  "character": 3
1077
1139
  },
1078
1140
  "signature": "(property) ExpressMain.defaultConfig: {\n port: number;\n namespace: string;\n loggerIgnorePath: string[];\n}",
@@ -1081,7 +1143,7 @@
1081
1143
  "__schema": "InferenceTypeSchema",
1082
1144
  "location": {
1083
1145
  "filePath": "express.main.runtime.ts",
1084
- "line": 158,
1146
+ "line": 162,
1085
1147
  "character": 3
1086
1148
  },
1087
1149
  "type": "{\n port: number;\n namespace: string;\n loggerIgnorePath: string[];\n}"
@@ -1093,7 +1155,7 @@
1093
1155
  "__schema": "FunctionLikeSchema",
1094
1156
  "location": {
1095
1157
  "filePath": "express.main.runtime.ts",
1096
- "line": 164,
1158
+ "line": 168,
1097
1159
  "character": 3
1098
1160
  },
1099
1161
  "signature": "(method) ExpressMain.provider([loggerFactory]: [LoggerMain], config: ExpressConfig, [routeSlot, middlewareSlot]: [RouteSlot, MiddlewareSlot]): Promise<ExpressMain>",
@@ -1103,7 +1165,7 @@
1103
1165
  "__schema": "ParameterSchema",
1104
1166
  "location": {
1105
1167
  "filePath": "express.main.runtime.ts",
1106
- "line": 165,
1168
+ "line": 169,
1107
1169
  "character": 5
1108
1170
  },
1109
1171
  "name": "[ loggerFactory ]",
@@ -1111,7 +1173,7 @@
1111
1173
  "__schema": "TupleTypeSchema",
1112
1174
  "location": {
1113
1175
  "filePath": "express.main.runtime.ts",
1114
- "line": 165,
1176
+ "line": 169,
1115
1177
  "character": 22
1116
1178
  },
1117
1179
  "elements": [
@@ -1119,7 +1181,7 @@
1119
1181
  "__schema": "TypeRefSchema",
1120
1182
  "location": {
1121
1183
  "filePath": "express.main.runtime.ts",
1122
- "line": 165,
1184
+ "line": 169,
1123
1185
  "character": 23
1124
1186
  },
1125
1187
  "name": "LoggerMain",
@@ -1137,7 +1199,7 @@
1137
1199
  "__schema": "ParameterSchema",
1138
1200
  "location": {
1139
1201
  "filePath": "express.main.runtime.ts",
1140
- "line": 166,
1202
+ "line": 170,
1141
1203
  "character": 5
1142
1204
  },
1143
1205
  "name": "config",
@@ -1145,7 +1207,7 @@
1145
1207
  "__schema": "TypeRefSchema",
1146
1208
  "location": {
1147
1209
  "filePath": "express.main.runtime.ts",
1148
- "line": 166,
1210
+ "line": 170,
1149
1211
  "character": 13
1150
1212
  },
1151
1213
  "name": "ExpressConfig",
@@ -1158,7 +1220,7 @@
1158
1220
  "__schema": "ParameterSchema",
1159
1221
  "location": {
1160
1222
  "filePath": "express.main.runtime.ts",
1161
- "line": 167,
1223
+ "line": 171,
1162
1224
  "character": 5
1163
1225
  },
1164
1226
  "name": "[ routeSlot, middlewareSlot ]",
@@ -1166,7 +1228,7 @@
1166
1228
  "__schema": "TupleTypeSchema",
1167
1229
  "location": {
1168
1230
  "filePath": "express.main.runtime.ts",
1169
- "line": 167,
1231
+ "line": 171,
1170
1232
  "character": 34
1171
1233
  },
1172
1234
  "elements": [
@@ -1174,7 +1236,7 @@
1174
1236
  "__schema": "TypeRefSchema",
1175
1237
  "location": {
1176
1238
  "filePath": "express.main.runtime.ts",
1177
- "line": 167,
1239
+ "line": 171,
1178
1240
  "character": 35
1179
1241
  },
1180
1242
  "name": "RouteSlot"
@@ -1183,7 +1245,7 @@
1183
1245
  "__schema": "TypeRefSchema",
1184
1246
  "location": {
1185
1247
  "filePath": "express.main.runtime.ts",
1186
- "line": 167,
1248
+ "line": 171,
1187
1249
  "character": 46
1188
1250
  },
1189
1251
  "name": "MiddlewareSlot",
@@ -1199,7 +1261,7 @@
1199
1261
  "__schema": "InferenceTypeSchema",
1200
1262
  "location": {
1201
1263
  "filePath": "express.main.runtime.ts",
1202
- "line": 164,
1264
+ "line": 168,
1203
1265
  "character": 3
1204
1266
  },
1205
1267
  "type": "Promise<ExpressMain>"
@@ -1646,14 +1708,76 @@
1646
1708
  "__schema": "FunctionLikeSchema",
1647
1709
  "location": {
1648
1710
  "filePath": "express.main.runtime.ts",
1649
- "line": 58,
1711
+ "line": 54,
1712
+ "character": 3
1713
+ },
1714
+ "signature": "(method) ExpressMain.static(root: string, opts?: any): any",
1715
+ "name": "static",
1716
+ "params": [
1717
+ {
1718
+ "__schema": "ParameterSchema",
1719
+ "location": {
1720
+ "filePath": "express.main.runtime.ts",
1721
+ "line": 54,
1722
+ "character": 10
1723
+ },
1724
+ "name": "root",
1725
+ "type": {
1726
+ "__schema": "KeywordTypeSchema",
1727
+ "location": {
1728
+ "filePath": "express.main.runtime.ts",
1729
+ "line": 54,
1730
+ "character": 16
1731
+ },
1732
+ "name": "string"
1733
+ },
1734
+ "isOptional": false,
1735
+ "isSpread": false
1736
+ },
1737
+ {
1738
+ "__schema": "ParameterSchema",
1739
+ "location": {
1740
+ "filePath": "express.main.runtime.ts",
1741
+ "line": 54,
1742
+ "character": 24
1743
+ },
1744
+ "name": "opts",
1745
+ "type": {
1746
+ "__schema": "KeywordTypeSchema",
1747
+ "location": {
1748
+ "filePath": "express.main.runtime.ts",
1749
+ "line": 54,
1750
+ "character": 31
1751
+ },
1752
+ "name": "any"
1753
+ },
1754
+ "isOptional": true,
1755
+ "isSpread": false
1756
+ }
1757
+ ],
1758
+ "returnType": {
1759
+ "__schema": "KeywordTypeSchema",
1760
+ "location": {
1761
+ "filePath": "express.main.runtime.ts",
1762
+ "line": 54,
1763
+ "character": 37
1764
+ },
1765
+ "name": "any"
1766
+ },
1767
+ "modifiers": []
1768
+ },
1769
+ {
1770
+ "__schema": "FunctionLikeSchema",
1771
+ "location": {
1772
+ "filePath": "express.main.runtime.ts",
1773
+ "line": 62,
1650
1774
  "character": 3
1651
1775
  },
1652
1776
  "doc": {
1653
1777
  "__schema": "DocSchema",
1654
1778
  "location": {
1655
1779
  "filePath": "express.main.runtime.ts",
1656
- "line": 54,
1780
+ "line": 58,
1657
1781
  "character": 3
1658
1782
  },
1659
1783
  "raw": "/**\n * register a new express routes.\n * route will be added as `/api/${route}`\n */",
@@ -1667,7 +1791,7 @@
1667
1791
  "__schema": "ParameterSchema",
1668
1792
  "location": {
1669
1793
  "filePath": "express.main.runtime.ts",
1670
- "line": 58,
1794
+ "line": 62,
1671
1795
  "character": 12
1672
1796
  },
1673
1797
  "name": "routes",
@@ -1675,14 +1799,14 @@
1675
1799
  "__schema": "TypeArraySchema",
1676
1800
  "location": {
1677
1801
  "filePath": "express.main.runtime.ts",
1678
- "line": 58,
1802
+ "line": 62,
1679
1803
  "character": 20
1680
1804
  },
1681
1805
  "type": {
1682
1806
  "__schema": "TypeRefSchema",
1683
1807
  "location": {
1684
1808
  "filePath": "express.main.runtime.ts",
1685
- "line": 58,
1809
+ "line": 62,
1686
1810
  "character": 20
1687
1811
  },
1688
1812
  "name": "Route"
@@ -1696,7 +1820,7 @@
1696
1820
  "__schema": "TypeRefSchema",
1697
1821
  "location": {
1698
1822
  "filePath": "express.main.runtime.ts",
1699
- "line": 58,
1823
+ "line": 62,
1700
1824
  "character": 3
1701
1825
  },
1702
1826
  "name": "ExpressMain"
@@ -1707,14 +1831,14 @@
1707
1831
  "__schema": "FunctionLikeSchema",
1708
1832
  "location": {
1709
1833
  "filePath": "express.main.runtime.ts",
1710
- "line": 66,
1834
+ "line": 70,
1711
1835
  "character": 3
1712
1836
  },
1713
1837
  "doc": {
1714
1838
  "__schema": "DocSchema",
1715
1839
  "location": {
1716
1840
  "filePath": "express.main.runtime.ts",
1717
- "line": 63,
1841
+ "line": 67,
1718
1842
  "character": 3
1719
1843
  },
1720
1844
  "raw": "/**\n * register a new middleware into express.\n */",
@@ -1728,7 +1852,7 @@
1728
1852
  "__schema": "ParameterSchema",
1729
1853
  "location": {
1730
1854
  "filePath": "express.main.runtime.ts",
1731
- "line": 66,
1855
+ "line": 70,
1732
1856
  "character": 22
1733
1857
  },
1734
1858
  "name": "middlewares",
@@ -1736,14 +1860,14 @@
1736
1860
  "__schema": "TypeArraySchema",
1737
1861
  "location": {
1738
1862
  "filePath": "express.main.runtime.ts",
1739
- "line": 66,
1863
+ "line": 70,
1740
1864
  "character": 35
1741
1865
  },
1742
1866
  "type": {
1743
1867
  "__schema": "TypeRefSchema",
1744
1868
  "location": {
1745
1869
  "filePath": "express.main.runtime.ts",
1746
- "line": 66,
1870
+ "line": 70,
1747
1871
  "character": 35
1748
1872
  },
1749
1873
  "name": "MiddlewareManifest"
@@ -1757,7 +1881,7 @@
1757
1881
  "__schema": "TypeRefSchema",
1758
1882
  "location": {
1759
1883
  "filePath": "express.main.runtime.ts",
1760
- "line": 66,
1884
+ "line": 70,
1761
1885
  "character": 3
1762
1886
  },
1763
1887
  "name": "ExpressMain"
@@ -1768,7 +1892,7 @@
1768
1892
  "__schema": "FunctionLikeSchema",
1769
1893
  "location": {
1770
1894
  "filePath": "express.main.runtime.ts",
1771
- "line": 85,
1895
+ "line": 89,
1772
1896
  "character": 3
1773
1897
  },
1774
1898
  "signature": "(method) ExpressMain.createApp(expressApp?: Express, options?: {\n disableBodyParser: true;\n}): Express",
@@ -1778,7 +1902,7 @@
1778
1902
  "__schema": "ParameterSchema",
1779
1903
  "location": {
1780
1904
  "filePath": "express.main.runtime.ts",
1781
- "line": 85,
1905
+ "line": 89,
1782
1906
  "character": 13
1783
1907
  },
1784
1908
  "name": "expressApp",
@@ -1786,7 +1910,7 @@
1786
1910
  "__schema": "TypeRefSchema",
1787
1911
  "location": {
1788
1912
  "filePath": "express.main.runtime.ts",
1789
- "line": 85,
1913
+ "line": 89,
1790
1914
  "character": 26
1791
1915
  },
1792
1916
  "name": "Express",
@@ -1799,7 +1923,7 @@
1799
1923
  "__schema": "ParameterSchema",
1800
1924
  "location": {
1801
1925
  "filePath": "express.main.runtime.ts",
1802
- "line": 85,
1926
+ "line": 89,
1803
1927
  "character": 35
1804
1928
  },
1805
1929
  "name": "options",
@@ -1807,7 +1931,7 @@
1807
1931
  "__schema": "TypeLiteralSchema",
1808
1932
  "location": {
1809
1933
  "filePath": "express.main.runtime.ts",
1810
- "line": 85,
1934
+ "line": 89,
1811
1935
  "character": 45
1812
1936
  },
1813
1937
  "members": [
@@ -1815,7 +1939,7 @@
1815
1939
  "__schema": "VariableLikeSchema",
1816
1940
  "location": {
1817
1941
  "filePath": "express.main.runtime.ts",
1818
- "line": 85,
1942
+ "line": 89,
1819
1943
  "character": 47
1820
1944
  },
1821
1945
  "signature": "(property) disableBodyParser: true",
@@ -1824,7 +1948,7 @@
1824
1948
  "__schema": "LiteralTypeSchema",
1825
1949
  "location": {
1826
1950
  "filePath": "express.main.runtime.ts",
1827
- "line": 85,
1951
+ "line": 89,
1828
1952
  "character": 66
1829
1953
  },
1830
1954
  "name": "true"
@@ -1841,7 +1965,7 @@
1841
1965
  "__schema": "TypeRefSchema",
1842
1966
  "location": {
1843
1967
  "filePath": "express.main.runtime.ts",
1844
- "line": 85,
1968
+ "line": 89,
1845
1969
  "character": 3
1846
1970
  },
1847
1971
  "name": "Express",
@@ -1853,7 +1977,7 @@
1853
1977
  "__schema": "VariableLikeSchema",
1854
1978
  "location": {
1855
1979
  "filePath": "express.main.runtime.ts",
1856
- "line": 155,
1980
+ "line": 159,
1857
1981
  "character": 3
1858
1982
  },
1859
1983
  "signature": "(property) ExpressMain.slots: (((registerFn: () => string) => SlotRegistry<Route[]>) | ((registerFn: () => string) => SlotRegistry<MiddlewareManifest[]>))[]",
@@ -1862,7 +1986,7 @@
1862
1986
  "__schema": "InferenceTypeSchema",
1863
1987
  "location": {
1864
1988
  "filePath": "express.main.runtime.ts",
1865
- "line": 155,
1989
+ "line": 159,
1866
1990
  "character": 3
1867
1991
  },
1868
1992
  "type": "(((registerFn: () => string) => SlotRegistry<Route[]>) | ((registerFn: () => string) => SlotRegistry<MiddlewareManifest[]>))[]"
@@ -1874,7 +1998,7 @@
1874
1998
  "__schema": "VariableLikeSchema",
1875
1999
  "location": {
1876
2000
  "filePath": "express.main.runtime.ts",
1877
- "line": 156,
2001
+ "line": 160,
1878
2002
  "character": 3
1879
2003
  },
1880
2004
  "signature": "(property) ExpressMain.dependencies: Aspect[]",
@@ -1883,7 +2007,7 @@
1883
2007
  "__schema": "InferenceTypeSchema",
1884
2008
  "location": {
1885
2009
  "filePath": "express.main.runtime.ts",
1886
- "line": 156,
2010
+ "line": 160,
1887
2011
  "character": 3
1888
2012
  },
1889
2013
  "type": "Aspect[]"
@@ -1895,7 +2019,7 @@
1895
2019
  "__schema": "VariableLikeSchema",
1896
2020
  "location": {
1897
2021
  "filePath": "express.main.runtime.ts",
1898
- "line": 158,
2022
+ "line": 162,
1899
2023
  "character": 3
1900
2024
  },
1901
2025
  "signature": "(property) ExpressMain.defaultConfig: {\n port: number;\n namespace: string;\n loggerIgnorePath: string[];\n}",
@@ -1904,7 +2028,7 @@
1904
2028
  "__schema": "InferenceTypeSchema",
1905
2029
  "location": {
1906
2030
  "filePath": "express.main.runtime.ts",
1907
- "line": 158,
2031
+ "line": 162,
1908
2032
  "character": 3
1909
2033
  },
1910
2034
  "type": "{\n port: number;\n namespace: string;\n loggerIgnorePath: string[];\n}"
@@ -1916,7 +2040,7 @@
1916
2040
  "__schema": "FunctionLikeSchema",
1917
2041
  "location": {
1918
2042
  "filePath": "express.main.runtime.ts",
1919
- "line": 164,
2043
+ "line": 168,
1920
2044
  "character": 3
1921
2045
  },
1922
2046
  "signature": "(method) ExpressMain.provider([loggerFactory]: [LoggerMain], config: ExpressConfig, [routeSlot, middlewareSlot]: [RouteSlot, MiddlewareSlot]): Promise<ExpressMain>",
@@ -1926,7 +2050,7 @@
1926
2050
  "__schema": "ParameterSchema",
1927
2051
  "location": {
1928
2052
  "filePath": "express.main.runtime.ts",
1929
- "line": 165,
2053
+ "line": 169,
1930
2054
  "character": 5
1931
2055
  },
1932
2056
  "name": "[ loggerFactory ]",
@@ -1934,7 +2058,7 @@
1934
2058
  "__schema": "TupleTypeSchema",
1935
2059
  "location": {
1936
2060
  "filePath": "express.main.runtime.ts",
1937
- "line": 165,
2061
+ "line": 169,
1938
2062
  "character": 22
1939
2063
  },
1940
2064
  "elements": [
@@ -1942,7 +2066,7 @@
1942
2066
  "__schema": "TypeRefSchema",
1943
2067
  "location": {
1944
2068
  "filePath": "express.main.runtime.ts",
1945
- "line": 165,
2069
+ "line": 169,
1946
2070
  "character": 23
1947
2071
  },
1948
2072
  "name": "LoggerMain",
@@ -1960,7 +2084,7 @@
1960
2084
  "__schema": "ParameterSchema",
1961
2085
  "location": {
1962
2086
  "filePath": "express.main.runtime.ts",
1963
- "line": 166,
2087
+ "line": 170,
1964
2088
  "character": 5
1965
2089
  },
1966
2090
  "name": "config",
@@ -1968,7 +2092,7 @@
1968
2092
  "__schema": "TypeRefSchema",
1969
2093
  "location": {
1970
2094
  "filePath": "express.main.runtime.ts",
1971
- "line": 166,
2095
+ "line": 170,
1972
2096
  "character": 13
1973
2097
  },
1974
2098
  "name": "ExpressConfig",
@@ -1981,7 +2105,7 @@
1981
2105
  "__schema": "ParameterSchema",
1982
2106
  "location": {
1983
2107
  "filePath": "express.main.runtime.ts",
1984
- "line": 167,
2108
+ "line": 171,
1985
2109
  "character": 5
1986
2110
  },
1987
2111
  "name": "[ routeSlot, middlewareSlot ]",
@@ -1989,7 +2113,7 @@
1989
2113
  "__schema": "TupleTypeSchema",
1990
2114
  "location": {
1991
2115
  "filePath": "express.main.runtime.ts",
1992
- "line": 167,
2116
+ "line": 171,
1993
2117
  "character": 34
1994
2118
  },
1995
2119
  "elements": [
@@ -1997,7 +2121,7 @@
1997
2121
  "__schema": "TypeRefSchema",
1998
2122
  "location": {
1999
2123
  "filePath": "express.main.runtime.ts",
2000
- "line": 167,
2124
+ "line": 171,
2001
2125
  "character": 35
2002
2126
  },
2003
2127
  "name": "RouteSlot"
@@ -2006,7 +2130,7 @@
2006
2130
  "__schema": "TypeRefSchema",
2007
2131
  "location": {
2008
2132
  "filePath": "express.main.runtime.ts",
2009
- "line": 167,
2133
+ "line": 171,
2010
2134
  "character": 46
2011
2135
  },
2012
2136
  "name": "MiddlewareSlot",
@@ -2022,7 +2146,7 @@
2022
2146
  "__schema": "InferenceTypeSchema",
2023
2147
  "location": {
2024
2148
  "filePath": "express.main.runtime.ts",
2025
- "line": 164,
2149
+ "line": 168,
2026
2150
  "character": 3
2027
2151
  },
2028
2152
  "type": "Promise<ExpressMain>"
@@ -2042,7 +2166,7 @@
2042
2166
  "__schema": "UnImplementedSchema",
2043
2167
  "location": {
2044
2168
  "filePath": "express.main.runtime.ts",
2045
- "line": 174,
2169
+ "line": 178,
2046
2170
  "character": 1
2047
2171
  },
2048
2172
  "name": "ExpressAspect.addRuntime(ExpressMain);",
@@ -2091,7 +2215,7 @@
2091
2215
  "componentId": {
2092
2216
  "scope": "teambit.harmony",
2093
2217
  "name": "express",
2094
- "version": "0.0.1141"
2218
+ "version": "0.0.1142"
2095
2219
  },
2096
2220
  "taggedModuleExports": []
2097
2221
  }
@@ -43,6 +43,7 @@ export declare class ExpressMain {
43
43
  * start an express server.
44
44
  */
45
45
  listen(port?: number): Promise<Server>;
46
+ static(root: string, opts?: any): any;
46
47
  /**
47
48
  * register a new express routes.
48
49
  * route will be added as `/api/${route}`
@@ -99,6 +99,9 @@ class ExpressMain {
99
99
  const app = this.createApp();
100
100
  return app.listen(serverPort);
101
101
  }
102
+ static(root, opts) {
103
+ return _express().default.static(root, opts);
104
+ }
102
105
 
103
106
  /**
104
107
  * register a new express routes.
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_harmony","_logger","_express","_interopRequireDefault","_lodash","_bodyParser","_express2","_middlewares","_types","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ExpressMain","constructor","config","moduleSlot","logger","middlewareSlot","listen","port","serverPort","app","createApp","register","routes","registerMiddleware","middlewares","createRootRoutes","namespace","ExpressAspect","id","method","path","disableNamespace","priority","req","res","send","expressApp","options","internalRoutes","createRoutes","allRoutes","concat","sortedRoutes","sortBy","reverse","express","use","next","loggerIgnorePath","includes","url","debug","headers","disableBodyParser","bodyParser","middlewaresSlot","values","flat","forEach","route","middleware","routeInfo","catchErrorsMiddlewares","routesSlots","toArray","routeEntries","map","flatten","verbValidation","lowerCase","verb","Verb","READ","status","jsonp","message","error","catchErrors","json","limit","raw","type","provider","loggerFactory","routeSlot","createLogger","exports","MainRuntime","Slot","withType","LoggerAspect","addRuntime"],"sources":["express.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { Server } from 'http';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport express, { Express } from 'express';\nimport { concat, flatten, lowerCase, sortBy } from 'lodash';\nimport bodyParser from 'body-parser';\nimport { ExpressAspect } from './express.aspect';\nimport { catchErrors } from './middlewares';\nimport { Middleware, Request, Response, Route, Verb } from './types';\nimport { MiddlewareManifest } from './middleware-manifest';\n\nexport type ExpressConfig = {\n port: number;\n namespace: string;\n loggerIgnorePath: string[];\n};\n\nexport type MiddlewareSlot = SlotRegistry<MiddlewareManifest[]>;\n\nexport type RouteSlot = SlotRegistry<Route[]>;\n\nexport class ExpressMain {\n static runtime = MainRuntime;\n\n constructor(\n /**\n * extension config\n */\n readonly config: ExpressConfig,\n\n /**\n * slot for registering graphql modules\n */\n private moduleSlot: RouteSlot,\n\n /**\n * logger extension.\n */\n readonly logger: Logger,\n\n readonly middlewareSlot: MiddlewareSlot\n ) {}\n\n /**\n * start an express server.\n */\n async listen(port?: number): Promise<Server> {\n const serverPort = port || this.config.port;\n const app = this.createApp();\n return app.listen(serverPort);\n }\n\n /**\n * register a new express routes.\n * route will be added as `/api/${route}`\n */\n register(routes: Route[]) {\n this.moduleSlot.register(routes);\n return this;\n }\n\n /**\n * register a new middleware into express.\n */\n registerMiddleware(middlewares: MiddlewareManifest[]) {\n this.middlewareSlot.register(middlewares);\n return this;\n }\n\n private createRootRoutes() {\n // TODO: @guy refactor health to service aspect.\n return [\n {\n namespace: ExpressAspect.id,\n method: 'get',\n path: '/_health',\n disableNamespace: false,\n priority: 0,\n middlewares: [async (req: Request, res: Response) => res.send('ok')],\n },\n ];\n }\n\n createApp(expressApp?: Express, options?: { disableBodyParser: true }): Express {\n const internalRoutes = this.createRootRoutes();\n const routes = this.createRoutes();\n const allRoutes = concat(routes, internalRoutes);\n const sortedRoutes = sortBy(allRoutes, (r) => r.priority).reverse();\n const app = expressApp || express();\n app.use((req, res, next) => {\n if (this.config.loggerIgnorePath.includes(req.url)) return next();\n this.logger.debug(`express got a request to a URL: ${req.url}', headers:`, req.headers);\n return next();\n });\n if (!options?.disableBodyParser) this.bodyParser(app);\n\n const middlewaresSlot = this.middlewareSlot.values().flat();\n middlewaresSlot.forEach(({ route, middleware }) => {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n if (!route) app.use(middleware);\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n if (route) app.use(route, middleware);\n });\n\n sortedRoutes.forEach((routeInfo) => {\n const { method, path, middlewares, disableNamespace } = routeInfo;\n // TODO: @guy make sure to support single middleware here.\n const namespace = disableNamespace ? '' : `/${this.config.namespace}`;\n app[method](`${namespace}${path}`, this.catchErrorsMiddlewares(middlewares));\n });\n\n return app;\n }\n\n private createRoutes() {\n const routesSlots = this.moduleSlot.toArray();\n const routeEntries = routesSlots.map(([, routes]) => {\n return routes.map((route) => {\n const middlewares = flatten([this.verbValidation(route), route.middlewares]);\n return {\n method: lowerCase(route.method),\n path: route.route,\n disableNamespace: route.disableNamespace,\n middlewares,\n priority: route.priority || 0,\n };\n });\n });\n\n return flatten(routeEntries);\n }\n\n private verbValidation(route: Route): Middleware {\n return async (req: express.Request, res: express.Response, next: express.NextFunction) => {\n if (!route.verb) return next();\n const verb = req.headers['x-verb'] || Verb.READ;\n if (verb !== route.verb) {\n res.status(403);\n return res.jsonp({ message: 'You are not authorized', error: 'forbidden' });\n }\n return next();\n };\n }\n\n private catchErrorsMiddlewares(middlewares: Middleware[]) {\n return middlewares.map((middleware) => catchErrors(middleware));\n }\n\n private bodyParser(app: Express) {\n app.use(bodyParser.json({ limit: '5000mb' }));\n app.use(bodyParser.raw({ type: 'application/octet-stream', limit: '5000mb' }));\n }\n\n static slots = [Slot.withType<Route[]>(), Slot.withType<MiddlewareManifest[]>()];\n static dependencies = [LoggerAspect];\n\n static defaultConfig = {\n port: 4001,\n namespace: 'api',\n loggerIgnorePath: ['/api/_health'],\n };\n\n static async provider(\n [loggerFactory]: [LoggerMain],\n config: ExpressConfig,\n [routeSlot, middlewareSlot]: [RouteSlot, MiddlewareSlot]\n ) {\n const logger = loggerFactory.createLogger(ExpressAspect.id);\n return new ExpressMain(config, routeSlot, logger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N,UAAUA,CAACnC,GAAY,EAAE;IAC/BA,GAAG,CAAC2B,GAAG,CAACQ,qBAAU,CAACwB,IAAI,CAAC;MAAEC,KAAK,EAAE;IAAS,CAAC,CAAC,CAAC;IAC7C5D,GAAG,CAAC2B,GAAG,CAACQ,qBAAU,CAAC0B,GAAG,CAAC;MAAEC,IAAI,EAAE,0BAA0B;MAAEF,KAAK,EAAE;IAAS,CAAC,CAAC,CAAC;EAChF;EAWA,aAAaG,QAAQA,CACnB,CAACC,aAAa,CAAe,EAC7BvE,MAAqB,EACrB,CAACwE,SAAS,EAAErE,cAAc,CAA8B,EACxD;IACA,MAAMD,MAAM,GAAGqE,aAAa,CAACE,YAAY,CAAC1D,yBAAa,CAACC,EAAE,CAAC;IAC3D,OAAO,IAAIlB,WAAW,CAACE,MAAM,EAAEwE,SAAS,EAAEtE,MAAM,EAAEC,cAAc,CAAC;EACnE;AACF;AAACuE,OAAA,CAAA5E,WAAA,GAAAA,WAAA;AAAAlB,eAAA,CArJYkB,WAAW,aACL6E,kBAAW;AAAA/F,eAAA,CADjBkB,WAAW,WAoIP,CAAC8E,eAAI,CAACC,QAAQ,CAAU,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAuB,CAAC,CAAC;AAAAjG,eAAA,CApIrEkB,WAAW,kBAqIA,CAACgF,sBAAY,CAAC;AAAAlG,eAAA,CArIzBkB,WAAW,mBAuIC;EACrBO,IAAI,EAAE,IAAI;EACVS,SAAS,EAAE,KAAK;EAChBsB,gBAAgB,EAAE,CAAC,cAAc;AACnC,CAAC;AAYHrB,yBAAa,CAACgE,UAAU,CAACjF,WAAW,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_harmony","_logger","_express","_interopRequireDefault","_lodash","_bodyParser","_express2","_middlewares","_types","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ExpressMain","constructor","config","moduleSlot","logger","middlewareSlot","listen","port","serverPort","app","createApp","static","root","opts","express","register","routes","registerMiddleware","middlewares","createRootRoutes","namespace","ExpressAspect","id","method","path","disableNamespace","priority","req","res","send","expressApp","options","internalRoutes","createRoutes","allRoutes","concat","sortedRoutes","sortBy","reverse","use","next","loggerIgnorePath","includes","url","debug","headers","disableBodyParser","bodyParser","middlewaresSlot","values","flat","forEach","route","middleware","routeInfo","catchErrorsMiddlewares","routesSlots","toArray","routeEntries","map","flatten","verbValidation","lowerCase","verb","Verb","READ","status","jsonp","message","error","catchErrors","json","limit","raw","type","provider","loggerFactory","routeSlot","createLogger","exports","MainRuntime","Slot","withType","LoggerAspect","addRuntime"],"sources":["express.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { Server } from 'http';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport express, { Express } from 'express';\nimport { concat, flatten, lowerCase, sortBy } from 'lodash';\nimport bodyParser from 'body-parser';\nimport { ExpressAspect } from './express.aspect';\nimport { catchErrors } from './middlewares';\nimport { Middleware, Request, Response, Route, Verb } from './types';\nimport { MiddlewareManifest } from './middleware-manifest';\n\nexport type ExpressConfig = {\n port: number;\n namespace: string;\n loggerIgnorePath: string[];\n};\n\nexport type MiddlewareSlot = SlotRegistry<MiddlewareManifest[]>;\n\nexport type RouteSlot = SlotRegistry<Route[]>;\n\nexport class ExpressMain {\n static runtime = MainRuntime;\n\n constructor(\n /**\n * extension config\n */\n readonly config: ExpressConfig,\n\n /**\n * slot for registering graphql modules\n */\n private moduleSlot: RouteSlot,\n\n /**\n * logger extension.\n */\n readonly logger: Logger,\n\n readonly middlewareSlot: MiddlewareSlot\n ) {}\n\n /**\n * start an express server.\n */\n async listen(port?: number): Promise<Server> {\n const serverPort = port || this.config.port;\n const app = this.createApp();\n return app.listen(serverPort);\n }\n\n static(root: string, opts?: any): any {\n return express.static(root, opts);\n }\n\n /**\n * register a new express routes.\n * route will be added as `/api/${route}`\n */\n register(routes: Route[]) {\n this.moduleSlot.register(routes);\n return this;\n }\n\n /**\n * register a new middleware into express.\n */\n registerMiddleware(middlewares: MiddlewareManifest[]) {\n this.middlewareSlot.register(middlewares);\n return this;\n }\n\n private createRootRoutes() {\n // TODO: @guy refactor health to service aspect.\n return [\n {\n namespace: ExpressAspect.id,\n method: 'get',\n path: '/_health',\n disableNamespace: false,\n priority: 0,\n middlewares: [async (req: Request, res: Response) => res.send('ok')],\n },\n ];\n }\n\n createApp(expressApp?: Express, options?: { disableBodyParser: true }): Express {\n const internalRoutes = this.createRootRoutes();\n const routes = this.createRoutes();\n const allRoutes = concat(routes, internalRoutes);\n const sortedRoutes = sortBy(allRoutes, (r) => r.priority).reverse();\n const app = expressApp || express();\n app.use((req, res, next) => {\n if (this.config.loggerIgnorePath.includes(req.url)) return next();\n this.logger.debug(`express got a request to a URL: ${req.url}', headers:`, req.headers);\n return next();\n });\n if (!options?.disableBodyParser) this.bodyParser(app);\n\n const middlewaresSlot = this.middlewareSlot.values().flat();\n middlewaresSlot.forEach(({ route, middleware }) => {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n if (!route) app.use(middleware);\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n if (route) app.use(route, middleware);\n });\n\n sortedRoutes.forEach((routeInfo) => {\n const { method, path, middlewares, disableNamespace } = routeInfo;\n // TODO: @guy make sure to support single middleware here.\n const namespace = disableNamespace ? '' : `/${this.config.namespace}`;\n app[method](`${namespace}${path}`, this.catchErrorsMiddlewares(middlewares));\n });\n\n return app;\n }\n\n private createRoutes() {\n const routesSlots = this.moduleSlot.toArray();\n const routeEntries = routesSlots.map(([, routes]) => {\n return routes.map((route) => {\n const middlewares = flatten([this.verbValidation(route), route.middlewares]);\n return {\n method: lowerCase(route.method),\n path: route.route,\n disableNamespace: route.disableNamespace,\n middlewares,\n priority: route.priority || 0,\n };\n });\n });\n\n return flatten(routeEntries);\n }\n\n private verbValidation(route: Route): Middleware {\n return async (req: express.Request, res: express.Response, next: express.NextFunction) => {\n if (!route.verb) return next();\n const verb = req.headers['x-verb'] || Verb.READ;\n if (verb !== route.verb) {\n res.status(403);\n return res.jsonp({ message: 'You are not authorized', error: 'forbidden' });\n }\n return next();\n };\n }\n\n private catchErrorsMiddlewares(middlewares: Middleware[]) {\n return middlewares.map((middleware) => catchErrors(middleware));\n }\n\n private bodyParser(app: Express) {\n app.use(bodyParser.json({ limit: '5000mb' }));\n app.use(bodyParser.raw({ type: 'application/octet-stream', limit: '5000mb' }));\n }\n\n static slots = [Slot.withType<Route[]>(), Slot.withType<MiddlewareManifest[]>()];\n static dependencies = [LoggerAspect];\n\n static defaultConfig = {\n port: 4001,\n namespace: 'api',\n loggerIgnorePath: ['/api/_health'],\n };\n\n static async provider(\n [loggerFactory]: [LoggerMain],\n config: ExpressConfig,\n [routeSlot, middlewareSlot]: [RouteSlot, MiddlewareSlot]\n ) {\n const logger = loggerFactory.createLogger(ExpressAspect.id);\n return new ExpressMain(config, routeSlot, logger, middlewareSlot);\n }\n}\n\nExpressAspect.addRuntime(ExpressMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAJ,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAA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AO,IAAItB,WAAW,CAACE,MAAM,EAAE2E,SAAS,EAAEzE,MAAM,EAAEC,cAAc,CAAC;EACnE;AACF;AAAC0E,OAAA,CAAA/E,WAAA,GAAAA,WAAA;AAAAlB,eAAA,CAzJYkB,WAAW,aACLgF,kBAAW;AAAAlG,eAAA,CADjBkB,WAAW,WAwIP,CAACiF,eAAI,CAACC,QAAQ,CAAU,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAuB,CAAC,CAAC;AAAApG,eAAA,CAxIrEkB,WAAW,kBAyIA,CAACmF,sBAAY,CAAC;AAAArG,eAAA,CAzIzBkB,WAAW,mBA2IC;EACrBO,IAAI,EAAE,IAAI;EACVa,SAAS,EAAE,KAAK;EAChBqB,gBAAgB,EAAE,CAAC,cAAc;AACnC,CAAC;AAYHpB,yBAAa,CAAC+D,UAAU,CAACpF,WAAW,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_express@0.0.1141/dist/express.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_express@0.0.1141/dist/express.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_express@0.0.1142/dist/express.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_express@0.0.1142/dist/express.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@teambit/express",
3
- "version": "0.0.1141",
3
+ "version": "0.0.1142",
4
4
  "homepage": "https://bit.cloud/teambit/harmony/express",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.harmony",
8
8
  "name": "express",
9
- "version": "0.0.1141"
9
+ "version": "0.0.1142"
10
10
  },
11
11
  "dependencies": {
12
12
  "body-parser": "1.20.2",
13
13
  "express": "4.19.2",
14
14
  "lodash": "4.17.21",
15
15
  "@teambit/harmony": "0.4.6",
16
- "@teambit/cli": "0.0.1042",
17
- "@teambit/logger": "0.0.1135"
16
+ "@teambit/cli": "0.0.1043",
17
+ "@teambit/logger": "0.0.1136"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/express": "4.17.13",