Files
hikari/client/auditProducts.ts
naomi 7d92047c40
Node.js CI / Lint and Test (push) Successful in 1m39s
chore: update product list
2025-08-25 16:28:40 -07:00

23 lines
884 B
TypeScript

import { products } from "./src/app/config/products";
const repos: { name:string}[] = [];
let page = 1
let productReq = await fetch(`https://git.nhcarrigan.com/api/v1/orgs/nhcarrigan/repos?limit=50&page=${page}`);
let productRes: { name: string }[] = await productReq.json();
repos.push(...productRes);
while (productRes.length >= 50) {
page++;
productReq = await fetch(`https://git.nhcarrigan.com/api/v1/orgs/nhcarrigan/repos?limit=50&page=${page}`);
productRes = await productReq.json();
repos.push(...productRes);
}
console.log(`Auditing ${repos.length} repositories.`);
const excludedProducts = repos.filter(product => products.findIndex(p => p.name.toLowerCase().replace(/\s/g, "-") === product.name) === -1);
console.log("The following products do not appear to be listed in the directory.");
console.log(excludedProducts.map(product => product.name).join("\n"));