Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
test(api): stop v1 snips at the v1 sunset and check the 410 (#5675)
Gergő Móricz5c57e8765e6c
diff --git a/apps/api/src/__tests__/snips/v1/batch-scrape.test.ts b/apps/api/src/__tests__/snips/v1/batch-scrape.test.tsindex f753937c3..7eb33d814 100644--- a/apps/api/src/__tests__/snips/v1/batch-scrape.test.ts+++ b/apps/api/src/__tests__/snips/v1/batch-scrape.test.ts@@ -5,7 +5,7 @@ import {TEST_PRODUCTION,TEST_SUITE_WEBSITE,} from "../lib";-import { batchScrape, scrapeTimeout, idmux, Identity } from "./lib";+import { batchScrape, describeV1, scrapeTimeout, idmux, Identity } from "./lib";let identity: Identity;@@ -17,7 +17,7 @@ beforeAll(async () => {});}, 10000);-describe("Batch scrape tests", () => {+describeV1()("Batch scrape tests", () => {concurrentIf(ALLOW_TEST_SUITE_WEBSITE)("works",async () => {diff --git a/apps/api/src/__tests__/snips/v1/billing.test.ts b/apps/api/src/__tests__/snips/v1/billing.test.tsindex 6c6c347b4..400f332dc 100644--- a/apps/api/src/__tests__/snips/v1/billing.test.ts+++ b/apps/api/src/__tests__/snips/v1/billing.test.ts@@ -1,8 +1,9 @@-import { describeIf, TEST_PRODUCTION, TEST_SUITE_WEBSITE } from "../lib";+import { TEST_PRODUCTION, TEST_SUITE_WEBSITE } from "../lib";import {batchScrape,crawl,creditUsage,+ describeV1,extract,idmux,map,@@ -17,7 +18,7 @@ const sleepForBatchBilling = () => sleep(40000);// TODO: can be combined with v2...?// TODO: fix up idmux// TODO: needs testing-describeIf(TEST_PRODUCTION)("Billing tests", () => {+describeV1(TEST_PRODUCTION)("Billing tests", () => {const base = TEST_SUITE_WEBSITE;it.concurrent(diff --git a/apps/api/src/__tests__/snips/v1/concurrency.test.ts b/apps/api/src/__tests__/snips/v1/concurrency.test.tsindex 8baf90f87..599378f7c 100644--- a/apps/api/src/__tests__/snips/v1/concurrency.test.ts+++ b/apps/api/src/__tests__/snips/v1/concurrency.test.ts@@ -1,13 +1,14 @@-import { describeIf, TEST_PRODUCTION, TEST_SUITE_WEBSITE } from "../lib";+import { TEST_PRODUCTION, TEST_SUITE_WEBSITE } from "../lib";import {batchScrapeWithConcurrencyTracking,crawlWithConcurrencyTracking,+ describeV1,idmux,} from "./lib";const accountConcurrencyLimit = 20;-describeIf(TEST_PRODUCTION)("Concurrency queue and limit", () => {+describeV1(TEST_PRODUCTION)("Concurrency queue and limit", () => {const base = TEST_SUITE_WEBSITE;it.concurrent(diff --git a/apps/api/src/__tests__/snips/v1/crawl.test.ts b/apps/api/src/__tests__/snips/v1/crawl.test.tsindex e0d8c8442..2ca627a81 100644--- a/apps/api/src/__tests__/snips/v1/crawl.test.ts+++ b/apps/api/src/__tests__/snips/v1/crawl.test.ts@@ -4,6 +4,7 @@ import {crawl,crawlOngoing,crawlStart,+ describeV1,Identity,idmux,scrapeTimeout,@@ -12,7 +13,6 @@ import request from "supertest";import { it, expect } from "vitest";import {ALLOW_TEST_SUITE_WEBSITE,- describeIf,TEST_API_URL,TEST_SUITE_WEBSITE,} from "../lib";@@ -27,7 +27,7 @@ beforeAll(async () => {});}, 10000);-describe("UUID validation", () => {+describeV1()("UUID validation", () => {it.concurrent("rejects malformed UUIDs for crawl status", async () => {const response = await request(TEST_API_URL).get("/v1/crawl/not-a-uuid")@@ -55,7 +55,7 @@ describe("UUID validation", () => {});});-describeIf(ALLOW_TEST_SUITE_WEBSITE)("Crawl tests", () => {+describeV1(ALLOW_TEST_SUITE_WEBSITE)("Crawl tests", () => {const base = TEST_SUITE_WEBSITE;const baseUrl = new URL(base);const baseDomain = baseUrl.hostname;diff --git a/apps/api/src/__tests__/snips/v1/deprecation.test.ts b/apps/api/src/__tests__/snips/v1/deprecation.test.tsindex 832e0cc81..d546ed857 100644--- a/apps/api/src/__tests__/snips/v1/deprecation.test.ts+++ b/apps/api/src/__tests__/snips/v1/deprecation.test.ts@@ -1,7 +1,9 @@import { describe, it, expect, beforeAll } from "vitest";import request from "supertest";-import { TEST_API_URL } from "../lib";-import { idmux, Identity } from "./lib";+import { itIf, TEST_API_URL } from "../lib";+import { idmux, Identity, V1_LIVE } from "./lib";++const itV1 = itIf(V1_LIVE);let identity: Identity;@@ -78,51 +80,85 @@ describe("Deprecation warnings on legacy endpoints", () => {expect(res.body.replacement).toBe("/v2/agent");}, 30000);- it("POST /v1/scrape points at /v2/scrape and the migration guide", async () => {- const res = await request(TEST_API_URL)- .post("/v1/scrape")- .set("Authorization", `Bearer ${identity.apiKey}`)- .set("Content-Type", "application/json")- .send({ url: "https://firecrawl.dev" });-- expect(res.statusCode).toBe(200);- expect(res.headers["deprecation"]).toBe("@1793923200");- expect(res.headers["sunset"]).toBe("Thu, 10 Dec 2026 15:00:00 GMT");- expect(res.headers["warning"]).toMatch(/\/v1\/scrape is deprecated/);- expect(res.headers["link"]).toBe(- '<https://docs.firecrawl.dev/migrate-to-v2>; rel="deprecation", </v2/scrape>; rel="successor-version"',- );- expect(res.body.warnings.some((w: string) => /\/v2\/scrape/.test(w))).toBe(- true,- );- expect(res.body.replacement).toBe("/v2/scrape");- }, 60000);-- it("GET /v1/team/credit-usage points at its v2 route", async () => {- const res = await request(TEST_API_URL)- .get("/v1/team/credit-usage")- .set("Authorization", `Bearer ${identity.apiKey}`);-- // Self-hosted has no billing client, so the status varies; the notice must not.- expect(res.headers["deprecation"]).toBe("@1793923200");- expect(res.headers["link"]).toContain(- '</v2/team/credit-usage>; rel="successor-version"',- );- expect(res.body.replacement).toBe("/v2/team/credit-usage");- }, 30000);-- it("GET /v1/concurrency-check points at its v2 route", async () => {- const res = await request(TEST_API_URL)- .get("/v1/concurrency-check")- .set("Authorization", `Bearer ${identity.apiKey}`);-- expect(res.statusCode).toBe(200);- expect(res.headers["deprecation"]).toBe("@1793923200");- expect(res.headers["link"]).toContain(- '</v2/concurrency-check>; rel="successor-version"',- );- expect(res.body.replacement).toBe("/v2/concurrency-check");- }, 30000);+ itV1(+ "POST /v1/scrape points at /v2/scrape and the migration guide",+ async () => {+ const res = await request(TEST_API_URL)+ .post("/v1/scrape")+ .set("Authorization", `Bearer ${identity.apiKey}`)+ .set("Content-Type", "application/json")+ .send({ url: "https://firecrawl.dev" });++ expect(res.statusCode).toBe(200);+ expect(res.headers["deprecation"]).toBe("@1793923200");+ expect(res.headers["sunset"]).toBe("Thu, 10 Dec 2026 15:00:00 GMT");+ expect(res.headers["warning"]).toMatch(/\/v1\/scrape is deprecated/);+ expect(res.headers["link"]).toBe(+ '<https://docs.firecrawl.dev/migrate-to-v2>; rel="deprecation", </v2/scrape>; rel="successor-version"',+ );+ expect(+ res.body.warnings.some((w: string) => /\/v2\/scrape/.test(w)),+ ).toBe(true);+ expect(res.body.replacement).toBe("/v2/scrape");+ },+ 60000,+ );++ itV1(+ "GET /v1/team/credit-usage points at its v2 route",+ async () => {+ const res = await request(TEST_API_URL)+ .get("/v1/team/credit-usage")+ .set("Authorization", `Bearer ${identity.apiKey}`);++ // Self-hosted has no billing client, so the status varies; the notice must not.+ expect(res.headers["deprecation"]).toBe("@1793923200");+ expect(res.headers["link"]).toContain(+ '</v2/team/credit-usage>; rel="successor-version"',+ );+ expect(res.body.replacement).toBe("/v2/team/credit-usage");+ },+ 30000,+ );++ itV1(+ "GET /v1/concurrency-check points at its v2 route",+ async () => {+ const res = await request(TEST_API_URL)+ .get("/v1/concurrency-check")+ .set("Authorization", `Bearer ${identity.apiKey}`);++ expect(res.statusCode).toBe(200);+ expect(res.headers["deprecation"]).toBe("@1793923200");+ expect(res.headers["link"]).toContain(+ '</v2/concurrency-check>; rel="successor-version"',+ );+ expect(res.body.replacement).toBe("/v2/concurrency-check");+ },+ 30000,+ );++ itIf(!V1_LIVE).each([+ ["post", "/v1/scrape", "/v2/scrape"],+ ["get", "/v1/team/credit-usage", "/v2/team/credit-usage"],+ ["get", "/v1/concurrency-check", "/v2/concurrency-check"],+ ] as const)(+ "%s %s answers 410 after the v1 sunset",+ async (method, path, replacement) => {+ const res = await request(TEST_API_URL)+ [method](path)+ .set("Authorization", `Bearer ${identity.apiKey}`);++ expect(res.statusCode).toBe(410);+ expect(res.body.code).toBe("ENDPOINT_REMOVED");+ expect(res.body.replacement).toBe(replacement);+ expect(res.body.documentation_url).toBe(+ "https://docs.firecrawl.dev/migrate-to-v2",+ );+ expect(res.headers["sunset"]).toBe("Thu, 10 Dec 2026 15:00:00 GMT");+ },+ 30000,+ );it("non-deprecated endpoints do not emit Deprecation header or warnings", async () => {const res = await request(TEST_API_URL)diff --git a/apps/api/src/__tests__/snips/v1/json-extract-format.test.ts b/apps/api/src/__tests__/snips/v1/json-extract-format.test.tsindex fa203c3de..8c2c6b384 100644--- a/apps/api/src/__tests__/snips/v1/json-extract-format.test.ts+++ b/apps/api/src/__tests__/snips/v1/json-extract-format.test.ts@@ -1,11 +1,10 @@import {ALLOW_TEST_SUITE_WEBSITE,- describeIf,HAS_AI,TEST_PRODUCTION,TEST_SUITE_WEBSITE,} from "../lib";-import { scrape, scrapeTimeout, idmux, Identity } from "./lib";+import { describeV1, scrape, scrapeTimeout, idmux, Identity } from "./lib";let identity: Identity;@@ -17,7 +16,7 @@ beforeAll(async () => {});}, 10000 + scrapeTimeout);-describeIf(TEST_PRODUCTION || (HAS_AI && ALLOW_TEST_SUITE_WEBSITE))(+describeV1(TEST_PRODUCTION || (HAS_AI && ALLOW_TEST_SUITE_WEBSITE))("V1 JSON/Extract Format Backward Compatibility",() => {describe("extract format", () => {diff --git a/apps/api/src/__tests__/snips/v1/json-extract-prompt-injection.test.ts b/apps/api/src/__tests__/snips/v1/json-extract-prompt-injection.test.tsindex 11bac4c1f..384d28306 100644--- a/apps/api/src/__tests__/snips/v1/json-extract-prompt-injection.test.ts+++ b/apps/api/src/__tests__/snips/v1/json-extract-prompt-injection.test.ts@@ -1,12 +1,12 @@import {ALLOW_TEST_SUITE_WEBSITE,- describeIf,HAS_AI,concurrentIf,TEST_PRODUCTION,TEST_SUITE_WEBSITE,} from "../lib";import {+ describeV1,scrape,scrapeRaw,creditUsage,@@ -36,7 +36,7 @@ const schema = {required: ["title"],};-describeIf(TEST_PRODUCTION || (HAS_AI && ALLOW_TEST_SUITE_WEBSITE))(+describeV1(TEST_PRODUCTION || (HAS_AI && ALLOW_TEST_SUITE_WEBSITE))("V1 JSON prompt-injection check",() => {it.concurrent(diff --git a/apps/api/src/__tests__/snips/v1/lib.ts b/apps/api/src/__tests__/snips/v1/lib.tsindex bc68c19d5..567e622bc 100644--- a/apps/api/src/__tests__/snips/v1/lib.ts+++ b/apps/api/src/__tests__/snips/v1/lib.ts@@ -17,15 +17,22 @@ import {import request from "supertest";import {TEST_API_URL,+ describeIf,scrapeTimeout,indexCooldown,Identity,idmux,} from "../lib";+import { sunsetOf } from "../../../lib/deprecations";// Re-export shared utilities for backwards compatibilityexport { scrapeTimeout, indexCooldown, Identity, idmux };+// From the v1 sunset every v1 route answers 410, so suites that expect its+// old behavior stop running.+export const V1_LIVE = Date.now() < sunsetOf("v1_scrape");+export const describeV1 = (cond = true) => describeIf(V1_LIVE && cond);+const pollSleep = async () => new Promise(r => setTimeout(r, 50));export async function scrapeRaw(body: ScrapeRequestInput, identity: Identity) {diff --git a/apps/api/src/__tests__/snips/v1/map.test.ts b/apps/api/src/__tests__/snips/v1/map.test.tsindex 33ee0a6f5..190240642 100644--- a/apps/api/src/__tests__/snips/v1/map.test.ts+++ b/apps/api/src/__tests__/snips/v1/map.test.ts@@ -3,7 +3,7 @@ import {concurrentIf,TEST_SUITE_WEBSITE,} from "../lib";-import { expectMapToSucceed, map, idmux, Identity } from "./lib";+import { describeV1, expectMapToSucceed, map, idmux, Identity } from "./lib";let identity: Identity;@@ -16,7 +16,7 @@ beforeAll(async () => {}, 10000);// TODO: is map meant for self-host?-describe("Map tests", () => {+describeV1()("Map tests", () => {const base = TEST_SUITE_WEBSITE;concurrentIf(ALLOW_TEST_SUITE_WEBSITE)(diff --git a/apps/api/src/__tests__/snips/v1/menu.test.ts b/apps/api/src/__tests__/snips/v1/menu.test.tsindex e07f77725..941c927a8 100644--- a/apps/api/src/__tests__/snips/v1/menu.test.ts+++ b/apps/api/src/__tests__/snips/v1/menu.test.ts@@ -1,9 +1,5 @@-import {- ALLOW_TEST_SUITE_WEBSITE,- describeIf,- TEST_SUITE_WEBSITE,-} from "../lib";-import { scrape, scrapeTimeout, idmux, Identity } from "./lib";+import { ALLOW_TEST_SUITE_WEBSITE, TEST_SUITE_WEBSITE } from "../lib";+import { describeV1, scrape, scrapeTimeout, idmux, Identity } from "./lib";let identity: Identity;@@ -21,7 +17,7 @@ beforeAll(async () => {// byte-identical in shape to a pre-feature v1 scrape (no `menu`, no spurious// `warning`, markdown + metadata intact). The menu transformer is shared across// v1/v2, so this guards the v1 format gate specifically.-describeIf(ALLOW_TEST_SUITE_WEBSITE)(+describeV1(ALLOW_TEST_SUITE_WEBSITE)("Menu scrape format (v1 back-compat)",() => {const base = TEST_SUITE_WEBSITE;diff --git a/apps/api/src/__tests__/snips/v1/product.test.ts b/apps/api/src/__tests__/snips/v1/product.test.tsindex 4f591e32d..3f83bb10a 100644--- a/apps/api/src/__tests__/snips/v1/product.test.ts+++ b/apps/api/src/__tests__/snips/v1/product.test.ts@@ -1,9 +1,5 @@-import {- ALLOW_TEST_SUITE_WEBSITE,- describeIf,- TEST_SUITE_WEBSITE,-} from "../lib";-import { scrape, scrapeTimeout, idmux, Identity } from "./lib";+import { ALLOW_TEST_SUITE_WEBSITE, TEST_SUITE_WEBSITE } from "../lib";+import { describeV1, scrape, scrapeTimeout, idmux, Identity } from "./lib";let identity: Identity;@@ -21,7 +17,7 @@ beforeAll(async () => {// format is byte-identical in shape to a pre-feature v1 scrape (no `product`,// no spurious `warning`, markdown + metadata intact). The product transformer// is shared across v1/v2, so this guards the v1 format gate specifically.-describeIf(ALLOW_TEST_SUITE_WEBSITE)(+describeV1(ALLOW_TEST_SUITE_WEBSITE)("Product scrape format (v1 back-compat)",() => {const base = TEST_SUITE_WEBSITE;diff --git a/apps/api/src/__tests__/snips/v1/scrape.test.ts b/apps/api/src/__tests__/snips/v1/scrape.test.tsindex 2e851b0d4..307aecb74 100644--- a/apps/api/src/__tests__/snips/v1/scrape.test.ts+++ b/apps/api/src/__tests__/snips/v1/scrape.test.ts@@ -23,6 +23,8 @@ import {Identity,scrapeRaw,extract,+ describeV1,+ V1_LIVE,} from "./lib";import crypto from "crypto";@@ -37,7 +39,7 @@ beforeAll(async () => {credits: 1000000,});- if (TEST_PRODUCTION) {+ if (TEST_PRODUCTION && V1_LIVE) {await scrape({url: CHANGE_TRACKING_TEST_URL,@@ -48,7 +50,7 @@ beforeAll(async () => {}}, 10000 + scrapeTimeout);-describe("Scrape tests", () => {+describeV1()("Scrape tests", () => {const base = TEST_SUITE_WEBSITE;concurrentIf(ALLOW_TEST_SUITE_WEBSITE)(diff --git a/apps/api/src/__tests__/snips/v1/search.test.ts b/apps/api/src/__tests__/snips/v1/search.test.tsindex a7956292e..38463aba1 100644--- a/apps/api/src/__tests__/snips/v1/search.test.ts+++ b/apps/api/src/__tests__/snips/v1/search.test.ts@@ -1,5 +1,5 @@-import { describeIf, HAS_PROXY, HAS_SEARCH, TEST_PRODUCTION } from "../lib";-import { search, searchRaw, idmux, Identity } from "./lib";+import { HAS_PROXY, HAS_SEARCH, TEST_PRODUCTION } from "../lib";+import { describeV1, search, searchRaw, idmux, Identity } from "./lib";let identity: Identity;@@ -12,7 +12,7 @@ beforeAll(async () => {}, 10000);// NOTE: if DDG gives us issues with this, we can disable if SEARXNG is not enabled-describeIf(TEST_PRODUCTION || HAS_SEARCH || HAS_PROXY)("Search tests", () => {+describeV1(TEST_PRODUCTION || HAS_SEARCH || HAS_PROXY)("Search tests", () => {it.concurrent("works",async () => {diff --git a/apps/api/src/__tests__/snips/v1/zdr.test.ts b/apps/api/src/__tests__/snips/v1/zdr.test.tsindex 9f823332f..cc93549e7 100644--- a/apps/api/src/__tests__/snips/v1/zdr.test.ts+++ b/apps/api/src/__tests__/snips/v1/zdr.test.ts@@ -6,8 +6,9 @@ import {scrapeStatusRaw,zdrcleaner,idmux,+ describeV1,} from "./lib";-import { describeIf, TEST_PRODUCTION } from "../lib";+import { TEST_PRODUCTION } from "../lib";import {getLogs,expectScrapeIsCleanedUp,@@ -18,7 +19,7 @@ import {} from "../zdr-helpers";import { HAS_JOB_LOG } from "../job-log";-describeIf(TEST_PRODUCTION && HAS_JOB_LOG)("Zero Data Retention", () => {+describeV1(TEST_PRODUCTION && HAS_JOB_LOG)("Zero Data Retention", () => {describe.each(["Team-scoped", "Request-scoped"] as const)("%s", scope => {it("should clean up a scrape immediately", async () => {let identity = await idmux({diff --git a/apps/api/src/__tests__/snips/v2/integration-header.test.ts b/apps/api/src/__tests__/snips/v2/integration-header.test.tsindex 3e127bdcf..e0b301783 100644--- a/apps/api/src/__tests__/snips/v2/integration-header.test.ts+++ b/apps/api/src/__tests__/snips/v2/integration-header.test.ts@@ -6,6 +6,7 @@ import {describeIf,} from "../lib";import request, { idmux, Identity, scrapeTimeout, TEST_API_URL } from "./lib";+import { V1_LIVE } from "../v1/lib";import { HAS_JOB_LOG, waitForJobLogRow } from "../job-log";const CAN_READ_LOG = !!config.USE_DB_AUTHENTICATION && HAS_JOB_LOG;@@ -46,7 +47,11 @@ describeIf(ALLOW_TEST_SUITE_WEBSITE)("X-Integration header", () => {});}, 10000);- concurrentIf(CAN_READ_LOG).each(["/v1/scrape", "/v2/scrape"] as const)(+ concurrentIf(CAN_READ_LOG).each(+ V1_LIVE+ ? (["/v1/scrape", "/v2/scrape"] as const)+ : (["/v2/scrape"] as const),+ )("attributes %s to a header-only integration",async path => {const url = createTestIdUrl();diff --git a/apps/api/src/__tests__/snips/v2/keyless.test.ts b/apps/api/src/__tests__/snips/v2/keyless.test.tsindex 7e37b5d2f..799f7f304 100644--- a/apps/api/src/__tests__/snips/v2/keyless.test.ts+++ b/apps/api/src/__tests__/snips/v2/keyless.test.ts@@ -20,6 +20,7 @@ import {keylessTeamId,reserveKeylessCredits,} from "../../../lib/keyless";+import { V1_LIVE } from "../v1/lib";// The keyless tier is disabled unless both limits are configured. The harness// passes the shell env through to the server, so we read the same env here and@@ -393,7 +394,7 @@ describeIf(KEYLESS_ENABLED)("Keyless free tier", () => {scrapeTimeout,);- it(+ itIf(V1_LIVE)("rejects projected multi-credit v1 keyless scrape before scraping (429)",async () => {await request(TEST_API_URL)@@ -565,7 +566,7 @@ describeIf(KEYLESS_ENABLED)("Keyless free tier", () => {scrapeTimeout,);- it(+ itIf(V1_LIVE)("rejects projected v1 keyless search with scrape options before search (429)",async () => {await request(TEST_API_URL)diff --git a/apps/api/src/__tests__/snips/v2/safe-mode.test.ts b/apps/api/src/__tests__/snips/v2/safe-mode.test.tsindex fd1174d7e..749b54b4d 100644--- a/apps/api/src/__tests__/snips/v2/safe-mode.test.ts+++ b/apps/api/src/__tests__/snips/v2/safe-mode.test.ts@@ -12,6 +12,7 @@ import {TEST_SUITE_WEBSITE,} from "../lib";import { scrape, scrapeRaw, crawlStart } from "./lib";+import { V1_LIVE } from "../v1/lib";const TEST_SUITE_HOST = new URL(TEST_SUITE_WEBSITE).hostname;@@ -46,7 +47,7 @@ describe("Safe Mode (v2 scrape, request-time)", () => {scrapeTimeout,);- it.concurrent(+ concurrentIf(V1_LIVE)("v1 accepts + honors the safeMode param (rejects safeMode: true)",async () => {const res = await request(TEST_API_URL)diff --git a/apps/api/src/lib/deprecations.ts b/apps/api/src/lib/deprecations.tsindex 8ce030db3..ad45b4d66 100644--- a/apps/api/src/lib/deprecations.ts+++ b/apps/api/src/lib/deprecations.ts@@ -339,6 +339,12 @@ export function sunsetInstant(key: string, sunset: string | undefined): number {return at;}+/** When the entry's route starts answering 410, Infinity without a sunset. */+export function sunsetOf(key: DeprecationKey): number {+ const dep: Deprecation = DEPRECATIONS[key];+ return sunsetInstant(key, dep.sunset);+}+const EXTENSION_UNTIL = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?Z)?$/;/**@@ -367,7 +373,7 @@ export function hasSunsetExtension(*/export function deprecationMiddleware(key: DeprecationKey) {const dep: Deprecation = DEPRECATIONS[key];- const sunsetAt = sunsetInstant(key, dep.sunset);+ const sunsetAt = sunsetOf(key);const annotate = (res: Response) => {setDeprecationHeaders(res, dep);