Initial commit
This commit is contained in:
6
frontend/webapp/node_modules/next/dist/server/request/connection.d.ts
generated
vendored
Normal file
6
frontend/webapp/node_modules/next/dist/server/request/connection.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* This function allows you to indicate that you require an actual user Request before continuing.
|
||||
*
|
||||
* During prerendering it will never resolve and during rendering it resolves immediately.
|
||||
*/
|
||||
export declare function connection(): Promise<void>;
|
||||
77
frontend/webapp/node_modules/next/dist/server/request/connection.js
generated
vendored
Normal file
77
frontend/webapp/node_modules/next/dist/server/request/connection.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "connection", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return connection;
|
||||
}
|
||||
});
|
||||
const _workasyncstorageexternal = require("../app-render/work-async-storage.external");
|
||||
const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external");
|
||||
const _dynamicrendering = require("../app-render/dynamic-rendering");
|
||||
const _staticgenerationbailout = require("../../client/components/static-generation-bailout");
|
||||
const _dynamicrenderingutils = require("../dynamic-rendering-utils");
|
||||
const _utils = require("./utils");
|
||||
function connection() {
|
||||
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workStore) {
|
||||
if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) {
|
||||
throw Object.defineProperty(new Error(`Route ${workStore.route} used "connection" inside "after(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but "after(...)" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", {
|
||||
value: "E186",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
if (workStore.forceStatic) {
|
||||
// When using forceStatic we override all other logic and always just return an empty
|
||||
// headers object without tracking
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
if (workUnitStore) {
|
||||
if (workUnitStore.type === 'cache') {
|
||||
throw Object.defineProperty(new Error(`Route ${workStore.route} used "connection" inside "use cache". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
||||
value: "E111",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
} else if (workUnitStore.type === 'unstable-cache') {
|
||||
throw Object.defineProperty(new Error(`Route ${workStore.route} used "connection" inside a function cached with "unstable_cache(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", {
|
||||
value: "E1",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
if (workStore.dynamicShouldError) {
|
||||
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`connection\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
|
||||
value: "E562",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
if (workUnitStore) {
|
||||
if (workUnitStore.type === 'prerender') {
|
||||
// dynamicIO Prerender
|
||||
// We return a promise that never resolves to allow the prender to stall at this point
|
||||
return (0, _dynamicrenderingutils.makeHangingPromise)(workUnitStore.renderSignal, '`connection()`');
|
||||
} else if (workUnitStore.type === 'prerender-ppr') {
|
||||
// PPR Prerender (no dynamicIO)
|
||||
// We use React's postpone API to interrupt rendering here to create a dynamic hole
|
||||
(0, _dynamicrendering.postponeWithTracking)(workStore.route, 'connection', workUnitStore.dynamicTracking);
|
||||
} else if (workUnitStore.type === 'prerender-legacy') {
|
||||
// Legacy Prerender
|
||||
// We throw an error here to interrupt prerendering to mark the route as dynamic
|
||||
(0, _dynamicrendering.throwToInterruptStaticGeneration)('connection', workStore, workUnitStore);
|
||||
}
|
||||
}
|
||||
// We fall through to the dynamic context below but we still track dynamic access
|
||||
// because in dev we can still error for things like using headers inside a cache context
|
||||
(0, _dynamicrendering.trackDynamicDataInDynamicRender)(workStore, workUnitStore);
|
||||
}
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=connection.js.map
|
||||
1
frontend/webapp/node_modules/next/dist/server/request/connection.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/next/dist/server/request/connection.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
24
frontend/webapp/node_modules/next/dist/server/request/cookies.d.ts
generated
vendored
Normal file
24
frontend/webapp/node_modules/next/dist/server/request/cookies.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { type ReadonlyRequestCookies } from '../web/spec-extension/adapters/request-cookies';
|
||||
/**
|
||||
* In this version of Next.js `cookies()` returns a Promise however you can still reference the properties of the underlying cookies object
|
||||
* synchronously to facilitate migration. The `UnsafeUnwrappedCookies` type is added to your code by a codemod that attempts to automatically
|
||||
* updates callsites to reflect the new Promise return type. There are some cases where `cookies()` cannot be automatically converted, namely
|
||||
* when it is used inside a synchronous function and we can't be sure the function can be made async automatically. In these cases we add an
|
||||
* explicit type case to `UnsafeUnwrappedCookies` to enable typescript to allow for the synchronous usage only where it is actually necessary.
|
||||
*
|
||||
* You should should update these callsites to either be async functions where the `cookies()` value can be awaited or you should call `cookies()`
|
||||
* from outside and await the return value before passing it into this function.
|
||||
*
|
||||
* You can find instances that require manual migration by searching for `UnsafeUnwrappedCookies` in your codebase or by search for a comment that
|
||||
* starts with `@next-codemod-error`.
|
||||
*
|
||||
* In a future version of Next.js `cookies()` will only return a Promise and you will not be able to access the underlying cookies object directly
|
||||
* without awaiting the return value first. When this change happens the type `UnsafeUnwrappedCookies` will be updated to reflect that is it no longer
|
||||
* usable.
|
||||
*
|
||||
* This type is marked deprecated to help identify it as target for refactoring away.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
export type UnsafeUnwrappedCookies = ReadonlyRequestCookies;
|
||||
export declare function cookies(): Promise<ReadonlyRequestCookies>;
|
||||
418
frontend/webapp/node_modules/next/dist/server/request/cookies.js
generated
vendored
Normal file
418
frontend/webapp/node_modules/next/dist/server/request/cookies.js
generated
vendored
Normal file
@@ -0,0 +1,418 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "cookies", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return cookies;
|
||||
}
|
||||
});
|
||||
const _requestcookies = require("../web/spec-extension/adapters/request-cookies");
|
||||
const _cookies = require("../web/spec-extension/cookies");
|
||||
const _workasyncstorageexternal = require("../app-render/work-async-storage.external");
|
||||
const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external");
|
||||
const _dynamicrendering = require("../app-render/dynamic-rendering");
|
||||
const _staticgenerationbailout = require("../../client/components/static-generation-bailout");
|
||||
const _dynamicrenderingutils = require("../dynamic-rendering-utils");
|
||||
const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger");
|
||||
const _scheduler = require("../../lib/scheduler");
|
||||
const _utils = require("./utils");
|
||||
function cookies() {
|
||||
const callingExpression = 'cookies';
|
||||
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workStore) {
|
||||
if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) {
|
||||
throw Object.defineProperty(new Error(// TODO(after): clarify that this only applies to pages?
|
||||
`Route ${workStore.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", {
|
||||
value: "E88",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
if (workStore.forceStatic) {
|
||||
// When using forceStatic we override all other logic and always just return an empty
|
||||
// cookies object without tracking
|
||||
const underlyingCookies = createEmptyCookies();
|
||||
return makeUntrackedExoticCookies(underlyingCookies);
|
||||
}
|
||||
if (workUnitStore) {
|
||||
if (workUnitStore.type === 'cache') {
|
||||
throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
||||
value: "E398",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
} else if (workUnitStore.type === 'unstable-cache') {
|
||||
throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", {
|
||||
value: "E157",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
if (workStore.dynamicShouldError) {
|
||||
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
|
||||
value: "E549",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
if (workUnitStore) {
|
||||
if (workUnitStore.type === 'prerender') {
|
||||
// dynamicIO Prerender
|
||||
// We don't track dynamic access here because access will be tracked when you access
|
||||
// one of the properties of the cookies object.
|
||||
return makeDynamicallyTrackedExoticCookies(workStore.route, workUnitStore);
|
||||
} else if (workUnitStore.type === 'prerender-ppr') {
|
||||
// PPR Prerender (no dynamicIO)
|
||||
// We are prerendering with PPR. We need track dynamic access here eagerly
|
||||
// to keep continuity with how cookies has worked in PPR without dynamicIO.
|
||||
(0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking);
|
||||
} else if (workUnitStore.type === 'prerender-legacy') {
|
||||
// Legacy Prerender
|
||||
// We track dynamic access here so we don't need to wrap the cookies in
|
||||
// individual property access tracking.
|
||||
(0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore);
|
||||
}
|
||||
}
|
||||
// We fall through to the dynamic context below but we still track dynamic access
|
||||
// because in dev we can still error for things like using cookies inside a cache context
|
||||
(0, _dynamicrendering.trackDynamicDataInDynamicRender)(workStore, workUnitStore);
|
||||
}
|
||||
// cookies is being called in a dynamic context
|
||||
const requestStore = (0, _workunitasyncstorageexternal.getExpectedRequestStore)(callingExpression);
|
||||
let underlyingCookies;
|
||||
if ((0, _requestcookies.areCookiesMutableInCurrentPhase)(requestStore)) {
|
||||
// We can't conditionally return different types here based on the context.
|
||||
// To avoid confusion, we always return the readonly type here.
|
||||
underlyingCookies = requestStore.userspaceMutableCookies;
|
||||
} else {
|
||||
underlyingCookies = requestStore.cookies;
|
||||
}
|
||||
if (process.env.NODE_ENV === 'development' && !(workStore == null ? void 0 : workStore.isPrefetchRequest)) {
|
||||
return makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route);
|
||||
} else {
|
||||
return makeUntrackedExoticCookies(underlyingCookies);
|
||||
}
|
||||
}
|
||||
function createEmptyCookies() {
|
||||
return _requestcookies.RequestCookiesAdapter.seal(new _cookies.RequestCookies(new Headers({})));
|
||||
}
|
||||
const CachedCookies = new WeakMap();
|
||||
function makeDynamicallyTrackedExoticCookies(route, prerenderStore) {
|
||||
const cachedPromise = CachedCookies.get(prerenderStore);
|
||||
if (cachedPromise) {
|
||||
return cachedPromise;
|
||||
}
|
||||
const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`cookies()`');
|
||||
CachedCookies.set(prerenderStore, promise);
|
||||
Object.defineProperties(promise, {
|
||||
[Symbol.iterator]: {
|
||||
value: function() {
|
||||
const expression = '`cookies()[Symbol.iterator]()`';
|
||||
const error = createCookiesAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
size: {
|
||||
get () {
|
||||
const expression = '`cookies().size`';
|
||||
const error = createCookiesAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
get: {
|
||||
value: function get() {
|
||||
let expression;
|
||||
if (arguments.length === 0) {
|
||||
expression = '`cookies().get()`';
|
||||
} else {
|
||||
expression = `\`cookies().get(${describeNameArg(arguments[0])})\``;
|
||||
}
|
||||
const error = createCookiesAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
getAll: {
|
||||
value: function getAll() {
|
||||
let expression;
|
||||
if (arguments.length === 0) {
|
||||
expression = '`cookies().getAll()`';
|
||||
} else {
|
||||
expression = `\`cookies().getAll(${describeNameArg(arguments[0])})\``;
|
||||
}
|
||||
const error = createCookiesAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
has: {
|
||||
value: function has() {
|
||||
let expression;
|
||||
if (arguments.length === 0) {
|
||||
expression = '`cookies().has()`';
|
||||
} else {
|
||||
expression = `\`cookies().has(${describeNameArg(arguments[0])})\``;
|
||||
}
|
||||
const error = createCookiesAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
set: {
|
||||
value: function set() {
|
||||
let expression;
|
||||
if (arguments.length === 0) {
|
||||
expression = '`cookies().set()`';
|
||||
} else {
|
||||
const arg = arguments[0];
|
||||
if (arg) {
|
||||
expression = `\`cookies().set(${describeNameArg(arg)}, ...)\``;
|
||||
} else {
|
||||
expression = '`cookies().set(...)`';
|
||||
}
|
||||
}
|
||||
const error = createCookiesAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
delete: {
|
||||
value: function() {
|
||||
let expression;
|
||||
if (arguments.length === 0) {
|
||||
expression = '`cookies().delete()`';
|
||||
} else if (arguments.length === 1) {
|
||||
expression = `\`cookies().delete(${describeNameArg(arguments[0])})\``;
|
||||
} else {
|
||||
expression = `\`cookies().delete(${describeNameArg(arguments[0])}, ...)\``;
|
||||
}
|
||||
const error = createCookiesAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
clear: {
|
||||
value: function clear() {
|
||||
const expression = '`cookies().clear()`';
|
||||
const error = createCookiesAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
toString: {
|
||||
value: function toString() {
|
||||
const expression = '`cookies().toString()`';
|
||||
const error = createCookiesAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
function makeUntrackedExoticCookies(underlyingCookies) {
|
||||
const cachedCookies = CachedCookies.get(underlyingCookies);
|
||||
if (cachedCookies) {
|
||||
return cachedCookies;
|
||||
}
|
||||
const promise = Promise.resolve(underlyingCookies);
|
||||
CachedCookies.set(underlyingCookies, promise);
|
||||
Object.defineProperties(promise, {
|
||||
[Symbol.iterator]: {
|
||||
value: underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].bind(underlyingCookies) : // We should remove this and unify our cookies types. We could just let this continue to throw lazily
|
||||
// but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with
|
||||
// implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it
|
||||
// has extra properties not available on RequestCookie instances.
|
||||
polyfilledResponseCookiesIterator.bind(underlyingCookies)
|
||||
},
|
||||
size: {
|
||||
get () {
|
||||
return underlyingCookies.size;
|
||||
}
|
||||
},
|
||||
get: {
|
||||
value: underlyingCookies.get.bind(underlyingCookies)
|
||||
},
|
||||
getAll: {
|
||||
value: underlyingCookies.getAll.bind(underlyingCookies)
|
||||
},
|
||||
has: {
|
||||
value: underlyingCookies.has.bind(underlyingCookies)
|
||||
},
|
||||
set: {
|
||||
value: underlyingCookies.set.bind(underlyingCookies)
|
||||
},
|
||||
delete: {
|
||||
value: underlyingCookies.delete.bind(underlyingCookies)
|
||||
},
|
||||
clear: {
|
||||
value: // @ts-expect-error clear is defined in RequestCookies implementation but not in the type
|
||||
typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.bind(underlyingCookies) : // We should remove this and unify our cookies types. We could just let this continue to throw lazily
|
||||
// but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with
|
||||
// implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it
|
||||
// has extra properties not available on RequestCookie instances.
|
||||
polyfilledResponseCookiesClear.bind(underlyingCookies, promise)
|
||||
},
|
||||
toString: {
|
||||
value: underlyingCookies.toString.bind(underlyingCookies)
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
function makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, route) {
|
||||
const cachedCookies = CachedCookies.get(underlyingCookies);
|
||||
if (cachedCookies) {
|
||||
return cachedCookies;
|
||||
}
|
||||
const promise = new Promise((resolve)=>(0, _scheduler.scheduleImmediate)(()=>resolve(underlyingCookies)));
|
||||
CachedCookies.set(underlyingCookies, promise);
|
||||
Object.defineProperties(promise, {
|
||||
[Symbol.iterator]: {
|
||||
value: function() {
|
||||
const expression = '`...cookies()` or similar iteration';
|
||||
syncIODev(route, expression);
|
||||
return underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].apply(underlyingCookies, arguments) : // We should remove this and unify our cookies types. We could just let this continue to throw lazily
|
||||
// but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with
|
||||
// implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it
|
||||
// has extra properties not available on RequestCookie instances.
|
||||
polyfilledResponseCookiesIterator.call(underlyingCookies);
|
||||
},
|
||||
writable: false
|
||||
},
|
||||
size: {
|
||||
get () {
|
||||
const expression = '`cookies().size`';
|
||||
syncIODev(route, expression);
|
||||
return underlyingCookies.size;
|
||||
}
|
||||
},
|
||||
get: {
|
||||
value: function get() {
|
||||
let expression;
|
||||
if (arguments.length === 0) {
|
||||
expression = '`cookies().get()`';
|
||||
} else {
|
||||
expression = `\`cookies().get(${describeNameArg(arguments[0])})\``;
|
||||
}
|
||||
syncIODev(route, expression);
|
||||
return underlyingCookies.get.apply(underlyingCookies, arguments);
|
||||
},
|
||||
writable: false
|
||||
},
|
||||
getAll: {
|
||||
value: function getAll() {
|
||||
let expression;
|
||||
if (arguments.length === 0) {
|
||||
expression = '`cookies().getAll()`';
|
||||
} else {
|
||||
expression = `\`cookies().getAll(${describeNameArg(arguments[0])})\``;
|
||||
}
|
||||
syncIODev(route, expression);
|
||||
return underlyingCookies.getAll.apply(underlyingCookies, arguments);
|
||||
},
|
||||
writable: false
|
||||
},
|
||||
has: {
|
||||
value: function get() {
|
||||
let expression;
|
||||
if (arguments.length === 0) {
|
||||
expression = '`cookies().has()`';
|
||||
} else {
|
||||
expression = `\`cookies().has(${describeNameArg(arguments[0])})\``;
|
||||
}
|
||||
syncIODev(route, expression);
|
||||
return underlyingCookies.has.apply(underlyingCookies, arguments);
|
||||
},
|
||||
writable: false
|
||||
},
|
||||
set: {
|
||||
value: function set() {
|
||||
let expression;
|
||||
if (arguments.length === 0) {
|
||||
expression = '`cookies().set()`';
|
||||
} else {
|
||||
const arg = arguments[0];
|
||||
if (arg) {
|
||||
expression = `\`cookies().set(${describeNameArg(arg)}, ...)\``;
|
||||
} else {
|
||||
expression = '`cookies().set(...)`';
|
||||
}
|
||||
}
|
||||
syncIODev(route, expression);
|
||||
return underlyingCookies.set.apply(underlyingCookies, arguments);
|
||||
},
|
||||
writable: false
|
||||
},
|
||||
delete: {
|
||||
value: function() {
|
||||
let expression;
|
||||
if (arguments.length === 0) {
|
||||
expression = '`cookies().delete()`';
|
||||
} else if (arguments.length === 1) {
|
||||
expression = `\`cookies().delete(${describeNameArg(arguments[0])})\``;
|
||||
} else {
|
||||
expression = `\`cookies().delete(${describeNameArg(arguments[0])}, ...)\``;
|
||||
}
|
||||
syncIODev(route, expression);
|
||||
return underlyingCookies.delete.apply(underlyingCookies, arguments);
|
||||
},
|
||||
writable: false
|
||||
},
|
||||
clear: {
|
||||
value: function clear() {
|
||||
const expression = '`cookies().clear()`';
|
||||
syncIODev(route, expression);
|
||||
// @ts-ignore clear is defined in RequestCookies implementation but not in the type
|
||||
return typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.apply(underlyingCookies, arguments) : // We should remove this and unify our cookies types. We could just let this continue to throw lazily
|
||||
// but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with
|
||||
// implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it
|
||||
// has extra properties not available on RequestCookie instances.
|
||||
polyfilledResponseCookiesClear.call(underlyingCookies, promise);
|
||||
},
|
||||
writable: false
|
||||
},
|
||||
toString: {
|
||||
value: function toString() {
|
||||
const expression = '`cookies().toString()` or implicit casting';
|
||||
syncIODev(route, expression);
|
||||
return underlyingCookies.toString.apply(underlyingCookies, arguments);
|
||||
},
|
||||
writable: false
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
function describeNameArg(arg) {
|
||||
return typeof arg === 'object' && arg !== null && typeof arg.name === 'string' ? `'${arg.name}'` : typeof arg === 'string' ? `'${arg}'` : '...';
|
||||
}
|
||||
function syncIODev(route, expression) {
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workUnitStore && workUnitStore.type === 'request' && workUnitStore.prerenderPhase === true) {
|
||||
// When we're rendering dynamically in dev we need to advance out of the
|
||||
// Prerender environment when we read Request data synchronously
|
||||
const requestStore = workUnitStore;
|
||||
(0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(requestStore);
|
||||
}
|
||||
// In all cases we warn normally
|
||||
warnForSyncAccess(route, expression);
|
||||
}
|
||||
const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createCookiesAccessError);
|
||||
function createCookiesAccessError(route, expression) {
|
||||
const prefix = route ? `Route "${route}" ` : 'This route ';
|
||||
return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`cookies()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", {
|
||||
value: "E223",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function polyfilledResponseCookiesIterator() {
|
||||
return this.getAll().map((c)=>[
|
||||
c.name,
|
||||
c
|
||||
]).values();
|
||||
}
|
||||
function polyfilledResponseCookiesClear(returnable) {
|
||||
for (const cookie of this.getAll()){
|
||||
this.delete(cookie.name);
|
||||
}
|
||||
return returnable;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=cookies.js.map
|
||||
1
frontend/webapp/node_modules/next/dist/server/request/cookies.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/next/dist/server/request/cookies.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
31
frontend/webapp/node_modules/next/dist/server/request/draft-mode.d.ts
generated
vendored
Normal file
31
frontend/webapp/node_modules/next/dist/server/request/draft-mode.d.ts
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { DraftModeProvider } from '../async-storage/draft-mode-provider';
|
||||
/**
|
||||
* In this version of Next.js `draftMode()` returns a Promise however you can still reference the properties of the underlying draftMode object
|
||||
* synchronously to facilitate migration. The `UnsafeUnwrappedDraftMode` type is added to your code by a codemod that attempts to automatically
|
||||
* updates callsites to reflect the new Promise return type. There are some cases where `draftMode()` cannot be automatically converted, namely
|
||||
* when it is used inside a synchronous function and we can't be sure the function can be made async automatically. In these cases we add an
|
||||
* explicit type case to `UnsafeUnwrappedDraftMode` to enable typescript to allow for the synchronous usage only where it is actually necessary.
|
||||
*
|
||||
* You should should update these callsites to either be async functions where the `draftMode()` value can be awaited or you should call `draftMode()`
|
||||
* from outside and await the return value before passing it into this function.
|
||||
*
|
||||
* You can find instances that require manual migration by searching for `UnsafeUnwrappedDraftMode` in your codebase or by search for a comment that
|
||||
* starts with `@next-codemod-error`.
|
||||
*
|
||||
* In a future version of Next.js `draftMode()` will only return a Promise and you will not be able to access the underlying draftMode object directly
|
||||
* without awaiting the return value first. When this change happens the type `UnsafeUnwrappedDraftMode` will be updated to reflect that is it no longer
|
||||
* usable.
|
||||
*
|
||||
* This type is marked deprecated to help identify it as target for refactoring away.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
export type UnsafeUnwrappedDraftMode = DraftMode;
|
||||
export declare function draftMode(): Promise<DraftMode>;
|
||||
declare class DraftMode {
|
||||
constructor(provider: null | DraftModeProvider);
|
||||
get isEnabled(): boolean;
|
||||
enable(): void;
|
||||
disable(): void;
|
||||
}
|
||||
export {};
|
||||
234
frontend/webapp/node_modules/next/dist/server/request/draft-mode.js
generated
vendored
Normal file
234
frontend/webapp/node_modules/next/dist/server/request/draft-mode.js
generated
vendored
Normal file
@@ -0,0 +1,234 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "draftMode", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return draftMode;
|
||||
}
|
||||
});
|
||||
const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external");
|
||||
const _workasyncstorageexternal = require("../app-render/work-async-storage.external");
|
||||
const _dynamicrendering = require("../app-render/dynamic-rendering");
|
||||
const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger");
|
||||
const _staticgenerationbailout = require("../../client/components/static-generation-bailout");
|
||||
const _hooksservercontext = require("../../client/components/hooks-server-context");
|
||||
function draftMode() {
|
||||
const callingExpression = 'draftMode';
|
||||
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (!workStore || !workUnitStore) {
|
||||
(0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression);
|
||||
}
|
||||
switch(workUnitStore.type){
|
||||
case 'request':
|
||||
return createOrGetCachedExoticDraftMode(workUnitStore.draftMode, workStore);
|
||||
case 'cache':
|
||||
case 'unstable-cache':
|
||||
// Inside of `"use cache"` or `unstable_cache`, draft mode is available if
|
||||
// the outmost work unit store is a request store, and if draft mode is
|
||||
// enabled.
|
||||
const draftModeProvider = (0, _workunitasyncstorageexternal.getDraftModeProviderForCacheScope)(workStore, workUnitStore);
|
||||
if (draftModeProvider) {
|
||||
return createOrGetCachedExoticDraftMode(draftModeProvider, workStore);
|
||||
}
|
||||
// Otherwise, we fall through to providing an empty draft mode.
|
||||
// eslint-disable-next-line no-fallthrough
|
||||
case 'prerender':
|
||||
case 'prerender-ppr':
|
||||
case 'prerender-legacy':
|
||||
// Return empty draft mode
|
||||
if (process.env.NODE_ENV === 'development' && !(workStore == null ? void 0 : workStore.isPrefetchRequest)) {
|
||||
const route = workStore == null ? void 0 : workStore.route;
|
||||
return createExoticDraftModeWithDevWarnings(null, route);
|
||||
} else {
|
||||
return createExoticDraftMode(null);
|
||||
}
|
||||
default:
|
||||
const _exhaustiveCheck = workUnitStore;
|
||||
return _exhaustiveCheck;
|
||||
}
|
||||
}
|
||||
function createOrGetCachedExoticDraftMode(draftModeProvider, workStore) {
|
||||
const cachedDraftMode = CachedDraftModes.get(draftMode);
|
||||
if (cachedDraftMode) {
|
||||
return cachedDraftMode;
|
||||
}
|
||||
let promise;
|
||||
if (process.env.NODE_ENV === 'development' && !(workStore == null ? void 0 : workStore.isPrefetchRequest)) {
|
||||
const route = workStore == null ? void 0 : workStore.route;
|
||||
promise = createExoticDraftModeWithDevWarnings(draftModeProvider, route);
|
||||
} else {
|
||||
promise = createExoticDraftMode(draftModeProvider);
|
||||
}
|
||||
CachedDraftModes.set(draftModeProvider, promise);
|
||||
return promise;
|
||||
}
|
||||
const CachedDraftModes = new WeakMap();
|
||||
function createExoticDraftMode(underlyingProvider) {
|
||||
const instance = new DraftMode(underlyingProvider);
|
||||
const promise = Promise.resolve(instance);
|
||||
Object.defineProperty(promise, 'isEnabled', {
|
||||
get () {
|
||||
return instance.isEnabled;
|
||||
},
|
||||
set (newValue) {
|
||||
Object.defineProperty(promise, 'isEnabled', {
|
||||
value: newValue,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
});
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
promise.enable = instance.enable.bind(instance);
|
||||
promise.disable = instance.disable.bind(instance);
|
||||
return promise;
|
||||
}
|
||||
function createExoticDraftModeWithDevWarnings(underlyingProvider, route) {
|
||||
const instance = new DraftMode(underlyingProvider);
|
||||
const promise = Promise.resolve(instance);
|
||||
Object.defineProperty(promise, 'isEnabled', {
|
||||
get () {
|
||||
const expression = '`draftMode().isEnabled`';
|
||||
syncIODev(route, expression);
|
||||
return instance.isEnabled;
|
||||
},
|
||||
set (newValue) {
|
||||
Object.defineProperty(promise, 'isEnabled', {
|
||||
value: newValue,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
});
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(promise, 'enable', {
|
||||
value: function get() {
|
||||
const expression = '`draftMode().enable()`';
|
||||
syncIODev(route, expression);
|
||||
return instance.enable.apply(instance, arguments);
|
||||
}
|
||||
});
|
||||
Object.defineProperty(promise, 'disable', {
|
||||
value: function get() {
|
||||
const expression = '`draftMode().disable()`';
|
||||
syncIODev(route, expression);
|
||||
return instance.disable.apply(instance, arguments);
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
class DraftMode {
|
||||
constructor(provider){
|
||||
this._provider = provider;
|
||||
}
|
||||
get isEnabled() {
|
||||
if (this._provider !== null) {
|
||||
return this._provider.isEnabled;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
enable() {
|
||||
// We have a store we want to track dynamic data access to ensure we
|
||||
// don't statically generate routes that manipulate draft mode.
|
||||
trackDynamicDraftMode('draftMode().enable()');
|
||||
if (this._provider !== null) {
|
||||
this._provider.enable();
|
||||
}
|
||||
}
|
||||
disable() {
|
||||
trackDynamicDraftMode('draftMode().disable()');
|
||||
if (this._provider !== null) {
|
||||
this._provider.disable();
|
||||
}
|
||||
}
|
||||
}
|
||||
function syncIODev(route, expression) {
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workUnitStore && workUnitStore.type === 'request' && workUnitStore.prerenderPhase === true) {
|
||||
// When we're rendering dynamically in dev we need to advance out of the
|
||||
// Prerender environment when we read Request data synchronously
|
||||
const requestStore = workUnitStore;
|
||||
(0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(requestStore);
|
||||
}
|
||||
// In all cases we warn normally
|
||||
warnForSyncAccess(route, expression);
|
||||
}
|
||||
const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createDraftModeAccessError);
|
||||
function createDraftModeAccessError(route, expression) {
|
||||
const prefix = route ? `Route "${route}" ` : 'This route ';
|
||||
return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`draftMode()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", {
|
||||
value: "E377",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function trackDynamicDraftMode(expression) {
|
||||
const store = _workasyncstorageexternal.workAsyncStorage.getStore();
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (store) {
|
||||
// We have a store we want to track dynamic data access to ensure we
|
||||
// don't statically generate routes that manipulate draft mode.
|
||||
if (workUnitStore) {
|
||||
if (workUnitStore.type === 'cache') {
|
||||
throw Object.defineProperty(new Error(`Route ${store.route} used "${expression}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
||||
value: "E246",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
} else if (workUnitStore.type === 'unstable-cache') {
|
||||
throw Object.defineProperty(new Error(`Route ${store.route} used "${expression}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", {
|
||||
value: "E259",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
} else if (workUnitStore.phase === 'after') {
|
||||
throw Object.defineProperty(new Error(`Route ${store.route} used "${expression}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", {
|
||||
value: "E348",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
if (store.dynamicShouldError) {
|
||||
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${store.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
|
||||
value: "E553",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
if (workUnitStore) {
|
||||
if (workUnitStore.type === 'prerender') {
|
||||
// dynamicIO Prerender
|
||||
const error = Object.defineProperty(new Error(`Route ${store.route} used ${expression} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`), "__NEXT_ERROR_CODE", {
|
||||
value: "E126",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(store.route, expression, error, workUnitStore);
|
||||
} else if (workUnitStore.type === 'prerender-ppr') {
|
||||
// PPR Prerender
|
||||
(0, _dynamicrendering.postponeWithTracking)(store.route, expression, workUnitStore.dynamicTracking);
|
||||
} else if (workUnitStore.type === 'prerender-legacy') {
|
||||
// legacy Prerender
|
||||
workUnitStore.revalidate = 0;
|
||||
const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${store.route} couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", {
|
||||
value: "E558",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
store.dynamicUsageDescription = expression;
|
||||
store.dynamicUsageStack = err.stack;
|
||||
throw err;
|
||||
} else if (process.env.NODE_ENV === 'development' && workUnitStore && workUnitStore.type === 'request') {
|
||||
workUnitStore.usedDynamic = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=draft-mode.js.map
|
||||
1
frontend/webapp/node_modules/next/dist/server/request/draft-mode.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/next/dist/server/request/draft-mode.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
frontend/webapp/node_modules/next/dist/server/request/fallback-params.d.ts
generated
vendored
Normal file
3
frontend/webapp/node_modules/next/dist/server/request/fallback-params.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export type FallbackRouteParams = ReadonlyMap<string, string>;
|
||||
export declare function getParamKeys(page: string): string[];
|
||||
export declare function getFallbackRouteParams(pageOrKeys: string | readonly string[]): FallbackRouteParams | null;
|
||||
51
frontend/webapp/node_modules/next/dist/server/request/fallback-params.js
generated
vendored
Normal file
51
frontend/webapp/node_modules/next/dist/server/request/fallback-params.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
getFallbackRouteParams: null,
|
||||
getParamKeys: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
getFallbackRouteParams: function() {
|
||||
return getFallbackRouteParams;
|
||||
},
|
||||
getParamKeys: function() {
|
||||
return getParamKeys;
|
||||
}
|
||||
});
|
||||
const _routematcher = require("../../shared/lib/router/utils/route-matcher");
|
||||
const _routeregex = require("../../shared/lib/router/utils/route-regex");
|
||||
function getParamKeys(page) {
|
||||
const pattern = (0, _routeregex.getRouteRegex)(page);
|
||||
const matcher = (0, _routematcher.getRouteMatcher)(pattern);
|
||||
// Get the default list of allowed params.
|
||||
return Object.keys(matcher(page));
|
||||
}
|
||||
function getFallbackRouteParams(pageOrKeys) {
|
||||
let keys;
|
||||
if (typeof pageOrKeys === 'string') {
|
||||
keys = getParamKeys(pageOrKeys);
|
||||
} else {
|
||||
keys = pageOrKeys;
|
||||
}
|
||||
// If there are no keys, we can return early.
|
||||
if (keys.length === 0) return null;
|
||||
const params = new Map();
|
||||
// As we're creating unique keys for each of the dynamic route params, we only
|
||||
// need to generate a unique ID once per request because each of the keys will
|
||||
// be also be unique.
|
||||
const uniqueID = Math.random().toString(16).slice(2);
|
||||
for (const key of keys){
|
||||
params.set(key, `%%drp:${key}:${uniqueID}%%`);
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=fallback-params.js.map
|
||||
1
frontend/webapp/node_modules/next/dist/server/request/fallback-params.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/next/dist/server/request/fallback-params.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/server/request/fallback-params.ts"],"sourcesContent":["import { getRouteMatcher } from '../../shared/lib/router/utils/route-matcher'\nimport { getRouteRegex } from '../../shared/lib/router/utils/route-regex'\n\nexport type FallbackRouteParams = ReadonlyMap<string, string>\n\nexport function getParamKeys(page: string) {\n const pattern = getRouteRegex(page)\n const matcher = getRouteMatcher(pattern)\n\n // Get the default list of allowed params.\n return Object.keys(matcher(page))\n}\n\nexport function getFallbackRouteParams(\n pageOrKeys: string | readonly string[]\n): FallbackRouteParams | null {\n let keys: readonly string[]\n if (typeof pageOrKeys === 'string') {\n keys = getParamKeys(pageOrKeys)\n } else {\n keys = pageOrKeys\n }\n\n // If there are no keys, we can return early.\n if (keys.length === 0) return null\n\n const params = new Map<string, string>()\n\n // As we're creating unique keys for each of the dynamic route params, we only\n // need to generate a unique ID once per request because each of the keys will\n // be also be unique.\n const uniqueID = Math.random().toString(16).slice(2)\n\n for (const key of keys) {\n params.set(key, `%%drp:${key}:${uniqueID}%%`)\n }\n\n return params\n}\n"],"names":["getFallbackRouteParams","getParamKeys","page","pattern","getRouteRegex","matcher","getRouteMatcher","Object","keys","pageOrKeys","length","params","Map","uniqueID","Math","random","toString","slice","key","set"],"mappings":";;;;;;;;;;;;;;;IAagBA,sBAAsB;eAAtBA;;IARAC,YAAY;eAAZA;;;8BALgB;4BACF;AAIvB,SAASA,aAAaC,IAAY;IACvC,MAAMC,UAAUC,IAAAA,yBAAa,EAACF;IAC9B,MAAMG,UAAUC,IAAAA,6BAAe,EAACH;IAEhC,0CAA0C;IAC1C,OAAOI,OAAOC,IAAI,CAACH,QAAQH;AAC7B;AAEO,SAASF,uBACdS,UAAsC;IAEtC,IAAID;IACJ,IAAI,OAAOC,eAAe,UAAU;QAClCD,OAAOP,aAAaQ;IACtB,OAAO;QACLD,OAAOC;IACT;IAEA,6CAA6C;IAC7C,IAAID,KAAKE,MAAM,KAAK,GAAG,OAAO;IAE9B,MAAMC,SAAS,IAAIC;IAEnB,8EAA8E;IAC9E,8EAA8E;IAC9E,qBAAqB;IACrB,MAAMC,WAAWC,KAAKC,MAAM,GAAGC,QAAQ,CAAC,IAAIC,KAAK,CAAC;IAElD,KAAK,MAAMC,OAAOV,KAAM;QACtBG,OAAOQ,GAAG,CAACD,KAAK,CAAC,MAAM,EAAEA,IAAI,CAAC,EAAEL,SAAS,EAAE,CAAC;IAC9C;IAEA,OAAOF;AACT"}
|
||||
33
frontend/webapp/node_modules/next/dist/server/request/headers.d.ts
generated
vendored
Normal file
33
frontend/webapp/node_modules/next/dist/server/request/headers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import { type ReadonlyHeaders } from '../web/spec-extension/adapters/headers';
|
||||
/**
|
||||
* In this version of Next.js `headers()` returns a Promise however you can still reference the properties of the underlying Headers instance
|
||||
* synchronously to facilitate migration. The `UnsafeUnwrappedHeaders` type is added to your code by a codemod that attempts to automatically
|
||||
* updates callsites to reflect the new Promise return type. There are some cases where `headers()` cannot be automatically converted, namely
|
||||
* when it is used inside a synchronous function and we can't be sure the function can be made async automatically. In these cases we add an
|
||||
* explicit type case to `UnsafeUnwrappedHeaders` to enable typescript to allow for the synchronous usage only where it is actually necessary.
|
||||
*
|
||||
* You should should update these callsites to either be async functions where the `headers()` value can be awaited or you should call `headers()`
|
||||
* from outside and await the return value before passing it into this function.
|
||||
*
|
||||
* You can find instances that require manual migration by searching for `UnsafeUnwrappedHeaders` in your codebase or by search for a comment that
|
||||
* starts with `@next-codemod-error`.
|
||||
*
|
||||
* In a future version of Next.js `headers()` will only return a Promise and you will not be able to access the underlying Headers instance
|
||||
* without awaiting the return value first. When this change happens the type `UnsafeUnwrappedHeaders` will be updated to reflect that is it no longer
|
||||
* usable.
|
||||
*
|
||||
* This type is marked deprecated to help identify it as target for refactoring away.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
export type UnsafeUnwrappedHeaders = ReadonlyHeaders;
|
||||
/**
|
||||
* This function allows you to read the HTTP incoming request headers in
|
||||
* [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),
|
||||
* [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations),
|
||||
* [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers) and
|
||||
* [Middleware](https://nextjs.org/docs/app/building-your-application/routing/middleware).
|
||||
*
|
||||
* Read more: [Next.js Docs: `headers`](https://nextjs.org/docs/app/api-reference/functions/headers)
|
||||
*/
|
||||
export declare function headers(): Promise<ReadonlyHeaders>;
|
||||
335
frontend/webapp/node_modules/next/dist/server/request/headers.js
generated
vendored
Normal file
335
frontend/webapp/node_modules/next/dist/server/request/headers.js
generated
vendored
Normal file
@@ -0,0 +1,335 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "headers", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return headers;
|
||||
}
|
||||
});
|
||||
const _headers = require("../web/spec-extension/adapters/headers");
|
||||
const _workasyncstorageexternal = require("../app-render/work-async-storage.external");
|
||||
const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external");
|
||||
const _dynamicrendering = require("../app-render/dynamic-rendering");
|
||||
const _staticgenerationbailout = require("../../client/components/static-generation-bailout");
|
||||
const _dynamicrenderingutils = require("../dynamic-rendering-utils");
|
||||
const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger");
|
||||
const _scheduler = require("../../lib/scheduler");
|
||||
const _utils = require("./utils");
|
||||
function headers() {
|
||||
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workStore) {
|
||||
if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) {
|
||||
throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", {
|
||||
value: "E367",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
if (workStore.forceStatic) {
|
||||
// When using forceStatic we override all other logic and always just return an empty
|
||||
// headers object without tracking
|
||||
const underlyingHeaders = _headers.HeadersAdapter.seal(new Headers({}));
|
||||
return makeUntrackedExoticHeaders(underlyingHeaders);
|
||||
}
|
||||
if (workUnitStore) {
|
||||
if (workUnitStore.type === 'cache') {
|
||||
throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
||||
value: "E304",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
} else if (workUnitStore.type === 'unstable-cache') {
|
||||
throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", {
|
||||
value: "E127",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
if (workStore.dynamicShouldError) {
|
||||
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
|
||||
value: "E525",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
if (workUnitStore) {
|
||||
if (workUnitStore.type === 'prerender') {
|
||||
// dynamicIO Prerender
|
||||
// We don't track dynamic access here because access will be tracked when you access
|
||||
// one of the properties of the headers object.
|
||||
return makeDynamicallyTrackedExoticHeaders(workStore.route, workUnitStore);
|
||||
} else if (workUnitStore.type === 'prerender-ppr') {
|
||||
// PPR Prerender (no dynamicIO)
|
||||
// We are prerendering with PPR. We need track dynamic access here eagerly
|
||||
// to keep continuity with how headers has worked in PPR without dynamicIO.
|
||||
// TODO consider switching the semantic to throw on property access instead
|
||||
(0, _dynamicrendering.postponeWithTracking)(workStore.route, 'headers', workUnitStore.dynamicTracking);
|
||||
} else if (workUnitStore.type === 'prerender-legacy') {
|
||||
// Legacy Prerender
|
||||
// We are in a legacy static generation mode while prerendering
|
||||
// We track dynamic access here so we don't need to wrap the headers in
|
||||
// individual property access tracking.
|
||||
(0, _dynamicrendering.throwToInterruptStaticGeneration)('headers', workStore, workUnitStore);
|
||||
}
|
||||
}
|
||||
// We fall through to the dynamic context below but we still track dynamic access
|
||||
// because in dev we can still error for things like using headers inside a cache context
|
||||
(0, _dynamicrendering.trackDynamicDataInDynamicRender)(workStore, workUnitStore);
|
||||
}
|
||||
const requestStore = (0, _workunitasyncstorageexternal.getExpectedRequestStore)('headers');
|
||||
if (process.env.NODE_ENV === 'development' && !(workStore == null ? void 0 : workStore.isPrefetchRequest)) {
|
||||
return makeUntrackedExoticHeadersWithDevWarnings(requestStore.headers, workStore == null ? void 0 : workStore.route);
|
||||
} else {
|
||||
return makeUntrackedExoticHeaders(requestStore.headers);
|
||||
}
|
||||
}
|
||||
const CachedHeaders = new WeakMap();
|
||||
function makeDynamicallyTrackedExoticHeaders(route, prerenderStore) {
|
||||
const cachedHeaders = CachedHeaders.get(prerenderStore);
|
||||
if (cachedHeaders) {
|
||||
return cachedHeaders;
|
||||
}
|
||||
const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`headers()`');
|
||||
CachedHeaders.set(prerenderStore, promise);
|
||||
Object.defineProperties(promise, {
|
||||
append: {
|
||||
value: function append() {
|
||||
const expression = `\`headers().append(${describeNameArg(arguments[0])}, ...)\``;
|
||||
const error = createHeadersAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
delete: {
|
||||
value: function _delete() {
|
||||
const expression = `\`headers().delete(${describeNameArg(arguments[0])})\``;
|
||||
const error = createHeadersAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
get: {
|
||||
value: function get() {
|
||||
const expression = `\`headers().get(${describeNameArg(arguments[0])})\``;
|
||||
const error = createHeadersAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
has: {
|
||||
value: function has() {
|
||||
const expression = `\`headers().has(${describeNameArg(arguments[0])})\``;
|
||||
const error = createHeadersAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
set: {
|
||||
value: function set() {
|
||||
const expression = `\`headers().set(${describeNameArg(arguments[0])}, ...)\``;
|
||||
const error = createHeadersAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
getSetCookie: {
|
||||
value: function getSetCookie() {
|
||||
const expression = '`headers().getSetCookie()`';
|
||||
const error = createHeadersAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
forEach: {
|
||||
value: function forEach() {
|
||||
const expression = '`headers().forEach(...)`';
|
||||
const error = createHeadersAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
keys: {
|
||||
value: function keys() {
|
||||
const expression = '`headers().keys()`';
|
||||
const error = createHeadersAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
values: {
|
||||
value: function values() {
|
||||
const expression = '`headers().values()`';
|
||||
const error = createHeadersAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
entries: {
|
||||
value: function entries() {
|
||||
const expression = '`headers().entries()`';
|
||||
const error = createHeadersAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
},
|
||||
[Symbol.iterator]: {
|
||||
value: function() {
|
||||
const expression = '`headers()[Symbol.iterator]()`';
|
||||
const error = createHeadersAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
function makeUntrackedExoticHeaders(underlyingHeaders) {
|
||||
const cachedHeaders = CachedHeaders.get(underlyingHeaders);
|
||||
if (cachedHeaders) {
|
||||
return cachedHeaders;
|
||||
}
|
||||
const promise = Promise.resolve(underlyingHeaders);
|
||||
CachedHeaders.set(underlyingHeaders, promise);
|
||||
Object.defineProperties(promise, {
|
||||
append: {
|
||||
value: underlyingHeaders.append.bind(underlyingHeaders)
|
||||
},
|
||||
delete: {
|
||||
value: underlyingHeaders.delete.bind(underlyingHeaders)
|
||||
},
|
||||
get: {
|
||||
value: underlyingHeaders.get.bind(underlyingHeaders)
|
||||
},
|
||||
has: {
|
||||
value: underlyingHeaders.has.bind(underlyingHeaders)
|
||||
},
|
||||
set: {
|
||||
value: underlyingHeaders.set.bind(underlyingHeaders)
|
||||
},
|
||||
getSetCookie: {
|
||||
value: underlyingHeaders.getSetCookie.bind(underlyingHeaders)
|
||||
},
|
||||
forEach: {
|
||||
value: underlyingHeaders.forEach.bind(underlyingHeaders)
|
||||
},
|
||||
keys: {
|
||||
value: underlyingHeaders.keys.bind(underlyingHeaders)
|
||||
},
|
||||
values: {
|
||||
value: underlyingHeaders.values.bind(underlyingHeaders)
|
||||
},
|
||||
entries: {
|
||||
value: underlyingHeaders.entries.bind(underlyingHeaders)
|
||||
},
|
||||
[Symbol.iterator]: {
|
||||
value: underlyingHeaders[Symbol.iterator].bind(underlyingHeaders)
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
function makeUntrackedExoticHeadersWithDevWarnings(underlyingHeaders, route) {
|
||||
const cachedHeaders = CachedHeaders.get(underlyingHeaders);
|
||||
if (cachedHeaders) {
|
||||
return cachedHeaders;
|
||||
}
|
||||
const promise = new Promise((resolve)=>(0, _scheduler.scheduleImmediate)(()=>resolve(underlyingHeaders)));
|
||||
CachedHeaders.set(underlyingHeaders, promise);
|
||||
Object.defineProperties(promise, {
|
||||
append: {
|
||||
value: function append() {
|
||||
const expression = `\`headers().append(${describeNameArg(arguments[0])}, ...)\``;
|
||||
syncIODev(route, expression);
|
||||
return underlyingHeaders.append.apply(underlyingHeaders, arguments);
|
||||
}
|
||||
},
|
||||
delete: {
|
||||
value: function _delete() {
|
||||
const expression = `\`headers().delete(${describeNameArg(arguments[0])})\``;
|
||||
syncIODev(route, expression);
|
||||
return underlyingHeaders.delete.apply(underlyingHeaders, arguments);
|
||||
}
|
||||
},
|
||||
get: {
|
||||
value: function get() {
|
||||
const expression = `\`headers().get(${describeNameArg(arguments[0])})\``;
|
||||
syncIODev(route, expression);
|
||||
return underlyingHeaders.get.apply(underlyingHeaders, arguments);
|
||||
}
|
||||
},
|
||||
has: {
|
||||
value: function has() {
|
||||
const expression = `\`headers().has(${describeNameArg(arguments[0])})\``;
|
||||
syncIODev(route, expression);
|
||||
return underlyingHeaders.has.apply(underlyingHeaders, arguments);
|
||||
}
|
||||
},
|
||||
set: {
|
||||
value: function set() {
|
||||
const expression = `\`headers().set(${describeNameArg(arguments[0])}, ...)\``;
|
||||
syncIODev(route, expression);
|
||||
return underlyingHeaders.set.apply(underlyingHeaders, arguments);
|
||||
}
|
||||
},
|
||||
getSetCookie: {
|
||||
value: function getSetCookie() {
|
||||
const expression = '`headers().getSetCookie()`';
|
||||
syncIODev(route, expression);
|
||||
return underlyingHeaders.getSetCookie.apply(underlyingHeaders, arguments);
|
||||
}
|
||||
},
|
||||
forEach: {
|
||||
value: function forEach() {
|
||||
const expression = '`headers().forEach(...)`';
|
||||
syncIODev(route, expression);
|
||||
return underlyingHeaders.forEach.apply(underlyingHeaders, arguments);
|
||||
}
|
||||
},
|
||||
keys: {
|
||||
value: function keys() {
|
||||
const expression = '`headers().keys()`';
|
||||
syncIODev(route, expression);
|
||||
return underlyingHeaders.keys.apply(underlyingHeaders, arguments);
|
||||
}
|
||||
},
|
||||
values: {
|
||||
value: function values() {
|
||||
const expression = '`headers().values()`';
|
||||
syncIODev(route, expression);
|
||||
return underlyingHeaders.values.apply(underlyingHeaders, arguments);
|
||||
}
|
||||
},
|
||||
entries: {
|
||||
value: function entries() {
|
||||
const expression = '`headers().entries()`';
|
||||
syncIODev(route, expression);
|
||||
return underlyingHeaders.entries.apply(underlyingHeaders, arguments);
|
||||
}
|
||||
},
|
||||
[Symbol.iterator]: {
|
||||
value: function() {
|
||||
const expression = '`...headers()` or similar iteration';
|
||||
syncIODev(route, expression);
|
||||
return underlyingHeaders[Symbol.iterator].apply(underlyingHeaders, arguments);
|
||||
}
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
function describeNameArg(arg) {
|
||||
return typeof arg === 'string' ? `'${arg}'` : '...';
|
||||
}
|
||||
function syncIODev(route, expression) {
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workUnitStore && workUnitStore.type === 'request' && workUnitStore.prerenderPhase === true) {
|
||||
// When we're rendering dynamically in dev we need to advance out of the
|
||||
// Prerender environment when we read Request data synchronously
|
||||
const requestStore = workUnitStore;
|
||||
(0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(requestStore);
|
||||
}
|
||||
// In all cases we warn normally
|
||||
warnForSyncAccess(route, expression);
|
||||
}
|
||||
const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createHeadersAccessError);
|
||||
function createHeadersAccessError(route, expression) {
|
||||
const prefix = route ? `Route "${route}" ` : 'This route ';
|
||||
return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`headers()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", {
|
||||
value: "E277",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=headers.js.map
|
||||
1
frontend/webapp/node_modules/next/dist/server/request/headers.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/next/dist/server/request/headers.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
35
frontend/webapp/node_modules/next/dist/server/request/params.d.ts
generated
vendored
Normal file
35
frontend/webapp/node_modules/next/dist/server/request/params.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { WorkStore } from '../app-render/work-async-storage.external';
|
||||
export type ParamValue = string | Array<string> | undefined;
|
||||
export type Params = Record<string, ParamValue>;
|
||||
/**
|
||||
* In this version of Next.js the `params` prop passed to Layouts, Pages, and other Segments is a Promise.
|
||||
* However to facilitate migration to this new Promise type you can currently still access params directly on the Promise instance passed to these Segments.
|
||||
* The `UnsafeUnwrappedParams` type is available if you need to temporarily access the underlying params without first awaiting or `use`ing the Promise.
|
||||
*
|
||||
* In a future version of Next.js the `params` prop will be a plain Promise and this type will be removed.
|
||||
*
|
||||
* Typically instances of `params` can be updated automatically to be treated as a Promise by a codemod published alongside this Next.js version however if you
|
||||
* have not yet run the codemod of the codemod cannot detect certain instances of `params` usage you should first try to refactor your code to await `params`.
|
||||
*
|
||||
* If refactoring is not possible but you still want to be able to access params directly without typescript errors you can cast the params Promise to this type
|
||||
*
|
||||
* ```tsx
|
||||
* type Props = { params: Promise<{ id: string }>}
|
||||
*
|
||||
* export default async function Layout(props: Props) {
|
||||
* const directParams = (props.params as unknown as UnsafeUnwrappedParams<typeof props.params>)
|
||||
* return ...
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* This type is marked deprecated to help identify it as target for refactoring away.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
export type UnsafeUnwrappedParams<P> = P extends Promise<infer U> ? Omit<U, 'then' | 'status' | 'value'> : never;
|
||||
export declare function createParamsFromClient(underlyingParams: Params, workStore: WorkStore): Promise<Params>;
|
||||
export type CreateServerParamsForMetadata = typeof createServerParamsForMetadata;
|
||||
export declare const createServerParamsForMetadata: typeof createServerParamsForServerSegment;
|
||||
export declare function createServerParamsForRoute(underlyingParams: Params, workStore: WorkStore): Promise<Params>;
|
||||
export declare function createServerParamsForServerSegment(underlyingParams: Params, workStore: WorkStore): Promise<Params>;
|
||||
export declare function createPrerenderParamsForClientSegment(underlyingParams: Params, workStore: WorkStore): Promise<Params>;
|
||||
367
frontend/webapp/node_modules/next/dist/server/request/params.js
generated
vendored
Normal file
367
frontend/webapp/node_modules/next/dist/server/request/params.js
generated
vendored
Normal file
@@ -0,0 +1,367 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
createParamsFromClient: null,
|
||||
createPrerenderParamsForClientSegment: null,
|
||||
createServerParamsForMetadata: null,
|
||||
createServerParamsForRoute: null,
|
||||
createServerParamsForServerSegment: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
createParamsFromClient: function() {
|
||||
return createParamsFromClient;
|
||||
},
|
||||
createPrerenderParamsForClientSegment: function() {
|
||||
return createPrerenderParamsForClientSegment;
|
||||
},
|
||||
createServerParamsForMetadata: function() {
|
||||
return createServerParamsForMetadata;
|
||||
},
|
||||
createServerParamsForRoute: function() {
|
||||
return createServerParamsForRoute;
|
||||
},
|
||||
createServerParamsForServerSegment: function() {
|
||||
return createServerParamsForServerSegment;
|
||||
}
|
||||
});
|
||||
const _reflect = require("../web/spec-extension/adapters/reflect");
|
||||
const _dynamicrendering = require("../app-render/dynamic-rendering");
|
||||
const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external");
|
||||
const _invarianterror = require("../../shared/lib/invariant-error");
|
||||
const _reflectutils = require("../../shared/lib/utils/reflect-utils");
|
||||
const _dynamicrenderingutils = require("../dynamic-rendering-utils");
|
||||
const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger");
|
||||
const _scheduler = require("../../lib/scheduler");
|
||||
function createParamsFromClient(underlyingParams, workStore) {
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workUnitStore) {
|
||||
switch(workUnitStore.type){
|
||||
case 'prerender':
|
||||
case 'prerender-ppr':
|
||||
case 'prerender-legacy':
|
||||
return createPrerenderParams(underlyingParams, workStore, workUnitStore);
|
||||
default:
|
||||
}
|
||||
}
|
||||
return createRenderParams(underlyingParams, workStore);
|
||||
}
|
||||
const createServerParamsForMetadata = createServerParamsForServerSegment;
|
||||
function createServerParamsForRoute(underlyingParams, workStore) {
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workUnitStore) {
|
||||
switch(workUnitStore.type){
|
||||
case 'prerender':
|
||||
case 'prerender-ppr':
|
||||
case 'prerender-legacy':
|
||||
return createPrerenderParams(underlyingParams, workStore, workUnitStore);
|
||||
default:
|
||||
}
|
||||
}
|
||||
return createRenderParams(underlyingParams, workStore);
|
||||
}
|
||||
function createServerParamsForServerSegment(underlyingParams, workStore) {
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workUnitStore) {
|
||||
switch(workUnitStore.type){
|
||||
case 'prerender':
|
||||
case 'prerender-ppr':
|
||||
case 'prerender-legacy':
|
||||
return createPrerenderParams(underlyingParams, workStore, workUnitStore);
|
||||
default:
|
||||
}
|
||||
}
|
||||
return createRenderParams(underlyingParams, workStore);
|
||||
}
|
||||
function createPrerenderParamsForClientSegment(underlyingParams, workStore) {
|
||||
const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (prerenderStore && prerenderStore.type === 'prerender') {
|
||||
const fallbackParams = workStore.fallbackRouteParams;
|
||||
if (fallbackParams) {
|
||||
for(let key in underlyingParams){
|
||||
if (fallbackParams.has(key)) {
|
||||
// This params object has one of more fallback params so we need to consider
|
||||
// the awaiting of this params object "dynamic". Since we are in dynamicIO mode
|
||||
// we encode this as a promise that never resolves
|
||||
return (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`params`');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// We're prerendering in a mode that does not abort. We resolve the promise without
|
||||
// any tracking because we're just transporting a value from server to client where the tracking
|
||||
// will be applied.
|
||||
return Promise.resolve(underlyingParams);
|
||||
}
|
||||
function createPrerenderParams(underlyingParams, workStore, prerenderStore) {
|
||||
const fallbackParams = workStore.fallbackRouteParams;
|
||||
if (fallbackParams) {
|
||||
let hasSomeFallbackParams = false;
|
||||
for(const key in underlyingParams){
|
||||
if (fallbackParams.has(key)) {
|
||||
hasSomeFallbackParams = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hasSomeFallbackParams) {
|
||||
// params need to be treated as dynamic because we have at least one fallback param
|
||||
if (prerenderStore.type === 'prerender') {
|
||||
// We are in a dynamicIO (PPR or otherwise) prerender
|
||||
return makeAbortingExoticParams(underlyingParams, workStore.route, prerenderStore);
|
||||
}
|
||||
// remaining cases are prerender-ppr and prerender-legacy
|
||||
// We aren't in a dynamicIO prerender but we do have fallback params at this
|
||||
// level so we need to make an erroring exotic params object which will postpone
|
||||
// if you access the fallback params
|
||||
return makeErroringExoticParams(underlyingParams, fallbackParams, workStore, prerenderStore);
|
||||
}
|
||||
}
|
||||
// We don't have any fallback params so we have an entirely static safe params object
|
||||
return makeUntrackedExoticParams(underlyingParams);
|
||||
}
|
||||
function createRenderParams(underlyingParams, workStore) {
|
||||
if (process.env.NODE_ENV === 'development' && !workStore.isPrefetchRequest) {
|
||||
return makeDynamicallyTrackedExoticParamsWithDevWarnings(underlyingParams, workStore);
|
||||
} else {
|
||||
return makeUntrackedExoticParams(underlyingParams);
|
||||
}
|
||||
}
|
||||
const CachedParams = new WeakMap();
|
||||
function makeAbortingExoticParams(underlyingParams, route, prerenderStore) {
|
||||
const cachedParams = CachedParams.get(underlyingParams);
|
||||
if (cachedParams) {
|
||||
return cachedParams;
|
||||
}
|
||||
const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`params`');
|
||||
CachedParams.set(underlyingParams, promise);
|
||||
Object.keys(underlyingParams).forEach((prop)=>{
|
||||
if (_reflectutils.wellKnownProperties.has(prop)) {
|
||||
// These properties cannot be shadowed because they need to be the
|
||||
// true underlying value for Promises to work correctly at runtime
|
||||
} else {
|
||||
Object.defineProperty(promise, prop, {
|
||||
get () {
|
||||
const expression = (0, _reflectutils.describeStringPropertyAccess)('params', prop);
|
||||
const error = createParamsAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
},
|
||||
set (newValue) {
|
||||
Object.defineProperty(promise, prop, {
|
||||
value: newValue,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
});
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
function makeErroringExoticParams(underlyingParams, fallbackParams, workStore, prerenderStore) {
|
||||
const cachedParams = CachedParams.get(underlyingParams);
|
||||
if (cachedParams) {
|
||||
return cachedParams;
|
||||
}
|
||||
const augmentedUnderlying = {
|
||||
...underlyingParams
|
||||
};
|
||||
// We don't use makeResolvedReactPromise here because params
|
||||
// supports copying with spread and we don't want to unnecessarily
|
||||
// instrument the promise with spreadable properties of ReactPromise.
|
||||
const promise = Promise.resolve(augmentedUnderlying);
|
||||
CachedParams.set(underlyingParams, promise);
|
||||
Object.keys(underlyingParams).forEach((prop)=>{
|
||||
if (_reflectutils.wellKnownProperties.has(prop)) {
|
||||
// These properties cannot be shadowed because they need to be the
|
||||
// true underlying value for Promises to work correctly at runtime
|
||||
} else {
|
||||
if (fallbackParams.has(prop)) {
|
||||
Object.defineProperty(augmentedUnderlying, prop, {
|
||||
get () {
|
||||
const expression = (0, _reflectutils.describeStringPropertyAccess)('params', prop);
|
||||
// In most dynamic APIs we also throw if `dynamic = "error"` however
|
||||
// for params is only dynamic when we're generating a fallback shell
|
||||
// and even when `dynamic = "error"` we still support generating dynamic
|
||||
// fallback shells
|
||||
// TODO remove this comment when dynamicIO is the default since there
|
||||
// will be no `dynamic = "error"`
|
||||
if (prerenderStore.type === 'prerender-ppr') {
|
||||
// PPR Prerender (no dynamicIO)
|
||||
(0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);
|
||||
} else {
|
||||
// Legacy Prerender
|
||||
(0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);
|
||||
}
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
Object.defineProperty(promise, prop, {
|
||||
get () {
|
||||
const expression = (0, _reflectutils.describeStringPropertyAccess)('params', prop);
|
||||
// In most dynamic APIs we also throw if `dynamic = "error"` however
|
||||
// for params is only dynamic when we're generating a fallback shell
|
||||
// and even when `dynamic = "error"` we still support generating dynamic
|
||||
// fallback shells
|
||||
// TODO remove this comment when dynamicIO is the default since there
|
||||
// will be no `dynamic = "error"`
|
||||
if (prerenderStore.type === 'prerender-ppr') {
|
||||
// PPR Prerender (no dynamicIO)
|
||||
(0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);
|
||||
} else {
|
||||
// Legacy Prerender
|
||||
(0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);
|
||||
}
|
||||
},
|
||||
set (newValue) {
|
||||
Object.defineProperty(promise, prop, {
|
||||
value: newValue,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
});
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
} else {
|
||||
;
|
||||
promise[prop] = underlyingParams[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
function makeUntrackedExoticParams(underlyingParams) {
|
||||
const cachedParams = CachedParams.get(underlyingParams);
|
||||
if (cachedParams) {
|
||||
return cachedParams;
|
||||
}
|
||||
// We don't use makeResolvedReactPromise here because params
|
||||
// supports copying with spread and we don't want to unnecessarily
|
||||
// instrument the promise with spreadable properties of ReactPromise.
|
||||
const promise = Promise.resolve(underlyingParams);
|
||||
CachedParams.set(underlyingParams, promise);
|
||||
Object.keys(underlyingParams).forEach((prop)=>{
|
||||
if (_reflectutils.wellKnownProperties.has(prop)) {
|
||||
// These properties cannot be shadowed because they need to be the
|
||||
// true underlying value for Promises to work correctly at runtime
|
||||
} else {
|
||||
;
|
||||
promise[prop] = underlyingParams[prop];
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
function makeDynamicallyTrackedExoticParamsWithDevWarnings(underlyingParams, store) {
|
||||
const cachedParams = CachedParams.get(underlyingParams);
|
||||
if (cachedParams) {
|
||||
return cachedParams;
|
||||
}
|
||||
// We don't use makeResolvedReactPromise here because params
|
||||
// supports copying with spread and we don't want to unnecessarily
|
||||
// instrument the promise with spreadable properties of ReactPromise.
|
||||
const promise = new Promise((resolve)=>(0, _scheduler.scheduleImmediate)(()=>resolve(underlyingParams)));
|
||||
const proxiedProperties = new Set();
|
||||
const unproxiedProperties = [];
|
||||
Object.keys(underlyingParams).forEach((prop)=>{
|
||||
if (_reflectutils.wellKnownProperties.has(prop)) {
|
||||
// These properties cannot be shadowed because they need to be the
|
||||
// true underlying value for Promises to work correctly at runtime
|
||||
unproxiedProperties.push(prop);
|
||||
} else {
|
||||
proxiedProperties.add(prop);
|
||||
promise[prop] = underlyingParams[prop];
|
||||
}
|
||||
});
|
||||
const proxiedPromise = new Proxy(promise, {
|
||||
get (target, prop, receiver) {
|
||||
if (typeof prop === 'string') {
|
||||
if (// We are accessing a property that was proxied to the promise instance
|
||||
proxiedProperties.has(prop)) {
|
||||
const expression = (0, _reflectutils.describeStringPropertyAccess)('params', prop);
|
||||
syncIODev(store.route, expression);
|
||||
}
|
||||
}
|
||||
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
||||
},
|
||||
set (target, prop, value, receiver) {
|
||||
if (typeof prop === 'string') {
|
||||
proxiedProperties.delete(prop);
|
||||
}
|
||||
return _reflect.ReflectAdapter.set(target, prop, value, receiver);
|
||||
},
|
||||
ownKeys (target) {
|
||||
const expression = '`...params` or similar expression';
|
||||
syncIODev(store.route, expression, unproxiedProperties);
|
||||
return Reflect.ownKeys(target);
|
||||
}
|
||||
});
|
||||
CachedParams.set(underlyingParams, proxiedPromise);
|
||||
return proxiedPromise;
|
||||
}
|
||||
function syncIODev(route, expression, missingProperties) {
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workUnitStore && workUnitStore.type === 'request' && workUnitStore.prerenderPhase === true) {
|
||||
// When we're rendering dynamically in dev we need to advance out of the
|
||||
// Prerender environment when we read Request data synchronously
|
||||
const requestStore = workUnitStore;
|
||||
(0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(requestStore);
|
||||
}
|
||||
// In all cases we warn normally
|
||||
if (missingProperties && missingProperties.length > 0) {
|
||||
warnForIncompleteEnumeration(route, expression, missingProperties);
|
||||
} else {
|
||||
warnForSyncAccess(route, expression);
|
||||
}
|
||||
}
|
||||
const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createParamsAccessError);
|
||||
const warnForIncompleteEnumeration = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createIncompleteEnumerationError);
|
||||
function createParamsAccessError(route, expression) {
|
||||
const prefix = route ? `Route "${route}" ` : 'This route ';
|
||||
return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`params\` should be awaited before using its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", {
|
||||
value: "E307",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function createIncompleteEnumerationError(route, expression, missingProperties) {
|
||||
const prefix = route ? `Route "${route}" ` : 'This route ';
|
||||
return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`params\` should be awaited before using its properties. ` + `The following properties were not available through enumeration ` + `because they conflict with builtin property names: ` + `${describeListOfPropertyNames(missingProperties)}. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", {
|
||||
value: "E482",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function describeListOfPropertyNames(properties) {
|
||||
switch(properties.length){
|
||||
case 0:
|
||||
throw Object.defineProperty(new _invarianterror.InvariantError('Expected describeListOfPropertyNames to be called with a non-empty list of strings.'), "__NEXT_ERROR_CODE", {
|
||||
value: "E531",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
case 1:
|
||||
return `\`${properties[0]}\``;
|
||||
case 2:
|
||||
return `\`${properties[0]}\` and \`${properties[1]}\``;
|
||||
default:
|
||||
{
|
||||
let description = '';
|
||||
for(let i = 0; i < properties.length - 1; i++){
|
||||
description += `\`${properties[i]}\`, `;
|
||||
}
|
||||
description += `, and \`${properties[properties.length - 1]}\``;
|
||||
return description;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=params.js.map
|
||||
1
frontend/webapp/node_modules/next/dist/server/request/params.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/next/dist/server/request/params.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
frontend/webapp/node_modules/next/dist/server/request/root-params.d.ts
generated
vendored
Normal file
2
frontend/webapp/node_modules/next/dist/server/request/root-params.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { Params } from './params';
|
||||
export declare function unstable_rootParams(): Promise<Params>;
|
||||
132
frontend/webapp/node_modules/next/dist/server/request/root-params.js
generated
vendored
Normal file
132
frontend/webapp/node_modules/next/dist/server/request/root-params.js
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "unstable_rootParams", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return unstable_rootParams;
|
||||
}
|
||||
});
|
||||
const _invarianterror = require("../../shared/lib/invariant-error");
|
||||
const _dynamicrendering = require("../app-render/dynamic-rendering");
|
||||
const _workasyncstorageexternal = require("../app-render/work-async-storage.external");
|
||||
const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external");
|
||||
const _dynamicrenderingutils = require("../dynamic-rendering-utils");
|
||||
const _reflectutils = require("../../shared/lib/utils/reflect-utils");
|
||||
const CachedParams = new WeakMap();
|
||||
async function unstable_rootParams() {
|
||||
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
||||
if (!workStore) {
|
||||
throw Object.defineProperty(new _invarianterror.InvariantError('Missing workStore in unstable_rootParams'), "__NEXT_ERROR_CODE", {
|
||||
value: "E615",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (!workUnitStore) {
|
||||
throw Object.defineProperty(new Error(`Route ${workStore.route} used \`unstable_rootParams()\` in Pages Router. This API is only available within App Router.`), "__NEXT_ERROR_CODE", {
|
||||
value: "E641",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
switch(workUnitStore.type){
|
||||
case 'unstable-cache':
|
||||
case 'cache':
|
||||
{
|
||||
throw Object.defineProperty(new Error(`Route ${workStore.route} used \`unstable_rootParams()\` inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`), "__NEXT_ERROR_CODE", {
|
||||
value: "E642",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
case 'prerender':
|
||||
case 'prerender-ppr':
|
||||
case 'prerender-legacy':
|
||||
return createPrerenderRootParams(workUnitStore.rootParams, workStore, workUnitStore);
|
||||
default:
|
||||
return Promise.resolve(workUnitStore.rootParams);
|
||||
}
|
||||
}
|
||||
function createPrerenderRootParams(underlyingParams, workStore, prerenderStore) {
|
||||
const fallbackParams = workStore.fallbackRouteParams;
|
||||
if (fallbackParams) {
|
||||
let hasSomeFallbackParams = false;
|
||||
for(const key in underlyingParams){
|
||||
if (fallbackParams.has(key)) {
|
||||
hasSomeFallbackParams = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hasSomeFallbackParams) {
|
||||
// params need to be treated as dynamic because we have at least one fallback param
|
||||
if (prerenderStore.type === 'prerender') {
|
||||
// We are in a dynamicIO (PPR or otherwise) prerender
|
||||
const cachedParams = CachedParams.get(underlyingParams);
|
||||
if (cachedParams) {
|
||||
return cachedParams;
|
||||
}
|
||||
const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`unstable_rootParams`');
|
||||
CachedParams.set(underlyingParams, promise);
|
||||
return promise;
|
||||
}
|
||||
// remaining cases are prerender-ppr and prerender-legacy
|
||||
// We aren't in a dynamicIO prerender but we do have fallback params at this
|
||||
// level so we need to make an erroring params object which will postpone
|
||||
// if you access the fallback params
|
||||
return makeErroringRootParams(underlyingParams, fallbackParams, workStore, prerenderStore);
|
||||
}
|
||||
}
|
||||
// We don't have any fallback params so we have an entirely static safe params object
|
||||
return Promise.resolve(underlyingParams);
|
||||
}
|
||||
function makeErroringRootParams(underlyingParams, fallbackParams, workStore, prerenderStore) {
|
||||
const cachedParams = CachedParams.get(underlyingParams);
|
||||
if (cachedParams) {
|
||||
return cachedParams;
|
||||
}
|
||||
const augmentedUnderlying = {
|
||||
...underlyingParams
|
||||
};
|
||||
// We don't use makeResolvedReactPromise here because params
|
||||
// supports copying with spread and we don't want to unnecessarily
|
||||
// instrument the promise with spreadable properties of ReactPromise.
|
||||
const promise = Promise.resolve(augmentedUnderlying);
|
||||
CachedParams.set(underlyingParams, promise);
|
||||
Object.keys(underlyingParams).forEach((prop)=>{
|
||||
if (_reflectutils.wellKnownProperties.has(prop)) {
|
||||
// These properties cannot be shadowed because they need to be the
|
||||
// true underlying value for Promises to work correctly at runtime
|
||||
} else {
|
||||
if (fallbackParams.has(prop)) {
|
||||
Object.defineProperty(augmentedUnderlying, prop, {
|
||||
get () {
|
||||
const expression = (0, _reflectutils.describeStringPropertyAccess)('unstable_rootParams', prop);
|
||||
// In most dynamic APIs we also throw if `dynamic = "error"` however
|
||||
// for params is only dynamic when we're generating a fallback shell
|
||||
// and even when `dynamic = "error"` we still support generating dynamic
|
||||
// fallback shells
|
||||
// TODO remove this comment when dynamicIO is the default since there
|
||||
// will be no `dynamic = "error"`
|
||||
if (prerenderStore.type === 'prerender-ppr') {
|
||||
// PPR Prerender (no dynamicIO)
|
||||
(0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);
|
||||
} else {
|
||||
// Legacy Prerender
|
||||
(0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);
|
||||
}
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
} else {
|
||||
;
|
||||
promise[prop] = underlyingParams[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=root-params.js.map
|
||||
1
frontend/webapp/node_modules/next/dist/server/request/root-params.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/next/dist/server/request/root-params.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
40
frontend/webapp/node_modules/next/dist/server/request/search-params.d.ts
generated
vendored
Normal file
40
frontend/webapp/node_modules/next/dist/server/request/search-params.d.ts
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { WorkStore } from '../app-render/work-async-storage.external';
|
||||
export type SearchParams = {
|
||||
[key: string]: string | string[] | undefined;
|
||||
};
|
||||
/**
|
||||
* In this version of Next.js the `params` prop passed to Layouts, Pages, and other Segments is a Promise.
|
||||
* However to facilitate migration to this new Promise type you can currently still access params directly on the Promise instance passed to these Segments.
|
||||
* The `UnsafeUnwrappedSearchParams` type is available if you need to temporarily access the underlying params without first awaiting or `use`ing the Promise.
|
||||
*
|
||||
* In a future version of Next.js the `params` prop will be a plain Promise and this type will be removed.
|
||||
*
|
||||
* Typically instances of `params` can be updated automatically to be treated as a Promise by a codemod published alongside this Next.js version however if you
|
||||
* have not yet run the codemod of the codemod cannot detect certain instances of `params` usage you should first try to refactor your code to await `params`.
|
||||
*
|
||||
* If refactoring is not possible but you still want to be able to access params directly without typescript errors you can cast the params Promise to this type
|
||||
*
|
||||
* ```tsx
|
||||
* type Props = { searchParams: Promise<{ foo: string }> }
|
||||
*
|
||||
* export default async function Page(props: Props) {
|
||||
* const { searchParams } = (props.searchParams as unknown as UnsafeUnwrappedSearchParams<typeof props.searchParams>)
|
||||
* return ...
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* This type is marked deprecated to help identify it as target for refactoring away.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
export type UnsafeUnwrappedSearchParams<P> = P extends Promise<infer U> ? Omit<U, 'then' | 'status' | 'value'> : never;
|
||||
export declare function createSearchParamsFromClient(underlyingSearchParams: SearchParams, workStore: WorkStore): Promise<SearchParams>;
|
||||
export declare const createServerSearchParamsForMetadata: typeof createServerSearchParamsForServerPage;
|
||||
export declare function createServerSearchParamsForServerPage(underlyingSearchParams: SearchParams, workStore: WorkStore): Promise<SearchParams>;
|
||||
export declare function createPrerenderSearchParamsForClientPage(workStore: WorkStore): Promise<SearchParams>;
|
||||
/**
|
||||
* This is a variation of `makeErroringExoticSearchParams` that always throws an
|
||||
* error on access, because accessing searchParams inside of `"use cache"` is
|
||||
* not allowed.
|
||||
*/
|
||||
export declare function makeErroringExoticSearchParamsForUseCache(workStore: WorkStore): Promise<SearchParams>;
|
||||
520
frontend/webapp/node_modules/next/dist/server/request/search-params.js
generated
vendored
Normal file
520
frontend/webapp/node_modules/next/dist/server/request/search-params.js
generated
vendored
Normal file
@@ -0,0 +1,520 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
createPrerenderSearchParamsForClientPage: null,
|
||||
createSearchParamsFromClient: null,
|
||||
createServerSearchParamsForMetadata: null,
|
||||
createServerSearchParamsForServerPage: null,
|
||||
makeErroringExoticSearchParamsForUseCache: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
createPrerenderSearchParamsForClientPage: function() {
|
||||
return createPrerenderSearchParamsForClientPage;
|
||||
},
|
||||
createSearchParamsFromClient: function() {
|
||||
return createSearchParamsFromClient;
|
||||
},
|
||||
createServerSearchParamsForMetadata: function() {
|
||||
return createServerSearchParamsForMetadata;
|
||||
},
|
||||
createServerSearchParamsForServerPage: function() {
|
||||
return createServerSearchParamsForServerPage;
|
||||
},
|
||||
makeErroringExoticSearchParamsForUseCache: function() {
|
||||
return makeErroringExoticSearchParamsForUseCache;
|
||||
}
|
||||
});
|
||||
const _reflect = require("../web/spec-extension/adapters/reflect");
|
||||
const _dynamicrendering = require("../app-render/dynamic-rendering");
|
||||
const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external");
|
||||
const _invarianterror = require("../../shared/lib/invariant-error");
|
||||
const _dynamicrenderingutils = require("../dynamic-rendering-utils");
|
||||
const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger");
|
||||
const _reflectutils = require("../../shared/lib/utils/reflect-utils");
|
||||
const _utils = require("./utils");
|
||||
const _scheduler = require("../../lib/scheduler");
|
||||
function createSearchParamsFromClient(underlyingSearchParams, workStore) {
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workUnitStore) {
|
||||
switch(workUnitStore.type){
|
||||
case 'prerender':
|
||||
case 'prerender-ppr':
|
||||
case 'prerender-legacy':
|
||||
return createPrerenderSearchParams(workStore, workUnitStore);
|
||||
default:
|
||||
}
|
||||
}
|
||||
return createRenderSearchParams(underlyingSearchParams, workStore);
|
||||
}
|
||||
const createServerSearchParamsForMetadata = createServerSearchParamsForServerPage;
|
||||
function createServerSearchParamsForServerPage(underlyingSearchParams, workStore) {
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workUnitStore) {
|
||||
switch(workUnitStore.type){
|
||||
case 'prerender':
|
||||
case 'prerender-ppr':
|
||||
case 'prerender-legacy':
|
||||
return createPrerenderSearchParams(workStore, workUnitStore);
|
||||
default:
|
||||
}
|
||||
}
|
||||
return createRenderSearchParams(underlyingSearchParams, workStore);
|
||||
}
|
||||
function createPrerenderSearchParamsForClientPage(workStore) {
|
||||
if (workStore.forceStatic) {
|
||||
// When using forceStatic we override all other logic and always just return an empty
|
||||
// dictionary object.
|
||||
return Promise.resolve({});
|
||||
}
|
||||
const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (prerenderStore && prerenderStore.type === 'prerender') {
|
||||
// dynamicIO Prerender
|
||||
// We're prerendering in a mode that aborts (dynamicIO) and should stall
|
||||
// the promise to ensure the RSC side is considered dynamic
|
||||
return (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`searchParams`');
|
||||
}
|
||||
// We're prerendering in a mode that does not aborts. We resolve the promise without
|
||||
// any tracking because we're just transporting a value from server to client where the tracking
|
||||
// will be applied.
|
||||
return Promise.resolve({});
|
||||
}
|
||||
function createPrerenderSearchParams(workStore, prerenderStore) {
|
||||
if (workStore.forceStatic) {
|
||||
// When using forceStatic we override all other logic and always just return an empty
|
||||
// dictionary object.
|
||||
return Promise.resolve({});
|
||||
}
|
||||
if (prerenderStore.type === 'prerender') {
|
||||
// We are in a dynamicIO (PPR or otherwise) prerender
|
||||
return makeAbortingExoticSearchParams(workStore.route, prerenderStore);
|
||||
}
|
||||
// The remaining cases are prerender-ppr and prerender-legacy
|
||||
// We are in a legacy static generation and need to interrupt the prerender
|
||||
// when search params are accessed.
|
||||
return makeErroringExoticSearchParams(workStore, prerenderStore);
|
||||
}
|
||||
function createRenderSearchParams(underlyingSearchParams, workStore) {
|
||||
if (workStore.forceStatic) {
|
||||
// When using forceStatic we override all other logic and always just return an empty
|
||||
// dictionary object.
|
||||
return Promise.resolve({});
|
||||
} else {
|
||||
if (process.env.NODE_ENV === 'development' && !workStore.isPrefetchRequest) {
|
||||
return makeDynamicallyTrackedExoticSearchParamsWithDevWarnings(underlyingSearchParams, workStore);
|
||||
} else {
|
||||
return makeUntrackedExoticSearchParams(underlyingSearchParams, workStore);
|
||||
}
|
||||
}
|
||||
}
|
||||
const CachedSearchParams = new WeakMap();
|
||||
const CachedSearchParamsForUseCache = new WeakMap();
|
||||
function makeAbortingExoticSearchParams(route, prerenderStore) {
|
||||
const cachedSearchParams = CachedSearchParams.get(prerenderStore);
|
||||
if (cachedSearchParams) {
|
||||
return cachedSearchParams;
|
||||
}
|
||||
const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, '`searchParams`');
|
||||
const proxiedPromise = new Proxy(promise, {
|
||||
get (target, prop, receiver) {
|
||||
if (Object.hasOwn(promise, prop)) {
|
||||
// The promise has this property directly. we must return it.
|
||||
// We know it isn't a dynamic access because it can only be something
|
||||
// that was previously written to the promise and thus not an underlying searchParam value
|
||||
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
||||
}
|
||||
switch(prop){
|
||||
case 'then':
|
||||
{
|
||||
const expression = '`await searchParams`, `searchParams.then`, or similar';
|
||||
(0, _dynamicrendering.annotateDynamicAccess)(expression, prerenderStore);
|
||||
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
||||
}
|
||||
case 'status':
|
||||
{
|
||||
const expression = '`use(searchParams)`, `searchParams.status`, or similar';
|
||||
(0, _dynamicrendering.annotateDynamicAccess)(expression, prerenderStore);
|
||||
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (typeof prop === 'string' && !_reflectutils.wellKnownProperties.has(prop)) {
|
||||
const expression = (0, _reflectutils.describeStringPropertyAccess)('searchParams', prop);
|
||||
const error = createSearchAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
||||
}
|
||||
}
|
||||
},
|
||||
has (target, prop) {
|
||||
// We don't expect key checking to be used except for testing the existence of
|
||||
// searchParams so we make all has tests trigger dynamic. this means that `promise.then`
|
||||
// can resolve to the then function on the Promise prototype but 'then' in promise will assume
|
||||
// you are testing whether the searchParams has a 'then' property.
|
||||
if (typeof prop === 'string') {
|
||||
const expression = (0, _reflectutils.describeHasCheckingStringProperty)('searchParams', prop);
|
||||
const error = createSearchAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
return _reflect.ReflectAdapter.has(target, prop);
|
||||
},
|
||||
ownKeys () {
|
||||
const expression = '`{...searchParams}`, `Object.keys(searchParams)`, or similar';
|
||||
const error = createSearchAccessError(route, expression);
|
||||
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
||||
}
|
||||
});
|
||||
CachedSearchParams.set(prerenderStore, proxiedPromise);
|
||||
return proxiedPromise;
|
||||
}
|
||||
function makeErroringExoticSearchParams(workStore, prerenderStore) {
|
||||
const cachedSearchParams = CachedSearchParams.get(workStore);
|
||||
if (cachedSearchParams) {
|
||||
return cachedSearchParams;
|
||||
}
|
||||
const underlyingSearchParams = {};
|
||||
// For search params we don't construct a ReactPromise because we want to interrupt
|
||||
// rendering on any property access that was not set from outside and so we only want
|
||||
// to have properties like value and status if React sets them.
|
||||
const promise = Promise.resolve(underlyingSearchParams);
|
||||
const proxiedPromise = new Proxy(promise, {
|
||||
get (target, prop, receiver) {
|
||||
if (Object.hasOwn(promise, prop)) {
|
||||
// The promise has this property directly. we must return it.
|
||||
// We know it isn't a dynamic access because it can only be something
|
||||
// that was previously written to the promise and thus not an underlying searchParam value
|
||||
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
||||
}
|
||||
switch(prop){
|
||||
case 'then':
|
||||
{
|
||||
const expression = '`await searchParams`, `searchParams.then`, or similar';
|
||||
if (workStore.dynamicShouldError) {
|
||||
(0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);
|
||||
} else if (prerenderStore.type === 'prerender-ppr') {
|
||||
// PPR Prerender (no dynamicIO)
|
||||
(0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);
|
||||
} else {
|
||||
// Legacy Prerender
|
||||
(0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case 'status':
|
||||
{
|
||||
const expression = '`use(searchParams)`, `searchParams.status`, or similar';
|
||||
if (workStore.dynamicShouldError) {
|
||||
(0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);
|
||||
} else if (prerenderStore.type === 'prerender-ppr') {
|
||||
// PPR Prerender (no dynamicIO)
|
||||
(0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);
|
||||
} else {
|
||||
// Legacy Prerender
|
||||
(0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);
|
||||
}
|
||||
return;
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (typeof prop === 'string' && !_reflectutils.wellKnownProperties.has(prop)) {
|
||||
const expression = (0, _reflectutils.describeStringPropertyAccess)('searchParams', prop);
|
||||
if (workStore.dynamicShouldError) {
|
||||
(0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);
|
||||
} else if (prerenderStore.type === 'prerender-ppr') {
|
||||
// PPR Prerender (no dynamicIO)
|
||||
(0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);
|
||||
} else {
|
||||
// Legacy Prerender
|
||||
(0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);
|
||||
}
|
||||
}
|
||||
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
||||
}
|
||||
}
|
||||
},
|
||||
has (target, prop) {
|
||||
// We don't expect key checking to be used except for testing the existence of
|
||||
// searchParams so we make all has tests trigger dynamic. this means that `promise.then`
|
||||
// can resolve to the then function on the Promise prototype but 'then' in promise will assume
|
||||
// you are testing whether the searchParams has a 'then' property.
|
||||
if (typeof prop === 'string') {
|
||||
const expression = (0, _reflectutils.describeHasCheckingStringProperty)('searchParams', prop);
|
||||
if (workStore.dynamicShouldError) {
|
||||
(0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);
|
||||
} else if (prerenderStore.type === 'prerender-ppr') {
|
||||
// PPR Prerender (no dynamicIO)
|
||||
(0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);
|
||||
} else {
|
||||
// Legacy Prerender
|
||||
(0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return _reflect.ReflectAdapter.has(target, prop);
|
||||
},
|
||||
ownKeys () {
|
||||
const expression = '`{...searchParams}`, `Object.keys(searchParams)`, or similar';
|
||||
if (workStore.dynamicShouldError) {
|
||||
(0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(workStore.route, expression);
|
||||
} else if (prerenderStore.type === 'prerender-ppr') {
|
||||
// PPR Prerender (no dynamicIO)
|
||||
(0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, prerenderStore.dynamicTracking);
|
||||
} else {
|
||||
// Legacy Prerender
|
||||
(0, _dynamicrendering.throwToInterruptStaticGeneration)(expression, workStore, prerenderStore);
|
||||
}
|
||||
}
|
||||
});
|
||||
CachedSearchParams.set(workStore, proxiedPromise);
|
||||
return proxiedPromise;
|
||||
}
|
||||
function makeErroringExoticSearchParamsForUseCache(workStore) {
|
||||
const cachedSearchParams = CachedSearchParamsForUseCache.get(workStore);
|
||||
if (cachedSearchParams) {
|
||||
return cachedSearchParams;
|
||||
}
|
||||
const promise = Promise.resolve({});
|
||||
const proxiedPromise = new Proxy(promise, {
|
||||
get (target, prop, receiver) {
|
||||
if (Object.hasOwn(promise, prop)) {
|
||||
// The promise has this property directly. we must return it. We know it
|
||||
// isn't a dynamic access because it can only be something that was
|
||||
// previously written to the promise and thus not an underlying
|
||||
// searchParam value
|
||||
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
||||
}
|
||||
if (typeof prop === 'string' && (prop === 'then' || !_reflectutils.wellKnownProperties.has(prop))) {
|
||||
(0, _utils.throwForSearchParamsAccessInUseCache)(workStore);
|
||||
}
|
||||
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
||||
},
|
||||
has (target, prop) {
|
||||
// We don't expect key checking to be used except for testing the existence of
|
||||
// searchParams so we make all has tests throw an error. this means that `promise.then`
|
||||
// can resolve to the then function on the Promise prototype but 'then' in promise will assume
|
||||
// you are testing whether the searchParams has a 'then' property.
|
||||
if (typeof prop === 'string' && (prop === 'then' || !_reflectutils.wellKnownProperties.has(prop))) {
|
||||
(0, _utils.throwForSearchParamsAccessInUseCache)(workStore);
|
||||
}
|
||||
return _reflect.ReflectAdapter.has(target, prop);
|
||||
},
|
||||
ownKeys () {
|
||||
(0, _utils.throwForSearchParamsAccessInUseCache)(workStore);
|
||||
}
|
||||
});
|
||||
CachedSearchParamsForUseCache.set(workStore, proxiedPromise);
|
||||
return proxiedPromise;
|
||||
}
|
||||
function makeUntrackedExoticSearchParams(underlyingSearchParams, store) {
|
||||
const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams);
|
||||
if (cachedSearchParams) {
|
||||
return cachedSearchParams;
|
||||
}
|
||||
// We don't use makeResolvedReactPromise here because searchParams
|
||||
// supports copying with spread and we don't want to unnecessarily
|
||||
// instrument the promise with spreadable properties of ReactPromise.
|
||||
const promise = Promise.resolve(underlyingSearchParams);
|
||||
CachedSearchParams.set(underlyingSearchParams, promise);
|
||||
Object.keys(underlyingSearchParams).forEach((prop)=>{
|
||||
if (!_reflectutils.wellKnownProperties.has(prop)) {
|
||||
Object.defineProperty(promise, prop, {
|
||||
get () {
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
(0, _dynamicrendering.trackDynamicDataInDynamicRender)(store, workUnitStore);
|
||||
return underlyingSearchParams[prop];
|
||||
},
|
||||
set (value) {
|
||||
Object.defineProperty(promise, prop, {
|
||||
value,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
});
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
function makeDynamicallyTrackedExoticSearchParamsWithDevWarnings(underlyingSearchParams, store) {
|
||||
const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams);
|
||||
if (cachedSearchParams) {
|
||||
return cachedSearchParams;
|
||||
}
|
||||
const proxiedProperties = new Set();
|
||||
const unproxiedProperties = [];
|
||||
// We have an unfortunate sequence of events that requires this initialization logic. We want to instrument the underlying
|
||||
// searchParams object to detect if you are accessing values in dev. This is used for warnings and for things like the static prerender
|
||||
// indicator. However when we pass this proxy to our Promise.resolve() below the VM checks if the resolved value is a promise by looking
|
||||
// at the `.then` property. To our dynamic tracking logic this is indistinguishable from a `then` searchParam and so we would normally trigger
|
||||
// dynamic tracking. However we know that this .then is not real dynamic access, it's just how thenables resolve in sequence. So we introduce
|
||||
// this initialization concept so we omit the dynamic check until after we've constructed our resolved promise.
|
||||
let promiseInitialized = false;
|
||||
const proxiedUnderlying = new Proxy(underlyingSearchParams, {
|
||||
get (target, prop, receiver) {
|
||||
if (typeof prop === 'string' && promiseInitialized) {
|
||||
if (store.dynamicShouldError) {
|
||||
const expression = (0, _reflectutils.describeStringPropertyAccess)('searchParams', prop);
|
||||
(0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(store.route, expression);
|
||||
}
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
(0, _dynamicrendering.trackDynamicDataInDynamicRender)(store, workUnitStore);
|
||||
}
|
||||
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
||||
},
|
||||
has (target, prop) {
|
||||
if (typeof prop === 'string') {
|
||||
if (store.dynamicShouldError) {
|
||||
const expression = (0, _reflectutils.describeHasCheckingStringProperty)('searchParams', prop);
|
||||
(0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(store.route, expression);
|
||||
}
|
||||
}
|
||||
return Reflect.has(target, prop);
|
||||
},
|
||||
ownKeys (target) {
|
||||
if (store.dynamicShouldError) {
|
||||
const expression = '`{...searchParams}`, `Object.keys(searchParams)`, or similar';
|
||||
(0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(store.route, expression);
|
||||
}
|
||||
return Reflect.ownKeys(target);
|
||||
}
|
||||
});
|
||||
// We don't use makeResolvedReactPromise here because searchParams
|
||||
// supports copying with spread and we don't want to unnecessarily
|
||||
// instrument the promise with spreadable properties of ReactPromise.
|
||||
const promise = new Promise((resolve)=>(0, _scheduler.scheduleImmediate)(()=>resolve(underlyingSearchParams)));
|
||||
promise.then(()=>{
|
||||
promiseInitialized = true;
|
||||
});
|
||||
Object.keys(underlyingSearchParams).forEach((prop)=>{
|
||||
if (_reflectutils.wellKnownProperties.has(prop)) {
|
||||
// These properties cannot be shadowed because they need to be the
|
||||
// true underlying value for Promises to work correctly at runtime
|
||||
unproxiedProperties.push(prop);
|
||||
} else {
|
||||
proxiedProperties.add(prop);
|
||||
Object.defineProperty(promise, prop, {
|
||||
get () {
|
||||
return proxiedUnderlying[prop];
|
||||
},
|
||||
set (newValue) {
|
||||
Object.defineProperty(promise, prop, {
|
||||
value: newValue,
|
||||
writable: true,
|
||||
enumerable: true
|
||||
});
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
});
|
||||
const proxiedPromise = new Proxy(promise, {
|
||||
get (target, prop, receiver) {
|
||||
if (prop === 'then' && store.dynamicShouldError) {
|
||||
const expression = '`searchParams.then`';
|
||||
(0, _utils.throwWithStaticGenerationBailoutErrorWithDynamicError)(store.route, expression);
|
||||
}
|
||||
if (typeof prop === 'string') {
|
||||
if (!_reflectutils.wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor
|
||||
// the underlying searchParams.
|
||||
Reflect.has(target, prop) === false)) {
|
||||
const expression = (0, _reflectutils.describeStringPropertyAccess)('searchParams', prop);
|
||||
syncIODev(store.route, expression);
|
||||
}
|
||||
}
|
||||
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
||||
},
|
||||
set (target, prop, value, receiver) {
|
||||
if (typeof prop === 'string') {
|
||||
proxiedProperties.delete(prop);
|
||||
}
|
||||
return Reflect.set(target, prop, value, receiver);
|
||||
},
|
||||
has (target, prop) {
|
||||
if (typeof prop === 'string') {
|
||||
if (!_reflectutils.wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor
|
||||
// the underlying searchParams.
|
||||
Reflect.has(target, prop) === false)) {
|
||||
const expression = (0, _reflectutils.describeHasCheckingStringProperty)('searchParams', prop);
|
||||
syncIODev(store.route, expression);
|
||||
}
|
||||
}
|
||||
return Reflect.has(target, prop);
|
||||
},
|
||||
ownKeys (target) {
|
||||
const expression = '`Object.keys(searchParams)` or similar';
|
||||
syncIODev(store.route, expression, unproxiedProperties);
|
||||
return Reflect.ownKeys(target);
|
||||
}
|
||||
});
|
||||
CachedSearchParams.set(underlyingSearchParams, proxiedPromise);
|
||||
return proxiedPromise;
|
||||
}
|
||||
function syncIODev(route, expression, missingProperties) {
|
||||
// In all cases we warn normally
|
||||
if (missingProperties && missingProperties.length > 0) {
|
||||
warnForIncompleteEnumeration(route, expression, missingProperties);
|
||||
} else {
|
||||
warnForSyncAccess(route, expression);
|
||||
}
|
||||
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
||||
if (workUnitStore && workUnitStore.type === 'request' && workUnitStore.prerenderPhase === true) {
|
||||
// When we're rendering dynamically in dev we need to advance out of the
|
||||
// Prerender environment when we read Request data synchronously
|
||||
const requestStore = workUnitStore;
|
||||
(0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(requestStore);
|
||||
}
|
||||
}
|
||||
const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createSearchAccessError);
|
||||
const warnForIncompleteEnumeration = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createIncompleteEnumerationError);
|
||||
function createSearchAccessError(route, expression) {
|
||||
const prefix = route ? `Route "${route}" ` : 'This route ';
|
||||
return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`searchParams\` should be awaited before using its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", {
|
||||
value: "E249",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function createIncompleteEnumerationError(route, expression, missingProperties) {
|
||||
const prefix = route ? `Route "${route}" ` : 'This route ';
|
||||
return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`searchParams\` should be awaited before using its properties. ` + `The following properties were not available through enumeration ` + `because they conflict with builtin or well-known property names: ` + `${describeListOfPropertyNames(missingProperties)}. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", {
|
||||
value: "E2",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function describeListOfPropertyNames(properties) {
|
||||
switch(properties.length){
|
||||
case 0:
|
||||
throw Object.defineProperty(new _invarianterror.InvariantError('Expected describeListOfPropertyNames to be called with a non-empty list of strings.'), "__NEXT_ERROR_CODE", {
|
||||
value: "E531",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
case 1:
|
||||
return `\`${properties[0]}\``;
|
||||
case 2:
|
||||
return `\`${properties[0]}\` and \`${properties[1]}\``;
|
||||
default:
|
||||
{
|
||||
let description = '';
|
||||
for(let i = 0; i < properties.length - 1; i++){
|
||||
description += `\`${properties[i]}\`, `;
|
||||
}
|
||||
description += `, and \`${properties[properties.length - 1]}\``;
|
||||
return description;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=search-params.js.map
|
||||
1
frontend/webapp/node_modules/next/dist/server/request/search-params.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/next/dist/server/request/search-params.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
frontend/webapp/node_modules/next/dist/server/request/utils.d.ts
generated
vendored
Normal file
5
frontend/webapp/node_modules/next/dist/server/request/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { WorkStore } from '../app-render/work-async-storage.external';
|
||||
export declare function throwWithStaticGenerationBailoutError(route: string, expression: string): never;
|
||||
export declare function throwWithStaticGenerationBailoutErrorWithDynamicError(route: string, expression: string): never;
|
||||
export declare function throwForSearchParamsAccessInUseCache(workStore: WorkStore): never;
|
||||
export declare function isRequestAPICallableInsideAfter(): boolean;
|
||||
61
frontend/webapp/node_modules/next/dist/server/request/utils.js
generated
vendored
Normal file
61
frontend/webapp/node_modules/next/dist/server/request/utils.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
isRequestAPICallableInsideAfter: null,
|
||||
throwForSearchParamsAccessInUseCache: null,
|
||||
throwWithStaticGenerationBailoutError: null,
|
||||
throwWithStaticGenerationBailoutErrorWithDynamicError: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
isRequestAPICallableInsideAfter: function() {
|
||||
return isRequestAPICallableInsideAfter;
|
||||
},
|
||||
throwForSearchParamsAccessInUseCache: function() {
|
||||
return throwForSearchParamsAccessInUseCache;
|
||||
},
|
||||
throwWithStaticGenerationBailoutError: function() {
|
||||
return throwWithStaticGenerationBailoutError;
|
||||
},
|
||||
throwWithStaticGenerationBailoutErrorWithDynamicError: function() {
|
||||
return throwWithStaticGenerationBailoutErrorWithDynamicError;
|
||||
}
|
||||
});
|
||||
const _staticgenerationbailout = require("../../client/components/static-generation-bailout");
|
||||
const _aftertaskasyncstorageexternal = require("../app-render/after-task-async-storage.external");
|
||||
function throwWithStaticGenerationBailoutError(route, expression) {
|
||||
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
|
||||
value: "E576",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function throwWithStaticGenerationBailoutErrorWithDynamicError(route, expression) {
|
||||
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${route} with \`dynamic = "error"\` couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
|
||||
value: "E543",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function throwForSearchParamsAccessInUseCache(workStore) {
|
||||
const error = Object.defineProperty(new Error(`Route ${workStore.route} used "searchParams" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "searchParams" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
||||
value: "E634",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
workStore.invalidUsageError ??= error;
|
||||
throw error;
|
||||
}
|
||||
function isRequestAPICallableInsideAfter() {
|
||||
const afterTaskStore = _aftertaskasyncstorageexternal.afterTaskAsyncStorage.getStore();
|
||||
return (afterTaskStore == null ? void 0 : afterTaskStore.rootTaskSpawnPhase) === 'action';
|
||||
}
|
||||
|
||||
//# sourceMappingURL=utils.js.map
|
||||
1
frontend/webapp/node_modules/next/dist/server/request/utils.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/next/dist/server/request/utils.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/server/request/utils.ts"],"sourcesContent":["import { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\nimport type { WorkStore } from '../app-render/work-async-storage.external'\n\nexport function throwWithStaticGenerationBailoutError(\n route: string,\n expression: string\n): never {\n throw new StaticGenBailoutError(\n `Route ${route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n}\n\nexport function throwWithStaticGenerationBailoutErrorWithDynamicError(\n route: string,\n expression: string\n): never {\n throw new StaticGenBailoutError(\n `Route ${route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n}\n\nexport function throwForSearchParamsAccessInUseCache(\n workStore: WorkStore\n): never {\n const error = new Error(\n `Route ${workStore.route} used \"searchParams\" inside \"use cache\". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use \"searchParams\" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`\n )\n\n workStore.invalidUsageError ??= error\n\n throw error\n}\n\nexport function isRequestAPICallableInsideAfter() {\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n return afterTaskStore?.rootTaskSpawnPhase === 'action'\n}\n"],"names":["isRequestAPICallableInsideAfter","throwForSearchParamsAccessInUseCache","throwWithStaticGenerationBailoutError","throwWithStaticGenerationBailoutErrorWithDynamicError","route","expression","StaticGenBailoutError","workStore","error","Error","invalidUsageError","afterTaskStore","afterTaskAsyncStorage","getStore","rootTaskSpawnPhase"],"mappings":";;;;;;;;;;;;;;;;;IAkCgBA,+BAA+B;eAA/BA;;IAZAC,oCAAoC;eAApCA;;IAlBAC,qCAAqC;eAArCA;;IASAC,qDAAqD;eAArDA;;;yCAbsB;+CACA;AAG/B,SAASD,sCACdE,KAAa,EACbC,UAAkB;IAElB,MAAM,qBAEL,CAFK,IAAIC,8CAAqB,CAC7B,CAAC,MAAM,EAAEF,MAAM,iDAAiD,EAAEC,WAAW,0HAA0H,CAAC,GADpM,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF;AAEO,SAASF,sDACdC,KAAa,EACbC,UAAkB;IAElB,MAAM,qBAEL,CAFK,IAAIC,8CAAqB,CAC7B,CAAC,MAAM,EAAEF,MAAM,4EAA4E,EAAEC,WAAW,0HAA0H,CAAC,GAD/N,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF;AAEO,SAASJ,qCACdM,SAAoB;IAEpB,MAAMC,QAAQ,qBAEb,CAFa,IAAIC,MAChB,CAAC,MAAM,EAAEF,UAAUH,KAAK,CAAC,oVAAoV,CAAC,GADlW,qBAAA;eAAA;oBAAA;sBAAA;IAEd;IAEAG,UAAUG,iBAAiB,KAAKF;IAEhC,MAAMA;AACR;AAEO,SAASR;IACd,MAAMW,iBAAiBC,oDAAqB,CAACC,QAAQ;IACrD,OAAOF,CAAAA,kCAAAA,eAAgBG,kBAAkB,MAAK;AAChD"}
|
||||
Reference in New Issue
Block a user