MCPcopy Create free account
hub / github.com/cursor/community-plugins / getRuleRedirectSlugs

Function getRuleRedirectSlugs

apps/cursor/src/data/queries.ts:374–390  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

372// `getPlugins({ fetchAll: true })` (full table, all columns, serial pages)
373// inside every prerendering page caused `USE_CACHE_TIMEOUT` build failures.
374export async function getRuleRedirectSlugs() {
375 "use cache";
376 cacheLife("hours");
377 cacheTag("plugins");
378
379 const supabase = await createClient();
380
381 return fetchAllPages<{ slug: string }>((from, to) =>
382 supabase
383 .from("plugin_components")
384 .select("slug, plugins!inner(id)")
385 .eq("type", "rule")
386 .eq("plugins.active", true)
387 .order("id", { ascending: true })
388 .range(from, to),
389 );
390}
391
392// Resolves a legacy rule slug to the slug of the active plugin that contains
393// it. The newest plugin wins when several contain the same rule slug,

Callers 1

generateStaticParamsFunction · 0.90

Calls 2

createClientFunction · 0.90
fetchAllPagesFunction · 0.90

Tested by

no test coverage detected