fix: enforce approved media publication closure

This commit is contained in:
2026-09-02 08:15:00 +03:00
parent a1520f2783
commit 5edddb8781
6 changed files with 283 additions and 31 deletions

View File

@@ -297,11 +297,21 @@ export const parseProductionInputSnapshot = (input: unknown): ProductionInputs =
technology.assetId === undefined ? [] : [technology.assetId])),
...(content.metadata.socialPreviewAssetId === undefined ? [] : [content.metadata.socialPreviewAssetId]),
];
const seenReferences = new Set<string>();
for (const assetId of referencedAssetIds) {
if (seenReferences.has(assetId)) {
throw new Error(`Duplicate public asset reference: ${assetId}`);
}
seenReferences.add(assetId);
if (!manifestIds.has(assetId)) {
throw new Error(`Unmanifested asset reference: ${assetId}`);
}
}
for (const assetId of manifestIds) {
if (!seenReferences.has(assetId)) {
throw new Error(`Unreferenced manifest asset: ${assetId}`);
}
}
return { content, manifest, site } as ProductionInputs;
};