Initial commit

This commit is contained in:
bilulib
2025-04-13 00:18:57 +02:00
parent cff009bb7c
commit d894249e61
18301 changed files with 2905442 additions and 3845 deletions

View File

@@ -0,0 +1,19 @@
export type RequestErrorContext = {
routerKind: 'Pages Router' | 'App Router';
routePath: string;
routeType: 'render' | 'route' | 'action' | 'middleware';
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;
}

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,4 @@
export declare function getRevalidateReason(params: {
isOnDemandRevalidate?: boolean;
isRevalidate?: boolean;
}): 'on-demand' | 'stale' | undefined;

View File

@@ -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.isRevalidate) {
return 'stale';
}
return undefined;
}
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/server/instrumentation/utils.ts"],"sourcesContent":["export function getRevalidateReason(params: {\n isOnDemandRevalidate?: boolean\n isRevalidate?: boolean\n}): 'on-demand' | 'stale' | undefined {\n if (params.isOnDemandRevalidate) {\n return 'on-demand'\n }\n if (params.isRevalidate) {\n return 'stale'\n }\n return undefined\n}\n"],"names":["getRevalidateReason","params","isOnDemandRevalidate","isRevalidate","undefined"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,oBAAoBC,MAGnC;IACC,IAAIA,OAAOC,oBAAoB,EAAE;QAC/B,OAAO;IACT;IACA,IAAID,OAAOE,YAAY,EAAE;QACvB,OAAO;IACT;IACA,OAAOC;AACT"}