← Files Google DriveARCHIVED FILE

skills/google-docs/scripts/build_docs_dropdown_inventory.mjs

805 Bytes · Sep 30, 2026 · 23:18 UTC

↓ Download file

#!/usr/bin/env node
import { parseArgs } from "node:util";
import { readJson, writeJson } from "../runtime/dropdown-common.mjs";
import { buildDropdownInventory } from "../runtime/dropdown-inventory.mjs";

const { values } = parseArgs({ options: {
  document: { type: "string" },
  dropdowns: { type: "string" },
  "document-id": { type: "string" },
  "tab-id": { type: "string" },
  output: { type: "string" },
} });
for (const key of ["document", "dropdowns", "output"]) if (!values[key]) throw new Error(`--${key} is required`);
const inventory = buildDropdownInventory({
  documentResult: await readJson(values.document),
  dropdownResult: await readJson(values.dropdowns),
  documentId: values["document-id"] ?? null,
  tabId: values["tab-id"] ?? null,
});
await writeJson(values.output, inventory);

SHA-256: f7e08ad9aa36373043ff1b36fb81e1721b922b0ca6b44a9cb5ee5287535279e1