@teambit/express 0.0.954 → 0.0.955
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_harmony_express-preview.js +1 -1
- package/artifacts/schema.json +60 -17
- package/dist/express.aspect.js.map +1 -1
- package/dist/express.composition.js.map +1 -1
- package/dist/express.main.runtime.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/middleware-manifest.js.map +1 -1
- package/dist/middlewares/error.js.map +1 -1
- package/dist/middlewares/index.js.map +1 -1
- package/dist/preview-1710224484125.js +7 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/next.js.map +1 -1
- package/dist/types/request.js.map +1 -1
- package/dist/types/response.js.map +1 -1
- package/dist/types/route.js.map +1 -1
- package/package.json +5 -5
- package/dist/preview-1709867881461.js +0 -7
@@ -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.
|
3
|
+
<testsuite name="teambit.harmony/express@0.0.955" 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={
|
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={62175:(e,t,o)=>{var r={id:"teambit.harmony/express@0.0.955",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={};return(()=>{o.r(r),o.d(r,{compositions:()=>u,compositions_metadata:()=>l,overview:()=>f});var e={};o.r(e),o.d(e,{default:()=>d});var t=o(62175);o(41594);const n=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var s=["components"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},p.apply(this,arguments)}var a={},c="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,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||(n[o]=e[o]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}(e,s);return(0,n.mdx)(c,p({},a,o,{components:t,mdxType:"MDXLayout"}),(0,n.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}d.isMDXComponent=!0;const u=[t],f=[e],l={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),r})()));
|
package/artifacts/schema.json
CHANGED
@@ -30,6 +30,11 @@
|
|
30
30
|
"character": 25
|
31
31
|
},
|
32
32
|
"name": "SlotRegistry",
|
33
|
+
"componentId": {
|
34
|
+
"scope": "teambit.harmony",
|
35
|
+
"name": "harmony",
|
36
|
+
"version": "0.4.6"
|
37
|
+
},
|
33
38
|
"typeArgs": [
|
34
39
|
{
|
35
40
|
"__schema": "TypeArraySchema",
|
@@ -572,7 +577,8 @@
|
|
572
577
|
"line": 30,
|
573
578
|
"character": 22
|
574
579
|
},
|
575
|
-
"name": "ExpressConfig"
|
580
|
+
"name": "ExpressConfig",
|
581
|
+
"internalFilePath": "express.main.runtime.ts"
|
576
582
|
},
|
577
583
|
"isOptional": false,
|
578
584
|
"isSpread": false
|
@@ -612,7 +618,11 @@
|
|
612
618
|
"line": 40,
|
613
619
|
"character": 22
|
614
620
|
},
|
615
|
-
"name": "Logger"
|
621
|
+
"name": "Logger",
|
622
|
+
"componentId": {
|
623
|
+
"scope": "teambit.harmony",
|
624
|
+
"name": "logger"
|
625
|
+
}
|
616
626
|
},
|
617
627
|
"isOptional": false,
|
618
628
|
"isSpread": false
|
@@ -632,7 +642,8 @@
|
|
632
642
|
"line": 42,
|
633
643
|
"character": 30
|
634
644
|
},
|
635
|
-
"name": "MiddlewareSlot"
|
645
|
+
"name": "MiddlewareSlot",
|
646
|
+
"internalFilePath": "express.main.runtime.ts"
|
636
647
|
},
|
637
648
|
"isOptional": false,
|
638
649
|
"isSpread": false
|
@@ -706,7 +717,8 @@
|
|
706
717
|
"line": 48,
|
707
718
|
"character": 40
|
708
719
|
},
|
709
|
-
"name": "Server"
|
720
|
+
"name": "Server",
|
721
|
+
"packageName": "http"
|
710
722
|
}
|
711
723
|
]
|
712
724
|
},
|
@@ -859,7 +871,8 @@
|
|
859
871
|
"line": 85,
|
860
872
|
"character": 26
|
861
873
|
},
|
862
|
-
"name": "Express"
|
874
|
+
"name": "Express",
|
875
|
+
"packageName": "express"
|
863
876
|
},
|
864
877
|
"isOptional": true,
|
865
878
|
"isSpread": false
|
@@ -1014,7 +1027,11 @@
|
|
1014
1027
|
"line": 165,
|
1015
1028
|
"character": 23
|
1016
1029
|
},
|
1017
|
-
"name": "LoggerMain"
|
1030
|
+
"name": "LoggerMain",
|
1031
|
+
"componentId": {
|
1032
|
+
"scope": "teambit.harmony",
|
1033
|
+
"name": "logger"
|
1034
|
+
}
|
1018
1035
|
}
|
1019
1036
|
]
|
1020
1037
|
},
|
@@ -1036,7 +1053,8 @@
|
|
1036
1053
|
"line": 166,
|
1037
1054
|
"character": 13
|
1038
1055
|
},
|
1039
|
-
"name": "ExpressConfig"
|
1056
|
+
"name": "ExpressConfig",
|
1057
|
+
"internalFilePath": "express.main.runtime.ts"
|
1040
1058
|
},
|
1041
1059
|
"isOptional": false,
|
1042
1060
|
"isSpread": false
|
@@ -1073,7 +1091,8 @@
|
|
1073
1091
|
"line": 167,
|
1074
1092
|
"character": 46
|
1075
1093
|
},
|
1076
|
-
"name": "MiddlewareSlot"
|
1094
|
+
"name": "MiddlewareSlot",
|
1095
|
+
"internalFilePath": "express.main.runtime.ts"
|
1077
1096
|
}
|
1078
1097
|
]
|
1079
1098
|
},
|
@@ -1242,6 +1261,11 @@
|
|
1242
1261
|
"character": 30
|
1243
1262
|
},
|
1244
1263
|
"name": "SlotRegistry",
|
1264
|
+
"componentId": {
|
1265
|
+
"scope": "teambit.harmony",
|
1266
|
+
"name": "harmony",
|
1267
|
+
"version": "0.4.6"
|
1268
|
+
},
|
1245
1269
|
"typeArgs": [
|
1246
1270
|
{
|
1247
1271
|
"__schema": "TypeArraySchema",
|
@@ -1280,6 +1304,11 @@
|
|
1280
1304
|
"character": 25
|
1281
1305
|
},
|
1282
1306
|
"name": "SlotRegistry",
|
1307
|
+
"componentId": {
|
1308
|
+
"scope": "teambit.harmony",
|
1309
|
+
"name": "harmony",
|
1310
|
+
"version": "0.4.6"
|
1311
|
+
},
|
1283
1312
|
"typeArgs": [
|
1284
1313
|
{
|
1285
1314
|
"__schema": "TypeArraySchema",
|
@@ -1357,7 +1386,8 @@
|
|
1357
1386
|
"line": 30,
|
1358
1387
|
"character": 22
|
1359
1388
|
},
|
1360
|
-
"name": "ExpressConfig"
|
1389
|
+
"name": "ExpressConfig",
|
1390
|
+
"internalFilePath": "express.main.runtime.ts"
|
1361
1391
|
},
|
1362
1392
|
"isOptional": false,
|
1363
1393
|
"isSpread": false
|
@@ -1397,7 +1427,11 @@
|
|
1397
1427
|
"line": 40,
|
1398
1428
|
"character": 22
|
1399
1429
|
},
|
1400
|
-
"name": "Logger"
|
1430
|
+
"name": "Logger",
|
1431
|
+
"componentId": {
|
1432
|
+
"scope": "teambit.harmony",
|
1433
|
+
"name": "logger"
|
1434
|
+
}
|
1401
1435
|
},
|
1402
1436
|
"isOptional": false,
|
1403
1437
|
"isSpread": false
|
@@ -1417,7 +1451,8 @@
|
|
1417
1451
|
"line": 42,
|
1418
1452
|
"character": 30
|
1419
1453
|
},
|
1420
|
-
"name": "MiddlewareSlot"
|
1454
|
+
"name": "MiddlewareSlot",
|
1455
|
+
"internalFilePath": "express.main.runtime.ts"
|
1421
1456
|
},
|
1422
1457
|
"isOptional": false,
|
1423
1458
|
"isSpread": false
|
@@ -1491,7 +1526,8 @@
|
|
1491
1526
|
"line": 48,
|
1492
1527
|
"character": 40
|
1493
1528
|
},
|
1494
|
-
"name": "Server"
|
1529
|
+
"name": "Server",
|
1530
|
+
"packageName": "http"
|
1495
1531
|
}
|
1496
1532
|
]
|
1497
1533
|
},
|
@@ -1644,7 +1680,8 @@
|
|
1644
1680
|
"line": 85,
|
1645
1681
|
"character": 26
|
1646
1682
|
},
|
1647
|
-
"name": "Express"
|
1683
|
+
"name": "Express",
|
1684
|
+
"packageName": "express"
|
1648
1685
|
},
|
1649
1686
|
"isOptional": true,
|
1650
1687
|
"isSpread": false
|
@@ -1799,7 +1836,11 @@
|
|
1799
1836
|
"line": 165,
|
1800
1837
|
"character": 23
|
1801
1838
|
},
|
1802
|
-
"name": "LoggerMain"
|
1839
|
+
"name": "LoggerMain",
|
1840
|
+
"componentId": {
|
1841
|
+
"scope": "teambit.harmony",
|
1842
|
+
"name": "logger"
|
1843
|
+
}
|
1803
1844
|
}
|
1804
1845
|
]
|
1805
1846
|
},
|
@@ -1821,7 +1862,8 @@
|
|
1821
1862
|
"line": 166,
|
1822
1863
|
"character": 13
|
1823
1864
|
},
|
1824
|
-
"name": "ExpressConfig"
|
1865
|
+
"name": "ExpressConfig",
|
1866
|
+
"internalFilePath": "express.main.runtime.ts"
|
1825
1867
|
},
|
1826
1868
|
"isOptional": false,
|
1827
1869
|
"isSpread": false
|
@@ -1858,7 +1900,8 @@
|
|
1858
1900
|
"line": 167,
|
1859
1901
|
"character": 46
|
1860
1902
|
},
|
1861
|
-
"name": "MiddlewareSlot"
|
1903
|
+
"name": "MiddlewareSlot",
|
1904
|
+
"internalFilePath": "express.main.runtime.ts"
|
1862
1905
|
}
|
1863
1906
|
]
|
1864
1907
|
},
|
@@ -1939,7 +1982,7 @@
|
|
1939
1982
|
"componentId": {
|
1940
1983
|
"scope": "teambit.harmony",
|
1941
1984
|
"name": "express",
|
1942
|
-
"version": "0.0.
|
1985
|
+
"version": "0.0.955"
|
1943
1986
|
},
|
1944
1987
|
"taggedModuleExports": []
|
1945
1988
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_harmony","data","require","ExpressAspect","exports","Aspect","create","id","dependencies","defaultConfig"],"sources":["express.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const ExpressAspect = Aspect.create({\n id: 'teambit.harmony/express',\n dependencies: [],\n defaultConfig: {},\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EACzCC,EAAE,EAAE,yBAAyB;EAC7BC,YAAY,EAAE,EAAE;EAChBC,aAAa,EAAE,CAAC;AAClB,CAAC,CAAC"}
|
1
|
+
{"version":3,"names":["_harmony","data","require","ExpressAspect","exports","Aspect","create","id","dependencies","defaultConfig"],"sources":["express.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const ExpressAspect = Aspect.create({\n id: 'teambit.harmony/express',\n dependencies: [],\n defaultConfig: {},\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EACzCC,EAAE,EAAE,yBAAyB;EAC7BC,YAAY,EAAE,EAAE;EAChBC,aAAa,EAAE,CAAC;AAClB,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","obj","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["express.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/express.svg\" />\n </div>\n);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAqD,CAAE,CACnF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA"}
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","obj","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["express.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/express.svg\" />\n </div>\n);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAqD,CAAE,CACnF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_harmony","_logger","_express","_interopRequireDefault","_lodash","_bodyParser","_express2","_middlewares","_types","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","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, 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,IA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AACE,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;AAAApB,eAAA,CArJYoB,WAAW,aACL6E,kBAAW;AAAAjG,eAAA,CADjBoB,WAAW,WAoIP,CAAC8E,eAAI,CAACC,QAAQ,CAAU,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAuB,CAAC,CAAC;AAAAnG,eAAA,CApIrEoB,WAAW,kBAqIA,CAACgF,sBAAY,CAAC;AAAApG,eAAA,CArIzBoB,WAAW,mBAuIC;EACrBO,IAAI,EAAE,IAAI;EACVS,SAAS,EAAE,KAAK;EAChBsB,gBAAgB,EAAE,CAAC,cAAc;AACnC,CAAC;AAYHrB,yBAAa,CAACgE,UAAU,CAACjF,WAAW,CAAC"}
|
1
|
+
{"version":3,"names":["_cli","data","require","_harmony","_logger","_express","_interopRequireDefault","_lodash","_bodyParser","_express2","_middlewares","_types","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","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, 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;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,YAAA;EAAA,MAAAP,IAAA,GAAAK,sBAAA,CAAAJ,OAAA;EAAAM,WAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,UAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,SAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,aAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,YAAA,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ED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_types","data","require","_express"],"sources":["index.ts"],"sourcesContent":["export type { RouteSlot } from './express.main.runtime';\nexport type { Route } from './types';\nexport { Verb } from './types';\nexport type { Request, Response, NextFunction, Middleware } from './types';\nexport type { MiddlewareManifest } from './middleware-manifest';\nexport type { ExpressMain } from './express.main.runtime';\nexport { ExpressAspect } from './express.aspect';\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA"}
|
1
|
+
{"version":3,"names":["_types","data","require","_express"],"sources":["index.ts"],"sourcesContent":["export type { RouteSlot } from './express.main.runtime';\nexport type { Route } from './types';\nexport { Verb } from './types';\nexport type { Request, Response, NextFunction, Middleware } from './types';\nexport type { MiddlewareManifest } from './middleware-manifest';\nexport type { ExpressMain } from './express.main.runtime';\nexport { ExpressAspect } from './express.aspect';\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["middleware-manifest.ts"],"sourcesContent":["import { Middleware } from './types';\n\nexport interface MiddlewareManifest {\n route?: string;\n middleware: Middleware;\n}\n"],"mappings":""}
|
1
|
+
{"version":3,"names":[],"sources":["middleware-manifest.ts"],"sourcesContent":["import { Middleware } from './types';\n\nexport interface MiddlewareManifest {\n route?: string;\n middleware: Middleware;\n}\n"],"mappings":"","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_logger","data","_interopRequireDefault","require","obj","__esModule","default","catchErrors","action","req","res","next","catch","error","errorHandle","exports","err","logger","url","status","jsonp","message"],"sources":["error.ts"],"sourcesContent":["import * as express from 'express';\nimport logger from '@teambit/legacy/dist/logger/logger';\n\ninterface ResponseError {\n status?: number;\n message?: string;\n}\n\nexport const catchErrors = (action: any) => (req: express.Request, res: express.Response, next: express.NextFunction) =>\n // TODO: @guy please take care of it\n // eslint-disable-next-line promise/no-callback-in-promise\n action(req, res, next).catch((error: ResponseError) => errorHandle(error, req, res, next));\n\nexport function errorHandle(\n err: ResponseError,\n req: express.Request,\n res: express.Response,\n // TODO: Do not remove unused next, it's needed for express to catch errors!\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n next: express.NextFunction\n) {\n logger.error(`express.errorHandle, url ${req.url}, error:`, err);\n err.status = err.status || 500;\n res.status(err.status);\n return res.jsonp({\n message: err.message,\n error: err,\n });\n}\n"],"mappings":";;;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwD,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAOjD,MAAMG,WAAW,GAAIC,MAAW,IAAK,CAACC,GAAoB,EAAEC,GAAqB,EAAEC,IAA0B;AAClH;AACA;AACAH,MAAM,CAACC,GAAG,EAAEC,GAAG,EAAEC,IAAI,CAAC,CAACC,KAAK,CAAEC,KAAoB,IAAKC,WAAW,CAACD,KAAK,EAAEJ,GAAG,EAAEC,GAAG,EAAEC,IAAI,CAAC,CAAC;AAACI,OAAA,CAAAR,WAAA,GAAAA,WAAA;AAEtF,SAASO,WAAWA,CACzBE,GAAkB,EAClBP,GAAoB,EACpBC,GAAqB;AACrB;AACA;AACAC,IAA0B,EAC1B;EACAM,iBAAM,CAACJ,KAAK,CAAE,4BAA2BJ,GAAG,CAACS,GAAI,UAAS,EAAEF,GAAG,CAAC;EAChEA,GAAG,CAACG,MAAM,GAAGH,GAAG,CAACG,MAAM,IAAI,GAAG;EAC9BT,GAAG,CAACS,MAAM,CAACH,GAAG,CAACG,MAAM,CAAC;EACtB,OAAOT,GAAG,CAACU,KAAK,CAAC;IACfC,OAAO,EAAEL,GAAG,CAACK,OAAO;IACpBR,KAAK,EAAEG;EACT,CAAC,CAAC;AACJ"}
|
1
|
+
{"version":3,"names":["_logger","data","_interopRequireDefault","require","obj","__esModule","default","catchErrors","action","req","res","next","catch","error","errorHandle","exports","err","logger","url","status","jsonp","message"],"sources":["error.ts"],"sourcesContent":["import * as express from 'express';\nimport logger from '@teambit/legacy/dist/logger/logger';\n\ninterface ResponseError {\n status?: number;\n message?: string;\n}\n\nexport const catchErrors = (action: any) => (req: express.Request, res: express.Response, next: express.NextFunction) =>\n // TODO: @guy please take care of it\n // eslint-disable-next-line promise/no-callback-in-promise\n action(req, res, next).catch((error: ResponseError) => errorHandle(error, req, res, next));\n\nexport function errorHandle(\n err: ResponseError,\n req: express.Request,\n res: express.Response,\n // TODO: Do not remove unused next, it's needed for express to catch errors!\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n next: express.NextFunction\n) {\n logger.error(`express.errorHandle, url ${req.url}, error:`, err);\n err.status = err.status || 500;\n res.status(err.status);\n return res.jsonp({\n message: err.message,\n error: err,\n });\n}\n"],"mappings":";;;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwD,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAOjD,MAAMG,WAAW,GAAIC,MAAW,IAAK,CAACC,GAAoB,EAAEC,GAAqB,EAAEC,IAA0B;AAClH;AACA;AACAH,MAAM,CAACC,GAAG,EAAEC,GAAG,EAAEC,IAAI,CAAC,CAACC,KAAK,CAAEC,KAAoB,IAAKC,WAAW,CAACD,KAAK,EAAEJ,GAAG,EAAEC,GAAG,EAAEC,IAAI,CAAC,CAAC;AAACI,OAAA,CAAAR,WAAA,GAAAA,WAAA;AAEtF,SAASO,WAAWA,CACzBE,GAAkB,EAClBP,GAAoB,EACpBC,GAAqB;AACrB;AACA;AACAC,IAA0B,EAC1B;EACAM,iBAAM,CAACJ,KAAK,CAAE,4BAA2BJ,GAAG,CAACS,GAAI,UAAS,EAAEF,GAAG,CAAC;EAChEA,GAAG,CAACG,MAAM,GAAGH,GAAG,CAACG,MAAM,IAAI,GAAG;EAC9BT,GAAG,CAACS,MAAM,CAACH,GAAG,CAACG,MAAM,CAAC;EACtB,OAAOT,GAAG,CAACU,KAAK,CAAC;IACfC,OAAO,EAAEL,GAAG,CAACK,OAAO;IACpBR,KAAK,EAAEG;EACT,CAAC,CAAC;AACJ","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_error","data","require"],"sources":["index.ts"],"sourcesContent":["export { catchErrors, errorHandle } from './error';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA"}
|
1
|
+
{"version":3,"names":["_error","data","require"],"sources":["index.ts"],"sourcesContent":["export { catchErrors, errorHandle } from './error';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import * as compositions_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.harmony_express@0.0.955/dist/express.composition.js';
|
2
|
+
import * as overview_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.harmony_express@0.0.955/dist/express.docs.mdx';
|
3
|
+
|
4
|
+
export const compositions = [compositions_0];
|
5
|
+
export const overview = [overview_0];
|
6
|
+
|
7
|
+
export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};
|
package/dist/types/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_request","data","require","_response","_next","_route"],"sources":["index.ts"],"sourcesContent":["export { Request } from './request';\nexport { Response } from './response';\nexport { NextFunction } from './next';\nexport { Route, Middleware, Verb } from './route';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA"}
|
1
|
+
{"version":3,"names":["_request","data","require","_response","_next","_route"],"sources":["index.ts"],"sourcesContent":["export { Request } from './request';\nexport { Response } from './response';\nexport { NextFunction } from './next';\nexport { Route, Middleware, Verb } from './route';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
|
package/dist/types/next.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["next.ts"],"sourcesContent":["import express from 'express';\n\nexport type NextFunction = express.NextFunction;\n"],"mappings":""}
|
1
|
+
{"version":3,"names":[],"sources":["next.ts"],"sourcesContent":["import express from 'express';\n\nexport type NextFunction = express.NextFunction;\n"],"mappings":"","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["request.ts"],"sourcesContent":["export type { Request } from 'express';\n"],"mappings":""}
|
1
|
+
{"version":3,"names":[],"sources":["request.ts"],"sourcesContent":["export type { Request } from 'express';\n"],"mappings":"","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["response.ts"],"sourcesContent":["import express from 'express';\n\nexport type Response = {} & express.Response;\n"],"mappings":""}
|
1
|
+
{"version":3,"names":[],"sources":["response.ts"],"sourcesContent":["import express from 'express';\n\nexport type Response = {} & express.Response;\n"],"mappings":"","ignoreList":[]}
|
package/dist/types/route.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Verb","exports"],"sources":["route.ts"],"sourcesContent":["import { NextFunction } from './next';\nimport { Request } from './request';\nimport { Response } from './response';\n\n/**\n * define express Middleware\n */\nexport type Middleware = (req: Request, res: Response, next: NextFunction) => void | Promise<any>;\n\nexport enum Verb {\n WRITE = 'write',\n READ = 'read',\n}\n\n/**\n * express new Route\n */\n\nexport interface Route {\n method: string;\n route: string | RegExp;\n disableNamespace?: boolean;\n verb?: Verb;\n middlewares: Middleware[];\n /** route priority if 2 route with the same name default is 0 */\n priority?: number;\n}\n"],"mappings":";;;;;;AAIA;AACA;AACA;AAFA,IAKYA,IAAI,GAAAC,OAAA,CAAAD,IAAA,0BAAJA,IAAI;EAAJA,IAAI;EAAJA,IAAI;EAAA,OAAJA,IAAI;AAAA;AAKhB;AACA;AACA"}
|
1
|
+
{"version":3,"names":["Verb","exports"],"sources":["route.ts"],"sourcesContent":["import { NextFunction } from './next';\nimport { Request } from './request';\nimport { Response } from './response';\n\n/**\n * define express Middleware\n */\nexport type Middleware = (req: Request, res: Response, next: NextFunction) => void | Promise<any>;\n\nexport enum Verb {\n WRITE = 'write',\n READ = 'read',\n}\n\n/**\n * express new Route\n */\n\nexport interface Route {\n method: string;\n route: string | RegExp;\n disableNamespace?: boolean;\n verb?: Verb;\n middlewares: Middleware[];\n /** route priority if 2 route with the same name default is 0 */\n priority?: number;\n}\n"],"mappings":";;;;;;AAIA;AACA;AACA;AAFA,IAKYA,IAAI,GAAAC,OAAA,CAAAD,IAAA,0BAAJA,IAAI;EAAJA,IAAI;EAAJA,IAAI;EAAA,OAAJA,IAAI;AAAA;AAKhB;AACA;AACA","ignoreList":[]}
|
package/package.json
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/express",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.955",
|
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.
|
9
|
+
"version": "0.0.955"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"body-parser": "1.19.0",
|
13
13
|
"express": "4.17.1",
|
14
14
|
"lodash": "4.17.21",
|
15
15
|
"@teambit/harmony": "0.4.6",
|
16
|
-
"@teambit/cli": "0.0.
|
17
|
-
"@teambit/logger": "0.0.
|
16
|
+
"@teambit/cli": "0.0.856",
|
17
|
+
"@teambit/logger": "0.0.949"
|
18
18
|
},
|
19
19
|
"devDependencies": {
|
20
20
|
"@types/express": "4.17.13",
|
21
21
|
"@types/lodash": "4.14.165",
|
22
22
|
"@types/mocha": "9.1.0",
|
23
23
|
"chai": "4.3.0",
|
24
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
24
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.27"
|
25
25
|
},
|
26
26
|
"peerDependencies": {
|
27
27
|
"react": "^17.0.0 || ^18.0.0",
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_express@0.0.954/dist/express.composition.js';
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_express@0.0.954/dist/express.docs.mdx';
|
3
|
-
|
4
|
-
export const compositions = [compositions_0];
|
5
|
-
export const overview = [overview_0];
|
6
|
-
|
7
|
-
export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};
|