.
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
export type RequestErrorContext = {
|
||||
routerKind: 'Pages Router' | 'App Router';
|
||||
routePath: string;
|
||||
routeType: 'render' | 'route' | 'action' | 'proxy';
|
||||
renderSource?: 'react-server-components' | 'react-server-components-payload' | 'server-rendering';
|
||||
revalidateReason: 'on-demand' | 'stale' | undefined;
|
||||
};
|
||||
export type InstrumentationOnRequestError = (error: unknown, errorRequest: Readonly<{
|
||||
path: string;
|
||||
method: string;
|
||||
headers: NodeJS.Dict<string | string[]>;
|
||||
}>, errorContext: Readonly<RequestErrorContext>) => void | Promise<void>;
|
||||
export type InstrumentationModule = {
|
||||
register?(): void;
|
||||
onRequestError?: InstrumentationOnRequestError;
|
||||
};
|
||||
export declare namespace Instrumentation {
|
||||
type onRequestError = InstrumentationOnRequestError;
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
//# sourceMappingURL=types.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","ignoreList":[]}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
export declare function getRevalidateReason(params: {
|
||||
isOnDemandRevalidate?: boolean;
|
||||
isStaticGeneration?: boolean;
|
||||
}): 'on-demand' | 'stale' | undefined;
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "getRevalidateReason", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return getRevalidateReason;
|
||||
}
|
||||
});
|
||||
function getRevalidateReason(params) {
|
||||
if (params.isOnDemandRevalidate) {
|
||||
return 'on-demand';
|
||||
}
|
||||
if (params.isStaticGeneration) {
|
||||
return 'stale';
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=utils.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/server/instrumentation/utils.ts"],"sourcesContent":["export function getRevalidateReason(params: {\n isOnDemandRevalidate?: boolean\n isStaticGeneration?: boolean\n}): 'on-demand' | 'stale' | undefined {\n if (params.isOnDemandRevalidate) {\n return 'on-demand'\n }\n if (params.isStaticGeneration) {\n return 'stale'\n }\n return undefined\n}\n"],"names":["getRevalidateReason","params","isOnDemandRevalidate","isStaticGeneration","undefined"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,oBAAoBC,MAGnC;IACC,IAAIA,OAAOC,oBAAoB,EAAE;QAC/B,OAAO;IACT;IACA,IAAID,OAAOE,kBAAkB,EAAE;QAC7B,OAAO;IACT;IACA,OAAOC;AACT","ignoreList":[0]}
|
||||
Reference in New Issue
Block a user