- ✅ Ticket 1.1: Estructura Clean Architecture en backend - ✅ Ticket 1.2: Schemas Zod compartidos - ✅ Ticket 1.3: Refactorización drugs.ts (1362 → 8 archivos modulares) - ✅ Ticket 1.4: Refactorización procedures.ts (3583 → 6 archivos modulares) - ✅ Ticket 1.5: Eliminación de duplicidades (~50 líneas) Cambios principales: - Creada estructura Clean Architecture en backend/src/ - Schemas Zod compartidos en backend/src/shared/schemas/ - Refactorización modular de drugs y procedures - Utilidades genéricas en src/utils/ (filter, validation) - Eliminados scripts obsoletos y documentación antigua - Corregidos errores: QueryClient, import test-error-handling - Build verificado y funcionando correctamente
62 lines
2.3 KiB
TypeScript
62 lines
2.3 KiB
TypeScript
import URL from '../../url/URL.js';
|
|
import BrowserWindow from '../../window/BrowserWindow.js';
|
|
import Headers from '../Headers.js';
|
|
import IRequestReferrerPolicy from '../types/IRequestReferrerPolicy.js';
|
|
import Request from '../Request.js';
|
|
/**
|
|
* Fetch referrer utility.
|
|
*/
|
|
export default class FetchRequestReferrerUtility {
|
|
/**
|
|
* Prepares the request before being sent.
|
|
*
|
|
* @param originURL Origin URL.
|
|
* @param request Request.
|
|
*/
|
|
static prepareRequest(originURL: URL, request: Request): void;
|
|
/**
|
|
* Returns initial referrer.
|
|
*
|
|
* @param window Window.
|
|
* @param referrer Referrer.
|
|
* @returns Initial referrer.
|
|
*/
|
|
static getInitialReferrer(window: BrowserWindow, referrer: '' | 'no-referrer' | 'client' | string | URL): '' | 'no-referrer' | 'client' | URL;
|
|
/**
|
|
* Returns referrer policy from header.
|
|
*
|
|
* @see https://w3c.github.io/webappsec-referrer-policy/#parse-referrer-policy-from-header
|
|
* @param headers Response headers
|
|
* @returns Policy.
|
|
*/
|
|
static getReferrerPolicyFromHeader(headers: Headers): IRequestReferrerPolicy;
|
|
/**
|
|
* Returns the request referrer to be used as the value for the "Referer" header.
|
|
*
|
|
* Based on:
|
|
* https://github.com/node-fetch/node-fetch/blob/main/src/utils/referrer.js (MIT)
|
|
*
|
|
* @see https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
|
|
* @param originURL Origin URL.
|
|
* @param request Request.
|
|
* @returns Request referrer.
|
|
*/
|
|
private static getSentReferrer;
|
|
/**
|
|
* Returns "true" if the request's referrer is potentially trustworthy.
|
|
*
|
|
* @see https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy
|
|
* @param url URL.
|
|
* @returns "true" if the request's referrer is potentially trustworthy.
|
|
*/
|
|
private static isURLPotentiallyTrustWorthy;
|
|
/**
|
|
* Returns "true" if the request's referrer origin is potentially trustworthy.
|
|
*
|
|
* @see https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy
|
|
* @param url URL.
|
|
* @returns "true" if the request's referrer origin is potentially trustworthy.
|
|
*/
|
|
private static isOriginPotentiallyTrustWorthy;
|
|
}
|
|
//# sourceMappingURL=FetchRequestReferrerUtility.d.ts.map
|