()
| 372 | // `getPlugins({ fetchAll: true })` (full table, all columns, serial pages) |
| 373 | // inside every prerendering page caused `USE_CACHE_TIMEOUT` build failures. |
| 374 | export 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, |
no test coverage detected