(rel: string)
| 2899 | } |
| 2900 | |
| 2901 | function cleanDeletedAssetPath(rel: string): string { |
| 2902 | const normalized = normalizeVaultRelativePath(rel) |
| 2903 | if (!normalized) throw new Error('Deleted asset path is required.') |
| 2904 | if (normalized.split('/').includes(INTERNAL_VAULT_DIR)) { |
| 2905 | throw new Error('Cannot restore internal ZenNotes files.') |
| 2906 | } |
| 2907 | if (path.extname(normalized).toLowerCase() === '.md') { |
| 2908 | throw new Error('Use note actions to restore markdown notes.') |
| 2909 | } |
| 2910 | return normalized |
| 2911 | } |
| 2912 | |
| 2913 | function cleanDeletedAssetToken(token: string): string { |
| 2914 | if (!/^[0-9a-f-]{36}$/i.test(token)) { |
no test coverage detected