Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

refactor(api): rename the code search surface to developer

Karan Lokchandanif9931facea9c
diff --git a/apps/api/src/__tests__/snips/v2/code.test.ts b/apps/api/src/__tests__/snips/v2/developer.test.ts
similarity index 88%
rename from apps/api/src/__tests__/snips/v2/code.test.ts
rename to apps/api/src/__tests__/snips/v2/developer.test.ts
index 0ab3caaac..6447b13c2 100644
--- a/apps/api/src/__tests__/snips/v2/code.test.ts
+++ b/apps/api/src/__tests__/snips/v2/developer.test.ts
@@ -10,8 +10,8 @@ const KEYLESS_ENABLED =
process.env.KEYLESS_REQUESTS_PER_DAY !== undefined &&
process.env.KEYLESS_CREDITS_PER_DAY !== undefined;
-const CANONICAL_PATH = "/v2/search/code/search";
-const UPSTREAM_MIRROR_PATH = "/v2/code/search";
+const CANONICAL_PATH = "/v2/search/developer/search";
+const UPSTREAM_MIRROR_PATH = "/v2/developer/search";
const COVERAGE_STATUSES = ["ok", "degraded", "unavailable", "skipped"];
@@ -32,10 +32,10 @@ async function waitForSingleRow<T>(
return null;
}
-describeIf(HAS_RESEARCH)("Code Search API", () => {
- it("serves code search from the canonical mount", async () => {
+describeIf(HAS_RESEARCH)("Developer Search API", () => {
+ it("serves developer search from the canonical mount", async () => {
const identity = await idmux({
- name: "code/canonical search",
+ name: "developer/canonical search",
credits: 100,
});
@@ -64,7 +64,7 @@ describeIf(HAS_RESEARCH)("Code Search API", () => {
it("serves the same search from a POST body", async () => {
const identity = await idmux({
- name: "code/post body",
+ name: "developer/post body",
credits: 100,
});
@@ -84,9 +84,9 @@ describeIf(HAS_RESEARCH)("Code Search API", () => {
expect(res.body.coverage.pull_request).toBe("skipped");
}, 120000);
- it("serves code search from the upstream-mirror mount", async () => {
+ it("serves developer search from the upstream-mirror mount", async () => {
const identity = await idmux({
- name: "code/mirror mount",
+ name: "developer/mirror mount",
credits: 100,
});
@@ -103,7 +103,7 @@ describeIf(HAS_RESEARCH)("Code Search API", () => {
it("keeps the upstream casing on repo enrollment status", async () => {
const identity = await idmux({
- name: "code/repo status casing",
+ name: "developer/repo status casing",
credits: 100,
});
@@ -128,7 +128,7 @@ describeIf(HAS_RESEARCH)("Code Search API", () => {
it("rejects unknown params and an out-of-bound k", async () => {
const identity = await idmux({
- name: "code/invalid input",
+ name: "developer/invalid input",
credits: 100,
});
@@ -142,14 +142,14 @@ describeIf(HAS_RESEARCH)("Code Search API", () => {
}
});
- it("logs the code search request kind with origin and integration", async () => {
+ it("logs the developer search request kind with origin and integration", async () => {
if (!config.USE_DB_AUTHENTICATION) return;
const identity = await idmux({
- name: "code/logs metadata",
+ name: "developer/logs metadata",
credits: 100,
});
- const query = `code metadata ${Date.now()}`;
+ const query = `developer metadata ${Date.now()}`;
const res = await researchRaw(
CANONICAL_PATH,
@@ -192,10 +192,10 @@ describeIf(HAS_RESEARCH)("Code Search API", () => {
if (!config.USE_DB_AUTHENTICATION) return;
const identity = await idmux({
- name: "code/logs usage",
+ name: "developer/logs usage",
credits: 100,
});
- const query = `code usage ${Date.now()}`;
+ const query = `developer usage ${Date.now()}`;
const res = await researchRaw(CANONICAL_PATH, { query, k: 3 }, identity);
expect(res.statusCode).toBe(200);
@@ -225,7 +225,7 @@ describeIf(HAS_RESEARCH)("Code Search API", () => {
expect(usageLog?.credits_cost).toBe(expected);
}, 120000);
- describeIf(KEYLESS_ENABLED)("keyless code search", () => {
+ describeIf(KEYLESS_ENABLED)("keyless developer search", () => {
it("permits keyless access on the canonical mount", async () => {
const res = await researchRaw(CANONICAL_PATH, {
query: "retry backoff",
@@ -247,10 +247,10 @@ describeIf(HAS_RESEARCH)("Code Search API", () => {
}, 120000);
});
- describeIf(TEST_PRODUCTION)("code search billing", () => {
+ describeIf(TEST_PRODUCTION)("developer search billing", () => {
it("bills by returned result count", async () => {
const identity = await idmux({
- name: "code/bills by results",
+ name: "developer/bills by results",
credits: 100,
});
const before = (await creditUsage(identity)).remainingCredits;
diff --git a/apps/api/src/__tests__/snips/v2/key-restriction.test.ts b/apps/api/src/__tests__/snips/v2/key-restriction.test.ts
index cc8050817..3e63502d2 100644
--- a/apps/api/src/__tests__/snips/v2/key-restriction.test.ts
+++ b/apps/api/src/__tests__/snips/v2/key-restriction.test.ts
@@ -138,10 +138,10 @@ describeIf(TEST_PRODUCTION)(
);
it.concurrent(
- "gates the code search category on the research group",
+ "gates the developer search category on the research group",
async () => {
const identity = await idmux({
- name: "key-restriction/code-category",
+ name: "key-restriction/developer-category",
credits: 10000,
flags: { keyRestriction: true },
});
@@ -150,13 +150,13 @@ describeIf(TEST_PRODUCTION)(
const plain = await searchRaw({ query: "retries" }, identity);
expect(plain.statusCode).toBe(200);
- const withCode = await searchRaw(
- { query: "retries", categories: ["code"] },
+ const withDeveloper = await searchRaw(
+ { query: "retries", categories: ["developer"] },
identity,
);
- expect(withCode.statusCode).toBe(403);
- expect(withCode.body.success).toBe(false);
- expect(withCode.body.error).toContain(
+ expect(withDeveloper.statusCode).toBe(403);
+ expect(withDeveloper.body.success).toBe(false);
+ expect(withDeveloper.body.error).toContain(
"restricted to the following endpoints",
);
},
diff --git a/apps/api/src/__tests__/snips/v2/types-validation.test.ts b/apps/api/src/__tests__/snips/v2/types-validation.test.ts
index 1626e9368..05dfe895e 100644
--- a/apps/api/src/__tests__/snips/v2/types-validation.test.ts
+++ b/apps/api/src/__tests__/snips/v2/types-validation.test.ts
@@ -1025,23 +1025,23 @@ describe("V2 Types Validation", () => {
]);
});
- it("should accept the code category and reject code search params", () => {
+ it("should accept the developer category and reject its params", () => {
expect(
- searchRequestSchema.parse({ query: "test", categories: ["code"] })
+ searchRequestSchema.parse({ query: "test", categories: ["developer"] })
.categories,
- ).toEqual([{ type: "code" }]);
+ ).toEqual([{ type: "developer" }]);
expect(
searchRequestSchema.parse({
query: "test",
- categories: [{ type: "code" }],
+ categories: [{ type: "developer" }],
}).categories,
- ).toEqual([{ type: "code" }]);
+ ).toEqual([{ type: "developer" }]);
expect(() =>
searchRequestSchema.parse({
query: "test",
- categories: [{ type: "code", repos: ["firecrawl/firecrawl"] }],
+ categories: [{ type: "developer", repos: ["firecrawl/firecrawl"] }],
}),
).toThrow();
});
diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts
index f72628e3a..da064b371 100644
--- a/apps/api/src/controllers/auth.ts
+++ b/apps/api/src/controllers/auth.ts
@@ -478,8 +478,8 @@ async function handleKeylessAuth(
? "search"
: mode === RateLimiterMode.Research
? "research"
- : mode === RateLimiterMode.CodeSearch
- ? "code"
+ : mode === RateLimiterMode.DeveloperSearch
+ ? "developer"
: mode === RateLimiterMode.BrowserExecute
? "interact"
: "scrape";
diff --git a/apps/api/src/controllers/v2/research-proxy.ts b/apps/api/src/controllers/v2/research-proxy.ts
index 7cff76a65..b4120cc5e 100644
--- a/apps/api/src/controllers/v2/research-proxy.ts
+++ b/apps/api/src/controllers/v2/research-proxy.ts
@@ -93,7 +93,7 @@ const booleanFlag = z
value === undefined ? undefined : value === true || value === "true",
);
-const codeSearchSchema = z.strictObject({
+const developerSearchSchema = z.strictObject({
query: z.string().min(1),
k: kSchema(100),
types: multiString,
@@ -110,7 +110,7 @@ const codeSearchSchema = z.strictObject({
...commonQuery,
});
-const CODE_SEARCH_QUERY_KEYS = [
+const DEVELOPER_SEARCH_QUERY_KEYS = [
"query",
"k",
"types",
@@ -489,18 +489,22 @@ export function createResearchRouter(options: { legacy?: boolean } = {}) {
return router;
}
-export function createCodeRouter() {
+export function createDeveloperRouter() {
const router = express.Router();
const controller = wrap(
- createResearchController(codeSearchSchema, CODE_SEARCH_QUERY_KEYS, {
- kind: "code_search",
- table: "code_searches",
- action: "searchCode",
- targetHint: params => String(params.query),
- upstreamPath: () => "/v2/code/search",
- billAs: "search",
- }),
+ createResearchController(
+ developerSearchSchema,
+ DEVELOPER_SEARCH_QUERY_KEYS,
+ {
+ kind: "code_search",
+ table: "code_searches",
+ action: "searchDeveloper",
+ targetHint: params => String(params.query),
+ upstreamPath: () => "/v2/code/search",
+ billAs: "search",
+ },
+ ),
);
router.get("/search", controller);
diff --git a/apps/api/src/controllers/v2/search.ts b/apps/api/src/controllers/v2/search.ts
index 237722ba0..e0f70f3de 100644
--- a/apps/api/src/controllers/v2/search.ts
+++ b/apps/api/src/controllers/v2/search.ts
@@ -35,7 +35,7 @@ import {
checkKeyFormatRestriction,
formatTypesOf,
} from "../../lib/key-restriction";
-import { wantsCodeCategory } from "../../search/code";
+import { wantsDeveloperCategory } from "../../search/developer";
export async function searchController(
req: RequestWithAuth<{}, SearchResponse, SearchRequest>,
@@ -87,16 +87,16 @@ export async function searchController(
});
}
- if (wantsCodeCategory(req.body.categories as CategoryOption[])) {
- const codeRestriction = await checkKeyEndpointRestriction(
- "/v2/code/search",
+ if (wantsDeveloperCategory(req.body.categories as CategoryOption[])) {
+ const developerRestriction = await checkKeyEndpointRestriction(
+ "/v2/developer/search",
req.acuc?.api_key_id,
req.acuc?.flags ?? null,
);
- if (!codeRestriction.allowed) {
- return res.status(codeRestriction.status).json({
+ if (!developerRestriction.allowed) {
+ return res.status(developerRestriction.status).json({
success: false,
- error: codeRestriction.error,
+ error: developerRestriction.error,
});
}
}
diff --git a/apps/api/src/controllers/v2/types.ts b/apps/api/src/controllers/v2/types.ts
index 952bc7f38..75266121d 100644
--- a/apps/api/src/controllers/v2/types.ts
+++ b/apps/api/src/controllers/v2/types.ts
@@ -1909,8 +1909,8 @@ const pdfCategoryOptions = z.strictObject({
type: z.literal("pdf"),
});
-const codeCategoryOptions = z.strictObject({
- type: z.literal("code"),
+const developerCategoryOptions = z.strictObject({
+ type: z.literal("developer"),
});
const searchDomainSchema = z
@@ -1949,14 +1949,14 @@ export const searchRequestSchema = z
categories: z
.union([
// Array of strings (simple format)
- z.array(z.enum(["github", "research", "pdf", "code"])),
+ z.array(z.enum(["github", "research", "pdf", "developer"])),
// Array of objects (advanced format)
z.array(
z.union([
githubCategoryOptions,
researchCategoryOptions,
pdfCategoryOptions,
- codeCategoryOptions,
+ developerCategoryOptions,
]),
),
])
@@ -2091,9 +2091,9 @@ export const searchRequestSchema = z
return {
type: "pdf" as const,
};
- case "code":
+ case "developer":
return {
- type: "code" as const,
+ type: "developer" as const,
};
default:
return { type: c as any };
diff --git a/apps/api/src/lib/entities.ts b/apps/api/src/lib/entities.ts
index e8ffc8926..130add82c 100644
--- a/apps/api/src/lib/entities.ts
+++ b/apps/api/src/lib/entities.ts
@@ -167,7 +167,7 @@ export interface SearchV2Response {
web?: WebSearchResult[];
images?: ImageSearchResult[];
news?: NewsSearchResult[];
- code?: WebSearchResult[];
+ developer?: WebSearchResult[];
}
export interface ScrapeActionContent {
diff --git a/apps/api/src/lib/key-restriction.test.ts b/apps/api/src/lib/key-restriction.test.ts
index dc3a9d773..4c54873c0 100644
--- a/apps/api/src/lib/key-restriction.test.ts
+++ b/apps/api/src/lib/key-restriction.test.ts
@@ -84,11 +84,11 @@ describe("classifyEndpoint", () => {
expect(classifyEndpoint("/v2/search")).toMatchObject({ group: "search" });
});
- it("groups code search with research on both mounts", () => {
- expect(classifyEndpoint("/v2/search/code/search")).toMatchObject({
+ it("groups developer search with research on both mounts", () => {
+ expect(classifyEndpoint("/v2/search/developer/search")).toMatchObject({
group: "research",
});
- expect(classifyEndpoint("/v2/code/search")).toMatchObject({
+ expect(classifyEndpoint("/v2/developer/search")).toMatchObject({
group: "research",
});
});
@@ -145,17 +145,19 @@ describe("isEndpointAllowed", () => {
expect(isEndpointAllowed("/v2/search", c).allowed).toBe(false);
});
- it("gates code search on the research group, not the web-search group", () => {
+ it("gates developer search on the research group, not the web-search group", () => {
const research = config({ allowedEndpoints: ["research"] });
- expect(isEndpointAllowed("/v2/search/code/search", research).allowed).toBe(
+ expect(
+ isEndpointAllowed("/v2/search/developer/search", research).allowed,
+ ).toBe(true);
+ expect(isEndpointAllowed("/v2/developer/search", research).allowed).toBe(
true,
);
- expect(isEndpointAllowed("/v2/code/search", research).allowed).toBe(true);
const webSearch = config({ allowedEndpoints: ["search"] });
- expect(isEndpointAllowed("/v2/search/code/search", webSearch).allowed).toBe(
- false,
- );
+ expect(
+ isEndpointAllowed("/v2/search/developer/search", webSearch).allowed,
+ ).toBe(false);
});
it("always allows account/metadata endpoints for restricted keys", () => {
diff --git a/apps/api/src/lib/key-restriction.ts b/apps/api/src/lib/key-restriction.ts
index fc8d2fced..1de6f96e8 100644
--- a/apps/api/src/lib/key-restriction.ts
+++ b/apps/api/src/lib/key-restriction.ts
@@ -111,7 +111,7 @@ const ENDPOINT_GROUPS: [string[], string][] = [
[["crawl"], "crawl"],
[["map"], "map"],
[["search", "research"], "research"],
- [["search", "code"], "research"],
+ [["search", "developer"], "research"],
[["search"], "search"],
[["extract"], "extract"],
[["agent"], "agent"],
@@ -120,7 +120,7 @@ const ENDPOINT_GROUPS: [string[], string][] = [
[["interact"], "browser"],
[["monitor"], "monitor"],
[["research"], "research"],
- [["code"], "research"],
+ [["developer"], "research"],
[["llmstxt"], "llmstxt"],
[["deep-research"], "deep-research"],
[["fireclaw"], "fireclaw"],
diff --git a/apps/api/src/lib/search-query-builder.ts b/apps/api/src/lib/search-query-builder.ts
index 467a001cf..0102db692 100644
--- a/apps/api/src/lib/search-query-builder.ts
+++ b/apps/api/src/lib/search-query-builder.ts
@@ -4,7 +4,7 @@
*/
interface CategoryInput {
- type: "github" | "research" | "pdf" | "code";
+ type: "github" | "research" | "pdf" | "developer";
sites?: string[];
}
diff --git a/apps/api/src/routes/v2.ts b/apps/api/src/routes/v2.ts
index 78c077131..b9cb9f2d5 100644
--- a/apps/api/src/routes/v2.ts
+++ b/apps/api/src/routes/v2.ts
@@ -80,7 +80,7 @@ import {
} from "../controllers/v2/team-siem-logging";
import { supportProxyController } from "../controllers/v2/support-proxy";
import {
- createCodeRouter,
+ createDeveloperRouter,
createResearchRouter,
} from "../controllers/v2/research-proxy";
import {
@@ -647,14 +647,14 @@ if (config.RESEARCH_PROXY_URL) {
);
v2Router.use(
- "/search/code",
- authMiddleware(RateLimiterMode.CodeSearch, { allowKeyless: true }),
- createCodeRouter(),
+ "/search/developer",
+ authMiddleware(RateLimiterMode.DeveloperSearch, { allowKeyless: true }),
+ createDeveloperRouter(),
);
v2Router.use(
- "/code",
- authMiddleware(RateLimiterMode.CodeSearch),
- createCodeRouter(),
+ "/developer",
+ authMiddleware(RateLimiterMode.DeveloperSearch),
+ createDeveloperRouter(),
);
}
diff --git a/apps/api/src/search/code.test.ts b/apps/api/src/search/developer.test.ts
similarity index 81%
rename from apps/api/src/search/code.test.ts
rename to apps/api/src/search/developer.test.ts
index 71781a979..3035c04e1 100644
--- a/apps/api/src/search/code.test.ts
+++ b/apps/api/src/search/developer.test.ts
@@ -8,7 +8,7 @@ vi.mock("../config", () => ({
}));
import { fetch } from "undici";
-import { searchCodeCategory, wantsCodeCategory } from "./code";
+import { searchDeveloperCategory, wantsDeveloperCategory } from "./developer";
const fetchMock = vi.mocked(fetch);
@@ -30,20 +30,20 @@ afterEach(() => {
vi.clearAllMocks();
});
-describe("wantsCodeCategory", () => {
+describe("wantsDeveloperCategory", () => {
it("reads both the string form and the object form", () => {
- expect(wantsCodeCategory(["code"])).toBe(true);
- expect(wantsCodeCategory([{ type: "code" }])).toBe(true);
- expect(wantsCodeCategory(["github", "research"])).toBe(false);
- expect(wantsCodeCategory(undefined)).toBe(false);
+ expect(wantsDeveloperCategory(["developer"])).toBe(true);
+ expect(wantsDeveloperCategory([{ type: "developer" }])).toBe(true);
+ expect(wantsDeveloperCategory(["github", "research"])).toBe(false);
+ expect(wantsDeveloperCategory(undefined)).toBe(false);
});
});
-describe("searchCodeCategory", () => {
+describe("searchDeveloperCategory", () => {
it("sends the query and the result count, and nothing else", async () => {
fetchMock.mockResolvedValue(upstreamOk({ results: [] }));
- await searchCodeCategory(
+ await searchDeveloperCategory(
{ query: '"exact phrase" retries', limit: 7, teamId: "t1", timeout: 500 },
logger,
);
@@ -72,7 +72,7 @@ describe("searchCodeCategory", () => {
}),
);
- const results = await searchCodeCategory(
+ const results = await searchDeveloperCategory(
{ query: "retries", limit: 5, teamId: "t1", timeout: 500 },
logger,
);
@@ -83,7 +83,7 @@ describe("searchCodeCategory", () => {
title: "https://github.com/a/b/issues/1",
description: "first passage",
position: 1,
- category: "code",
+ category: "developer",
},
]);
});
@@ -97,7 +97,7 @@ describe("searchCodeCategory", () => {
} as any);
await expect(
- searchCodeCategory(
+ searchDeveloperCategory(
{ query: "retries", limit: 5, teamId: "t1", timeout: 500 },
logger,
),
@@ -109,7 +109,7 @@ describe("searchCodeCategory", () => {
fetchMock.mockRejectedValue(new Error("connection reset"));
await expect(
- searchCodeCategory(
+ searchDeveloperCategory(
{ query: "retries", limit: 5, teamId: "t1", timeout: 500 },
logger,
),
diff --git a/apps/api/src/search/code.ts b/apps/api/src/search/developer.ts
similarity index 77%
rename from apps/api/src/search/code.ts
rename to apps/api/src/search/developer.ts
index 139b19652..77918239d 100644
--- a/apps/api/src/search/code.ts
+++ b/apps/api/src/search/developer.ts
@@ -3,17 +3,17 @@ import type { WebSearchResult } from "../lib/entities";
import { fetchResearchUpstream } from "../lib/research-upstream";
import type { CategoryOption } from "../lib/search-query-builder";
-const CODE_QUERY_KEYS = ["query", "k"];
+const DEVELOPER_QUERY_KEYS = ["query", "k"];
-export function wantsCodeCategory(categories?: CategoryOption[]): boolean {
+export function wantsDeveloperCategory(categories?: CategoryOption[]): boolean {
return (categories ?? []).some(category =>
typeof category === "string"
- ? category === "code"
- : category.type === "code",
+ ? category === "developer"
+ : category.type === "developer",
);
}
-export async function searchCodeCategory(
+export async function searchDeveloperCategory(
options: { query: string; limit: number; teamId: string; timeout: number },
logger: Logger,
): Promise<WebSearchResult[]> {
@@ -21,7 +21,7 @@ export async function searchCodeCategory(
const upstream = await fetchResearchUpstream({
path: "/v2/code/search",
params: { query: options.query, k: options.limit },
- queryKeys: CODE_QUERY_KEYS,
+ queryKeys: DEVELOPER_QUERY_KEYS,
headers: { "firecrawl-team-id": options.teamId },
timeoutMs: options.timeout,
});
@@ -30,7 +30,7 @@ export async function searchCodeCategory(
}
if (!upstream.ok) {
await upstream.body?.cancel().catch(() => {});
- logger.warn("Code category upstream failed", {
+ logger.warn("Developer category upstream failed", {
status: upstream.status,
});
return [];
@@ -48,11 +48,11 @@ export async function searchCodeCategory(
? result.passages[0].text
: "",
position: index + 1,
- category: "code",
+ category: "developer",
}))
.filter(result => result.url.length > 0);
} catch (error) {
- logger.warn("Code category upstream error", { error });
+ logger.warn("Developer category upstream error", { error });
return [];
}
}
diff --git a/apps/api/src/search/execute.ts b/apps/api/src/search/execute.ts
index 231a36b69..afd6dc51f 100644
--- a/apps/api/src/search/execute.ts
+++ b/apps/api/src/search/execute.ts
@@ -13,7 +13,7 @@ import {
mergeScrapedContent,
calculateScrapeCredits,
} from "./scrape";
-import { searchCodeCategory, wantsCodeCategory } from "./code";
+import { searchDeveloperCategory, wantsDeveloperCategory } from "./developer";
import {
highlightsEnvReady,
runIndexedSearchHighlights,
@@ -105,8 +105,8 @@ export async function executeSearch(
},
);
- const codeResults = wantsCodeCategory(categories)
- ? searchCodeCategory(
+ const developerResults = wantsDeveloperCategory(categories)
+ ? searchDeveloperCategory(
{ query, limit, teamId, timeout: options.timeout },
logger,
)
@@ -126,10 +126,10 @@ export async function executeSearch(
enterprise: options.enterprise,
})) as SearchV2Response;
- if (codeResults) {
- const code = await codeResults;
- if (code.length > 0) {
- searchResponse.code = code;
+ if (developerResults) {
+ const developer = await developerResults;
+ if (developer.length > 0) {
+ searchResponse.developer = developer;
}
}
@@ -145,7 +145,7 @@ export async function executeSearch(
...(searchResponse.web ?? []).map(x => x.url),
...(searchResponse.news ?? []).map(x => x.url),
...(searchResponse.images ?? []).map(x => x.url),
- ...(searchResponse.code ?? []).map(x => x.url),
+ ...(searchResponse.developer ?? []).map(x => x.url),
].filter((x): x is string => !!x);
if (urlsToCheck.length > 0) {
@@ -171,8 +171,10 @@ export async function executeSearch(
isAllowed(x.url),
);
}
- if (searchResponse.code) {
- searchResponse.code = searchResponse.code.filter(x => isAllowed(x.url));
+ if (searchResponse.developer) {
+ searchResponse.developer = searchResponse.developer.filter(x =>
+ isAllowed(x.url),
+ );
}
}
}
@@ -216,8 +218,8 @@ export async function executeSearch(
totalResultsCount += searchResponse.news.length;
}
- if (searchResponse.code && searchResponse.code.length > 0) {
- totalResultsCount += searchResponse.code.length;
+ if (searchResponse.developer && searchResponse.developer.length > 0) {
+ totalResultsCount += searchResponse.developer.length;
}
const isZDR = options.enterprise?.includes("zdr");
diff --git a/apps/api/src/services/rate-limiter.ts b/apps/api/src/services/rate-limiter.ts
index 9804ae872..89e1bb5b6 100644
--- a/apps/api/src/services/rate-limiter.ts
+++ b/apps/api/src/services/rate-limiter.ts
@@ -35,7 +35,7 @@ const fallbackRateLimits: Record<RateLimiterMode, number> = {
supportAsk: 3,
supportDocsSearch: 3,
research: 100,
- codeSearch: 100,
+ developerSearch: 100,
};
/**
diff --git a/apps/api/src/types.ts b/apps/api/src/types.ts
index 114b3165c..efacc556b 100644
--- a/apps/api/src/types.ts
+++ b/apps/api/src/types.ts
@@ -159,7 +159,7 @@ export enum RateLimiterMode {
SupportAsk = "supportAsk",
SupportDocsSearch = "supportDocsSearch",
Research = "research",
- CodeSearch = "codeSearch",
+ DeveloperSearch = "developerSearch",
}
export type AuthResponse =