export const ACTIVE_DEV_PUBLIC_ENDPOINT = "http://74.48.78.17:16667"; export const ACTIVE_DEV_BROWSER_ENDPOINT = "http://74.48.78.17:16666"; export const DEPRECATED_DEV_PUBLIC_ENDPOINT = "http://74.48.78.17:6667"; export const DEPRECATED_RESERVED_PROD_ENDPOINT = "http://74.48.78.17:6666"; export const REPORT_LIFECYCLE_VERSION = "v1"; export const deprecatedPublicPorts = Object.freeze([6666, 6667]); export const deprecatedPublicEndpoints = Object.freeze([ DEPRECATED_DEV_PUBLIC_ENDPOINT, DEPRECATED_RESERVED_PROD_ENDPOINT ]); const deprecatedPublicEndpointPattern = /\bhttps?:\/\/74\.48\.78\.17:(666[67])(?=[/?#\s"'`),\]}]|$)/giu; const deprecatedPublicHostPortPattern = /(? item?.endpoint === endpoint); return Boolean( (legacyEndpoint && legacyEndpoint.endpoint === endpoint && legacyEndpoint.status === "deprecated" && legacyEndpoint.activeGreenEligible === false) || (deprecatedEndpoint && String(deprecatedEndpoint.status ?? "").includes("deprecated") && deprecatedEndpoint.activeGreenEligible === false) ); } export function findForbiddenActiveDeprecatedEndpoints(report, raw) { if (reportIsHistorical(report)) return []; return findDeprecatedPublicEndpoints(raw).filter( (endpoint) => !isDeprecatedEndpointAllowedInActiveReport(report, endpoint) ); } export function reportLifecycleState(report) { return report?.reportLifecycle?.state ?? "active"; } export function reportIsHistorical(report) { return reportLifecycleState(report) === "historical"; } export function activeReportLifecycle(summary) { return { version: REPORT_LIFECYCLE_VERSION, state: "active", activeEndpoint: ACTIVE_DEV_PUBLIC_ENDPOINT, activeBrowserEndpoint: ACTIVE_DEV_BROWSER_ENDPOINT, deprecatedEndpoint: null, summary }; } export function historicalReportLifecycle({ activeEndpoint = ACTIVE_DEV_PUBLIC_ENDPOINT, deprecatedEndpoint, summary }) { return { version: REPORT_LIFECYCLE_VERSION, state: "historical", activeEndpoint, activeBrowserEndpoint: ACTIVE_DEV_BROWSER_ENDPOINT, deprecatedEndpoint, summary }; }