{"version":3,"file":"authors.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/content/[collection]/authors.ts"],"sourcesContent":["/**\n * Content authors endpoint - injected by EmDash integration\n *\n * GET /_emdash/api/content/{collection}/authors - List the distinct authors\n * of a collection's live content, for the admin author filter.\n */\n\nimport type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, unwrapResult } from \"#api/error.js\";\n\nexport const prerender = false;\n\nexport const GET: APIRoute = async ({ params, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst collection = params.collection!;\n\n\t// Editorial capability, not plain read. This response carries author\n\t// emails (PII) and reveals the authors of unpublished entries, so it must\n\t// not be reachable by subscribers (content:read). content:read_drafts is\n\t// the same tier the list route requires before it stops forcing\n\t// status=published, so the visibility surfaces line up.\n\tif (!emdash?.handleContentAuthors) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t}\n\tconst denied = requirePerm(user, \"content:read_drafts\");\n\tif (denied) return denied;\n\n\tconst result = await emdash.handleContentAuthors(collection);\n\n\treturn unwrapResult(result);\n};\n"],"mappings":";;;;;;AAYA,MAAa,YAAY;AAEzB,MAAa,MAAgB,OAAO,EAAE,QAAQ,aAAa;CAC1D,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,aAAa,OAAO;AAO1B,KAAI,CAAC,QAAQ,qBACZ,QAAO,SAAS,kBAAkB,6BAA6B,IAAI;CAEpE,MAAM,SAAS,YAAY,MAAM,sBAAsB;AACvD,KAAI,OAAQ,QAAO;AAInB,QAAO,aAFQ,MAAM,OAAO,qBAAqB,WAAW,CAEjC"}