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:
Gregory Schier
2026-09-01 08:11:54 -07:00
committed by GitHub
co-authored by Claude Opus 5
parent e63a87718c
commit 81a2a5d955
28 changed files with 785 additions and 49 deletions
+5 -1
View File
@@ -11,6 +11,10 @@ export type BatchUpsertResult = { workspaces: Array<Workspace>, environments: Ar
*/
export type ImportDestination = { "type": "new_workspace" } | { "type": "existing_workspace", workspaceId: string, folderId?: string, };
export type ImportPlan = { importer: string, destination: ImportDestination, resources: BatchUpsertResult, warnings: Array<ImportPlanWarning>, };
export type ImportPlan = { importer: string, destination: ImportDestination, resources: BatchUpsertResult, warnings: Array<ImportPlanWarning>,
/**
* Stable source key for every model in `resources`, keyed by its freshly minted ID.
*/
sourceKeys: { [key in string]?: string }, };
export type ImportPlanWarning = { title: string, detail: string, };
+3
View File
@@ -119,6 +119,9 @@ pub struct ImportPlan {
pub destination: ImportDestination,
pub resources: BatchUpsertResult,
pub warnings: Vec<ImportPlanWarning>,
/// Stable source key for every model in `resources`, keyed by its freshly minted ID.
pub source_keys: BTreeMap<String, String>,
}
pub fn get_workspace_export_resources(