fix update build
This commit is contained in:
36
build/node_modules/next/dist/server/base-http/helpers.js
generated
vendored
Normal file
36
build/node_modules/next/dist/server/base-http/helpers.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
isNodeNextRequest: null,
|
||||
isNodeNextResponse: null,
|
||||
isWebNextRequest: null,
|
||||
isWebNextResponse: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
isNodeNextRequest: function() {
|
||||
return isNodeNextRequest;
|
||||
},
|
||||
isNodeNextResponse: function() {
|
||||
return isNodeNextResponse;
|
||||
},
|
||||
isWebNextRequest: function() {
|
||||
return isWebNextRequest;
|
||||
},
|
||||
isWebNextResponse: function() {
|
||||
return isWebNextResponse;
|
||||
}
|
||||
});
|
||||
const isWebNextRequest = (req)=>process.env.NEXT_RUNTIME === 'edge';
|
||||
const isWebNextResponse = (res)=>process.env.NEXT_RUNTIME === 'edge';
|
||||
const isNodeNextRequest = (req)=>process.env.NEXT_RUNTIME !== 'edge';
|
||||
const isNodeNextResponse = (res)=>process.env.NEXT_RUNTIME !== 'edge';
|
||||
|
||||
//# sourceMappingURL=helpers.js.map
|
||||
54
build/node_modules/next/dist/server/base-http/index.js
generated
vendored
Normal file
54
build/node_modules/next/dist/server/base-http/index.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
BaseNextRequest: null,
|
||||
BaseNextResponse: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
BaseNextRequest: function() {
|
||||
return BaseNextRequest;
|
||||
},
|
||||
BaseNextResponse: function() {
|
||||
return BaseNextResponse;
|
||||
}
|
||||
});
|
||||
const _redirectstatuscode = require("../../client/components/redirect-status-code");
|
||||
const _getcookieparser = require("../api-utils/get-cookie-parser");
|
||||
class BaseNextRequest {
|
||||
constructor(method, url, body){
|
||||
this.method = method;
|
||||
this.url = url;
|
||||
this.body = body;
|
||||
}
|
||||
// Utils implemented using the abstract methods above
|
||||
get cookies() {
|
||||
if (this._cookies) return this._cookies;
|
||||
return this._cookies = (0, _getcookieparser.getCookieParser)(this.headers)();
|
||||
}
|
||||
}
|
||||
class BaseNextResponse {
|
||||
constructor(destination){
|
||||
this.destination = destination;
|
||||
}
|
||||
// Utils implemented using the abstract methods above
|
||||
redirect(destination, statusCode) {
|
||||
this.setHeader('Location', destination);
|
||||
this.statusCode = statusCode;
|
||||
// Since IE11 doesn't support the 308 header add backwards
|
||||
// compatibility using refresh header
|
||||
if (statusCode === _redirectstatuscode.RedirectStatusCode.PermanentRedirect) {
|
||||
this.setHeader('Refresh', `0;url=${destination}`);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
147
build/node_modules/next/dist/server/base-http/node.js
generated
vendored
Normal file
147
build/node_modules/next/dist/server/base-http/node.js
generated
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
NodeNextRequest: null,
|
||||
NodeNextResponse: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
NodeNextRequest: function() {
|
||||
return NodeNextRequest;
|
||||
},
|
||||
NodeNextResponse: function() {
|
||||
return NodeNextResponse;
|
||||
}
|
||||
});
|
||||
const _apiutils = require("../api-utils");
|
||||
const _requestmeta = require("../request-meta");
|
||||
const _index = require("./index");
|
||||
let prop;
|
||||
class NodeNextRequest extends _index.BaseNextRequest {
|
||||
static #_ = prop = _NEXT_REQUEST_META = _requestmeta.NEXT_REQUEST_META;
|
||||
constructor(_req){
|
||||
var _this__req;
|
||||
super(_req.method.toUpperCase(), _req.url, _req), this._req = _req, this.headers = this._req.headers, this.fetchMetrics = (_this__req = this._req) == null ? void 0 : _this__req.fetchMetrics, this[_NEXT_REQUEST_META] = this._req[_requestmeta.NEXT_REQUEST_META] || {}, this.streaming = false;
|
||||
}
|
||||
get originalRequest() {
|
||||
// Need to mimic these changes to the original req object for places where we use it:
|
||||
// render.tsx, api/ssg requests
|
||||
this._req[_requestmeta.NEXT_REQUEST_META] = this[_requestmeta.NEXT_REQUEST_META];
|
||||
this._req.url = this.url;
|
||||
this._req.cookies = this.cookies;
|
||||
return this._req;
|
||||
}
|
||||
set originalRequest(value) {
|
||||
this._req = value;
|
||||
}
|
||||
/**
|
||||
* Returns the request body as a Web Readable Stream. The body here can only
|
||||
* be read once as the body will start flowing as soon as the data handler
|
||||
* is attached.
|
||||
*
|
||||
* @internal
|
||||
*/ stream() {
|
||||
if (this.streaming) {
|
||||
throw Object.defineProperty(new Error('Invariant: NodeNextRequest.stream() can only be called once'), "__NEXT_ERROR_CODE", {
|
||||
value: "E467",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
this.streaming = true;
|
||||
return new ReadableStream({
|
||||
start: (controller)=>{
|
||||
this._req.on('data', (chunk)=>{
|
||||
controller.enqueue(new Uint8Array(chunk));
|
||||
});
|
||||
this._req.on('end', ()=>{
|
||||
controller.close();
|
||||
});
|
||||
this._req.on('error', (err)=>{
|
||||
controller.error(err);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
class NodeNextResponse extends _index.BaseNextResponse {
|
||||
get originalResponse() {
|
||||
if (_apiutils.SYMBOL_CLEARED_COOKIES in this) {
|
||||
this._res[_apiutils.SYMBOL_CLEARED_COOKIES] = this[_apiutils.SYMBOL_CLEARED_COOKIES];
|
||||
}
|
||||
return this._res;
|
||||
}
|
||||
constructor(_res){
|
||||
super(_res), this._res = _res, this.textBody = undefined;
|
||||
}
|
||||
get sent() {
|
||||
return this._res.finished || this._res.headersSent;
|
||||
}
|
||||
get statusCode() {
|
||||
return this._res.statusCode;
|
||||
}
|
||||
set statusCode(value) {
|
||||
this._res.statusCode = value;
|
||||
}
|
||||
get statusMessage() {
|
||||
return this._res.statusMessage;
|
||||
}
|
||||
set statusMessage(value) {
|
||||
this._res.statusMessage = value;
|
||||
}
|
||||
setHeader(name, value) {
|
||||
this._res.setHeader(name, value);
|
||||
return this;
|
||||
}
|
||||
removeHeader(name) {
|
||||
this._res.removeHeader(name);
|
||||
return this;
|
||||
}
|
||||
getHeaderValues(name) {
|
||||
const values = this._res.getHeader(name);
|
||||
if (values === undefined) return undefined;
|
||||
return (Array.isArray(values) ? values : [
|
||||
values
|
||||
]).map((value)=>value.toString());
|
||||
}
|
||||
hasHeader(name) {
|
||||
return this._res.hasHeader(name);
|
||||
}
|
||||
getHeader(name) {
|
||||
const values = this.getHeaderValues(name);
|
||||
return Array.isArray(values) ? values.join(',') : undefined;
|
||||
}
|
||||
getHeaders() {
|
||||
return this._res.getHeaders();
|
||||
}
|
||||
appendHeader(name, value) {
|
||||
const currentValues = this.getHeaderValues(name) ?? [];
|
||||
if (!currentValues.includes(value)) {
|
||||
this._res.setHeader(name, [
|
||||
...currentValues,
|
||||
value
|
||||
]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
body(value) {
|
||||
this.textBody = value;
|
||||
return this;
|
||||
}
|
||||
send() {
|
||||
this._res.end(this.textBody);
|
||||
}
|
||||
onClose(callback) {
|
||||
this.originalResponse.on('close', callback);
|
||||
}
|
||||
}
|
||||
var _NEXT_REQUEST_META;
|
||||
|
||||
//# sourceMappingURL=node.js.map
|
||||
124
build/node_modules/next/dist/server/base-http/web.js
generated
vendored
Normal file
124
build/node_modules/next/dist/server/base-http/web.js
generated
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
WebNextRequest: null,
|
||||
WebNextResponse: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
WebNextRequest: function() {
|
||||
return WebNextRequest;
|
||||
},
|
||||
WebNextResponse: function() {
|
||||
return WebNextResponse;
|
||||
}
|
||||
});
|
||||
const _utils = require("../web/utils");
|
||||
const _index = require("./index");
|
||||
const _detachedpromise = require("../../lib/detached-promise");
|
||||
const _webonclose = require("../web/web-on-close");
|
||||
const _invarianterror = require("../../shared/lib/invariant-error");
|
||||
class WebNextRequest extends _index.BaseNextRequest {
|
||||
constructor(request){
|
||||
const url = new URL(request.url);
|
||||
super(request.method, url.href.slice(url.origin.length), request.clone().body);
|
||||
this.request = request;
|
||||
this.fetchMetrics = request.fetchMetrics;
|
||||
this.headers = {};
|
||||
for (const [name, value] of request.headers.entries()){
|
||||
this.headers[name] = value;
|
||||
}
|
||||
}
|
||||
async parseBody(_limit) {
|
||||
throw Object.defineProperty(new Error('parseBody is not implemented in the web runtime'), "__NEXT_ERROR_CODE", {
|
||||
value: "E213",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
class WebNextResponse extends _index.BaseNextResponse {
|
||||
constructor(transformStream = new TransformStream()){
|
||||
super(transformStream.writable), this.transformStream = transformStream, this.headers = new Headers(), this.textBody = undefined, this.closeController = new _webonclose.CloseController(), this.sendPromise = new _detachedpromise.DetachedPromise(), this._sent = false;
|
||||
}
|
||||
setHeader(name, value) {
|
||||
this.headers.delete(name);
|
||||
for (const val of Array.isArray(value) ? value : [
|
||||
value
|
||||
]){
|
||||
this.headers.append(name, val);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
removeHeader(name) {
|
||||
this.headers.delete(name);
|
||||
return this;
|
||||
}
|
||||
getHeaderValues(name) {
|
||||
var _this_getHeader;
|
||||
// https://developer.mozilla.org/docs/Web/API/Headers/get#example
|
||||
return (_this_getHeader = this.getHeader(name)) == null ? void 0 : _this_getHeader.split(',').map((v)=>v.trimStart());
|
||||
}
|
||||
getHeader(name) {
|
||||
return this.headers.get(name) ?? undefined;
|
||||
}
|
||||
getHeaders() {
|
||||
return (0, _utils.toNodeOutgoingHttpHeaders)(this.headers);
|
||||
}
|
||||
hasHeader(name) {
|
||||
return this.headers.has(name);
|
||||
}
|
||||
appendHeader(name, value) {
|
||||
this.headers.append(name, value);
|
||||
return this;
|
||||
}
|
||||
body(value) {
|
||||
this.textBody = value;
|
||||
return this;
|
||||
}
|
||||
send() {
|
||||
this.sendPromise.resolve();
|
||||
this._sent = true;
|
||||
}
|
||||
get sent() {
|
||||
return this._sent;
|
||||
}
|
||||
async toResponse() {
|
||||
// If we haven't called `send` yet, wait for it to be called.
|
||||
if (!this.sent) await this.sendPromise.promise;
|
||||
const body = this.textBody ?? this.transformStream.readable;
|
||||
let bodyInit = body;
|
||||
// if the response is streaming, onClose() can still be called after this point.
|
||||
const canAddListenersLater = typeof bodyInit !== 'string';
|
||||
const shouldTrackBody = canAddListenersLater ? true : this.closeController.listeners > 0;
|
||||
if (shouldTrackBody) {
|
||||
bodyInit = (0, _webonclose.trackBodyConsumed)(body, ()=>{
|
||||
this.closeController.dispatchClose();
|
||||
});
|
||||
}
|
||||
return new Response(bodyInit, {
|
||||
headers: this.headers,
|
||||
status: this.statusCode,
|
||||
statusText: this.statusMessage
|
||||
});
|
||||
}
|
||||
onClose(callback) {
|
||||
if (this.closeController.isClosed) {
|
||||
throw Object.defineProperty(new _invarianterror.InvariantError('Cannot call onClose on a WebNextResponse that is already closed'), "__NEXT_ERROR_CODE", {
|
||||
value: "E599",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
return this.closeController.onClose(callback);
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=web.js.map
|
||||
Reference in New Issue
Block a user