mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-09-11 20:31:47 +02:00
feat(import): add stable per-resource source keys to the importer contract (#614)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
e63a87718c
commit
81a2a5d955
@@ -80,7 +80,15 @@ export function migrateImport(contents: string) {
|
||||
}
|
||||
}
|
||||
|
||||
return { resources: parsed.resources };
|
||||
const sourceKeys: Record<string, string> = {};
|
||||
for (const models of Object.values(parsed.resources)) {
|
||||
if (!Array.isArray(models)) continue;
|
||||
for (const model of models) {
|
||||
if (typeof model?.id === "string") sourceKeys[model.id] = model.id;
|
||||
}
|
||||
}
|
||||
|
||||
return { resources: parsed.resources, sourceKeys };
|
||||
}
|
||||
|
||||
function isJSObject(obj: unknown) {
|
||||
|
||||
Reference in New Issue
Block a user