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

Function getPlugins

apps/cursor/src/data/queries.ts:333–367  ·  view source on GitHub ↗
({
  page = 1,
  limit = 36,
  fetchAll = false,
}: {
  page?: number;
  limit?: number;
  fetchAll?: boolean;
} = {})

Source from the content-addressed store, hash-verified

331// ---------------------------------------------------------------------------
332
333export async function getPlugins({
334 page = 1,
335 limit = 36,
336 fetchAll = false,
337}: {
338 page?: number;
339 limit?: number;
340 fetchAll?: boolean;
341} = {}): Promise<{ data: PluginRow[] | null; error: unknown }> {
342 "use cache";
343 cacheLife("hours");
344 cacheTag("plugins");
345
346 const supabase = await createClient();
347
348 const baseQuery = () =>
349 supabase
350 .from("plugins")
351 .select("*, plugin_components(*)")
352 .eq("active", true)
353 .order("created_at", { ascending: false });
354
355 if (fetchAll) {
356 return fetchAllPages<PluginRow>(async (from, to) => {
357 const { data, error } = await baseQuery().range(from, to);
358 return { data: data as PluginRow[] | null, error };
359 }, 100);
360 }
361
362 const { data, error } = await baseQuery()
363 .limit(limit)
364 .range((page - 1) * limit, page * limit - 1);
365
366 return { data: data as PluginRow[] | null, error };
367}
368
369// Slugs of every `rule` component on an active plugin. Legacy rule URLs
370// (`/{rule-slug}`) prerender a redirect to the parent plugin, and there are

Callers 3

sitemapFunction · 0.90
PageFunction · 0.90
generateStaticParamsFunction · 0.90

Calls 3

createClientFunction · 0.90
fetchAllPagesFunction · 0.90
baseQueryFunction · 0.70

Tested by

no test coverage detected