feat: refine ISAC media and notification workflows
This commit is contained in:
@@ -10,7 +10,8 @@ const database = await connect(databasePath);
|
||||
const rows = await (await database.prepare('SELECT * FROM managed_images ORDER BY created_at')).all();
|
||||
const images = [];
|
||||
for (const row of rows) {
|
||||
if (typeof row.storage_key !== 'string' || !/^library-[0-9a-f-]{36}\.webp$/i.test(row.storage_key)) {
|
||||
if (typeof row.storage_key !== 'string'
|
||||
|| !/^(?:library|talent|brand_set|os_protocol|skill_chip|specialization|specialization_ability|specialization_node)-[0-9a-f-]{36}\.webp$/i.test(row.storage_key)) {
|
||||
throw new Error(`Invalid managed-image storage key "${String(row.storage_key)}".`);
|
||||
}
|
||||
images.push({ row, contentBase64: (await readFile(join(storageDirectory, row.storage_key))).toString('base64') });
|
||||
|
||||
Reference in New Issue
Block a user