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

Function getPluginInstallVelocity

apps/cursor/src/data/queries.ts:433–456  ·  view source on GitHub ↗
(windowDays = 30)

Source from the content-addressed store, hash-verified

431// function. Plugins with no snapshot history yet (or no fresh installs)
432// will simply be absent from the map; callers should default to 0.
433export async function getPluginInstallVelocity(windowDays = 30): Promise<{
434 data: Map<string, number> | null;
435 error: unknown;
436}> {
437 "use cache";
438 cacheLife("hours");
439 cacheTag("plugins");
440
441 const supabase = await createClient();
442 const { data, error } = await supabase.rpc("plugin_install_velocity", {
443 window_days: windowDays,
444 });
445
446 if (error) return { data: null, error };
447
448 const map = new Map<string, number>();
449 for (const row of (data ?? []) as {
450 plugin_id: string;
451 installs_window: number;
452 }[]) {
453 map.set(row.plugin_id, row.installs_window);
454 }
455 return { data: map, error: null };
456}
457
458export async function getPluginBySlug(slug: string) {
459 "use cache";

Callers 1

PageFunction · 0.90

Calls 1

createClientFunction · 0.90

Tested by

no test coverage detected