Skip to content

applyRepositoryExportDelta

applyRepositoryExportDelta(base, delta): Map<string, { wref: string; durableId: string; version: number; active: true; data: Record<string, unknown>; kind: "shape"; shapes: object[]; } | { wref: string; durableId: string; version: number; active: true; data: Record<string, unknown>; kind: "thing" | "collection"; shapes: object[]; } | { wref: string; durableId: string; version: number; active: true; data: Record<string, unknown>; kind: "assertion"; shapes: object[]; about: { wref: string; v?: number; durableId: string; }; affirmed: object[]; } | { wref: string; durableId: string; version: number; kind: "shape" | "thing" | "assertion" | "collection"; active: false; }>

Fold a delta export onto a base, by durableId: active rows upsert, and tombstones remove. Pure — neither argument is mutated — and order-dependent within each argument, so the last row for an identity wins.

RepositoryExportRows

RepositoryExportRows

Map<string, { wref: string; durableId: string; version: number; active: true; data: Record<string, unknown>; kind: "shape"; shapes: object[]; } | { wref: string; durableId: string; version: number; active: true; data: Record<string, unknown>; kind: "thing" | "collection"; shapes: object[]; } | { wref: string; durableId: string; version: number; active: true; data: Record<string, unknown>; kind: "assertion"; shapes: object[]; about: { wref: string; v?: number; durableId: string; }; affirmed: object[]; } | { wref: string; durableId: string; version: number; kind: "shape" | "thing" | "assertion" | "collection"; active: false; }>