@vercel/node 1.12.2-canary.1 → 1.12.2-canary.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers.js +97 -123
- package/dist/index.js +5673 -5716
- package/dist/launcher.js +12 -8
- package/dist/source-map-support.js +49 -47
- package/package.json +5 -5
package/dist/helpers.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
module.exports =
|
|
1
2
|
/******/ (() => { // webpackBootstrap
|
|
2
3
|
/******/ "use strict";
|
|
3
4
|
/******/ var __webpack_modules__ = ({
|
|
@@ -437,7 +438,7 @@ function tryDecode(str, decode) {
|
|
|
437
438
|
/***/ }),
|
|
438
439
|
|
|
439
440
|
/***/ 474:
|
|
440
|
-
/***/ ((module, __unused_webpack_exports,
|
|
441
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
441
442
|
|
|
442
443
|
/*!
|
|
443
444
|
* etag
|
|
@@ -459,8 +460,8 @@ module.exports = etag
|
|
|
459
460
|
* @private
|
|
460
461
|
*/
|
|
461
462
|
|
|
462
|
-
var crypto =
|
|
463
|
-
var Stats =
|
|
463
|
+
var crypto = __webpack_require__(417)
|
|
464
|
+
var Stats = __webpack_require__(747).Stats
|
|
464
465
|
|
|
465
466
|
/**
|
|
466
467
|
* Module variables.
|
|
@@ -574,124 +575,20 @@ function stattag (stat) {
|
|
|
574
575
|
|
|
575
576
|
/***/ }),
|
|
576
577
|
|
|
577
|
-
/***/
|
|
578
|
-
/***/ ((
|
|
579
|
-
|
|
580
|
-
module.exports = require("crypto");
|
|
581
|
-
|
|
582
|
-
/***/ }),
|
|
583
|
-
|
|
584
|
-
/***/ 747:
|
|
585
|
-
/***/ ((module) => {
|
|
578
|
+
/***/ 508:
|
|
579
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
586
580
|
|
|
587
|
-
module.exports = require("fs");
|
|
588
|
-
|
|
589
|
-
/***/ }),
|
|
590
|
-
|
|
591
|
-
/***/ 191:
|
|
592
|
-
/***/ ((module) => {
|
|
593
|
-
|
|
594
|
-
module.exports = require("querystring");
|
|
595
|
-
|
|
596
|
-
/***/ }),
|
|
597
|
-
|
|
598
|
-
/***/ 835:
|
|
599
|
-
/***/ ((module) => {
|
|
600
|
-
|
|
601
|
-
module.exports = require("url");
|
|
602
|
-
|
|
603
|
-
/***/ })
|
|
604
|
-
|
|
605
|
-
/******/ });
|
|
606
|
-
/************************************************************************/
|
|
607
|
-
/******/ // The module cache
|
|
608
|
-
/******/ var __webpack_module_cache__ = {};
|
|
609
|
-
/******/
|
|
610
|
-
/******/ // The require function
|
|
611
|
-
/******/ function __nccwpck_require__(moduleId) {
|
|
612
|
-
/******/ // Check if module is in cache
|
|
613
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
614
|
-
/******/ if (cachedModule !== undefined) {
|
|
615
|
-
/******/ return cachedModule.exports;
|
|
616
|
-
/******/ }
|
|
617
|
-
/******/ // Create a new module (and put it into the cache)
|
|
618
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
619
|
-
/******/ // no module.id needed
|
|
620
|
-
/******/ // no module.loaded needed
|
|
621
|
-
/******/ exports: {}
|
|
622
|
-
/******/ };
|
|
623
|
-
/******/
|
|
624
|
-
/******/ // Execute the module function
|
|
625
|
-
/******/ var threw = true;
|
|
626
|
-
/******/ try {
|
|
627
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
|
|
628
|
-
/******/ threw = false;
|
|
629
|
-
/******/ } finally {
|
|
630
|
-
/******/ if(threw) delete __webpack_module_cache__[moduleId];
|
|
631
|
-
/******/ }
|
|
632
|
-
/******/
|
|
633
|
-
/******/ // Return the exports of the module
|
|
634
|
-
/******/ return module.exports;
|
|
635
|
-
/******/ }
|
|
636
|
-
/******/
|
|
637
|
-
/************************************************************************/
|
|
638
|
-
/******/ /* webpack/runtime/define property getters */
|
|
639
|
-
/******/ (() => {
|
|
640
|
-
/******/ // define getter functions for harmony exports
|
|
641
|
-
/******/ __nccwpck_require__.d = (exports, definition) => {
|
|
642
|
-
/******/ for(var key in definition) {
|
|
643
|
-
/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) {
|
|
644
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
645
|
-
/******/ }
|
|
646
|
-
/******/ }
|
|
647
|
-
/******/ };
|
|
648
|
-
/******/ })();
|
|
649
|
-
/******/
|
|
650
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
651
|
-
/******/ (() => {
|
|
652
|
-
/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
653
|
-
/******/ })();
|
|
654
|
-
/******/
|
|
655
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
656
|
-
/******/ (() => {
|
|
657
|
-
/******/ // define __esModule on exports
|
|
658
|
-
/******/ __nccwpck_require__.r = (exports) => {
|
|
659
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
660
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
661
|
-
/******/ }
|
|
662
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
663
|
-
/******/ };
|
|
664
|
-
/******/ })();
|
|
665
|
-
/******/
|
|
666
|
-
/******/ /* webpack/runtime/compat */
|
|
667
|
-
/******/
|
|
668
|
-
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
|
669
|
-
/******/
|
|
670
|
-
/************************************************************************/
|
|
671
|
-
var __webpack_exports__ = {};
|
|
672
|
-
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
673
|
-
(() => {
|
|
674
|
-
// ESM COMPAT FLAG
|
|
675
|
-
__nccwpck_require__.r(__webpack_exports__);
|
|
676
|
-
|
|
677
|
-
// EXPORTS
|
|
678
|
-
__nccwpck_require__.d(__webpack_exports__, {
|
|
679
|
-
"ApiError": () => (/* binding */ ApiError),
|
|
680
|
-
"createServerWithHelpers": () => (/* binding */ createServerWithHelpers),
|
|
681
|
-
"sendError": () => (/* binding */ sendError)
|
|
682
|
-
});
|
|
683
|
-
|
|
684
|
-
;// CONCATENATED MODULE: external "http"
|
|
685
|
-
const external_http_namespaceObject = require("http");
|
|
686
|
-
;// CONCATENATED MODULE: ./src/helpers.ts
|
|
687
581
|
|
|
582
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
583
|
+
exports.createServerWithHelpers = exports.sendError = exports.ApiError = void 0;
|
|
584
|
+
const http_1 = __webpack_require__(605);
|
|
688
585
|
function getBodyParser(req, body) {
|
|
689
586
|
return function parseBody() {
|
|
690
587
|
if (!req.headers['content-type']) {
|
|
691
588
|
return undefined;
|
|
692
589
|
}
|
|
693
590
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
694
|
-
const { parse: parseContentType } =
|
|
591
|
+
const { parse: parseContentType } = __webpack_require__(534);
|
|
695
592
|
const { type } = parseContentType(req.headers['content-type']);
|
|
696
593
|
if (type === 'application/json') {
|
|
697
594
|
try {
|
|
@@ -707,7 +604,7 @@ function getBodyParser(req, body) {
|
|
|
707
604
|
}
|
|
708
605
|
if (type === 'application/x-www-form-urlencoded') {
|
|
709
606
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
710
|
-
const { parse: parseQS } =
|
|
607
|
+
const { parse: parseQS } = __webpack_require__(191);
|
|
711
608
|
// note: querystring.parse does not produce an iterable object
|
|
712
609
|
// https://nodejs.org/api/querystring.html#querystring_querystring_parse_str_sep_eq_options
|
|
713
610
|
return parseQS(body.toString());
|
|
@@ -721,7 +618,7 @@ function getBodyParser(req, body) {
|
|
|
721
618
|
function getQueryParser({ url = '/' }) {
|
|
722
619
|
return function parseQuery() {
|
|
723
620
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
724
|
-
const { parse: parseURL } =
|
|
621
|
+
const { parse: parseURL } = __webpack_require__(835);
|
|
725
622
|
return parseURL(url, true).query;
|
|
726
623
|
};
|
|
727
624
|
}
|
|
@@ -732,11 +629,11 @@ function getCookieParser(req) {
|
|
|
732
629
|
return {};
|
|
733
630
|
}
|
|
734
631
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
735
|
-
const { parse } =
|
|
632
|
+
const { parse } = __webpack_require__(891);
|
|
736
633
|
return parse(Array.isArray(header) ? header.join(';') : header);
|
|
737
634
|
};
|
|
738
635
|
}
|
|
739
|
-
function
|
|
636
|
+
function status(res, statusCode) {
|
|
740
637
|
res.statusCode = statusCode;
|
|
741
638
|
return res;
|
|
742
639
|
}
|
|
@@ -753,7 +650,7 @@ function redirect(res, statusOrUrl, url) {
|
|
|
753
650
|
}
|
|
754
651
|
function setCharset(type, charset) {
|
|
755
652
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
756
|
-
const { parse, format } =
|
|
653
|
+
const { parse, format } = __webpack_require__(534);
|
|
757
654
|
const parsed = parse(type);
|
|
758
655
|
parsed.parameters.charset = charset;
|
|
759
656
|
return format(parsed);
|
|
@@ -761,7 +658,7 @@ function setCharset(type, charset) {
|
|
|
761
658
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
762
659
|
function createETag(body, encoding) {
|
|
763
660
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
764
|
-
const etag =
|
|
661
|
+
const etag = __webpack_require__(474);
|
|
765
662
|
const buf = !Buffer.isBuffer(body) ? Buffer.from(body, encoding) : body;
|
|
766
663
|
return etag(buf, { weak: true });
|
|
767
664
|
}
|
|
@@ -871,11 +768,13 @@ class ApiError extends Error {
|
|
|
871
768
|
this.statusCode = statusCode;
|
|
872
769
|
}
|
|
873
770
|
}
|
|
771
|
+
exports.ApiError = ApiError;
|
|
874
772
|
function sendError(res, statusCode, message) {
|
|
875
773
|
res.statusCode = statusCode;
|
|
876
774
|
res.statusMessage = message;
|
|
877
775
|
res.end();
|
|
878
776
|
}
|
|
777
|
+
exports.sendError = sendError;
|
|
879
778
|
function setLazyProp(req, prop, getter) {
|
|
880
779
|
const opts = { configurable: true, enumerable: true };
|
|
881
780
|
const optsReset = { ...opts, writable: true };
|
|
@@ -893,7 +792,7 @@ function setLazyProp(req, prop, getter) {
|
|
|
893
792
|
});
|
|
894
793
|
}
|
|
895
794
|
function createServerWithHelpers(handler, bridge) {
|
|
896
|
-
const server = new
|
|
795
|
+
const server = new http_1.Server(async (_req, _res) => {
|
|
897
796
|
const req = _req;
|
|
898
797
|
const res = _res;
|
|
899
798
|
try {
|
|
@@ -907,7 +806,7 @@ function createServerWithHelpers(handler, bridge) {
|
|
|
907
806
|
setLazyProp(req, 'cookies', getCookieParser(req));
|
|
908
807
|
setLazyProp(req, 'query', getQueryParser(req));
|
|
909
808
|
setLazyProp(req, 'body', getBodyParser(req, event.body));
|
|
910
|
-
res.status = statusCode =>
|
|
809
|
+
res.status = statusCode => status(res, statusCode);
|
|
911
810
|
res.redirect = (statusOrUrl, url) => redirect(res, statusOrUrl, url);
|
|
912
811
|
res.send = body => send(req, res, body);
|
|
913
812
|
res.json = jsonBody => json(req, res, jsonBody);
|
|
@@ -924,9 +823,84 @@ function createServerWithHelpers(handler, bridge) {
|
|
|
924
823
|
});
|
|
925
824
|
return server;
|
|
926
825
|
}
|
|
826
|
+
exports.createServerWithHelpers = createServerWithHelpers;
|
|
927
827
|
|
|
928
|
-
})();
|
|
929
828
|
|
|
930
|
-
|
|
829
|
+
/***/ }),
|
|
830
|
+
|
|
831
|
+
/***/ 417:
|
|
832
|
+
/***/ ((module) => {
|
|
833
|
+
|
|
834
|
+
module.exports = require("crypto");
|
|
835
|
+
|
|
836
|
+
/***/ }),
|
|
837
|
+
|
|
838
|
+
/***/ 747:
|
|
839
|
+
/***/ ((module) => {
|
|
840
|
+
|
|
841
|
+
module.exports = require("fs");
|
|
842
|
+
|
|
843
|
+
/***/ }),
|
|
844
|
+
|
|
845
|
+
/***/ 605:
|
|
846
|
+
/***/ ((module) => {
|
|
847
|
+
|
|
848
|
+
module.exports = require("http");
|
|
849
|
+
|
|
850
|
+
/***/ }),
|
|
851
|
+
|
|
852
|
+
/***/ 191:
|
|
853
|
+
/***/ ((module) => {
|
|
854
|
+
|
|
855
|
+
module.exports = require("querystring");
|
|
856
|
+
|
|
857
|
+
/***/ }),
|
|
858
|
+
|
|
859
|
+
/***/ 835:
|
|
860
|
+
/***/ ((module) => {
|
|
861
|
+
|
|
862
|
+
module.exports = require("url");
|
|
863
|
+
|
|
864
|
+
/***/ })
|
|
865
|
+
|
|
866
|
+
/******/ });
|
|
867
|
+
/************************************************************************/
|
|
868
|
+
/******/ // The module cache
|
|
869
|
+
/******/ var __webpack_module_cache__ = {};
|
|
870
|
+
/******/
|
|
871
|
+
/******/ // The require function
|
|
872
|
+
/******/ function __webpack_require__(moduleId) {
|
|
873
|
+
/******/ // Check if module is in cache
|
|
874
|
+
/******/ if(__webpack_module_cache__[moduleId]) {
|
|
875
|
+
/******/ return __webpack_module_cache__[moduleId].exports;
|
|
876
|
+
/******/ }
|
|
877
|
+
/******/ // Create a new module (and put it into the cache)
|
|
878
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
879
|
+
/******/ // no module.id needed
|
|
880
|
+
/******/ // no module.loaded needed
|
|
881
|
+
/******/ exports: {}
|
|
882
|
+
/******/ };
|
|
883
|
+
/******/
|
|
884
|
+
/******/ // Execute the module function
|
|
885
|
+
/******/ var threw = true;
|
|
886
|
+
/******/ try {
|
|
887
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
888
|
+
/******/ threw = false;
|
|
889
|
+
/******/ } finally {
|
|
890
|
+
/******/ if(threw) delete __webpack_module_cache__[moduleId];
|
|
891
|
+
/******/ }
|
|
892
|
+
/******/
|
|
893
|
+
/******/ // Return the exports of the module
|
|
894
|
+
/******/ return module.exports;
|
|
895
|
+
/******/ }
|
|
896
|
+
/******/
|
|
897
|
+
/************************************************************************/
|
|
898
|
+
/******/ /* webpack/runtime/compat */
|
|
899
|
+
/******/
|
|
900
|
+
/******/ __webpack_require__.ab = __dirname + "/";/************************************************************************/
|
|
901
|
+
/******/ // module exports must be returned from runtime so entry inlining is disabled
|
|
902
|
+
/******/ // startup
|
|
903
|
+
/******/ // Load entry module and return exports
|
|
904
|
+
/******/ return __webpack_require__(508);
|
|
931
905
|
/******/ })()
|
|
932
906
|
;
|