fix: enforce approved media publication closure
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user