@agility/cli
Version:
Agility CLI for working with your content. (Public Beta)
62 lines (61 loc) • 1.55 kB
TypeScript
/**
* ReferenceMapperV2 TypeScript Interfaces
* Canonical storage approach - each mapping stored once under lexicographically smaller GUID
*/
export type EntityType = 'model' | 'container' | 'content' | 'asset' | 'gallery' | 'template' | 'page';
export interface EntityReference {
guid: string;
id: number;
referenceName?: string;
modified?: string | number;
}
export interface MappingEntry {
entityA: EntityReference;
entityB: EntityReference;
lastSyncDirection: string;
syncHistory: SyncHistoryEntry[];
}
export interface SyncHistoryEntry {
direction: string;
timestamp: string;
syncType?: string;
}
export interface EntityMappingFile {
metadata: {
canonicalGuid: string;
lastUpdated: string;
version: string;
entityType: EntityType;
};
mappings: {
[relationshipGuid: string]: {
[compoundKey: string]: MappingEntry;
};
};
}
export interface MappingLookupResult {
entry: MappingEntry;
targetId: number;
canonicalLocation: string;
}
export interface MappingContext {
sourceGuid: string;
targetGuid: string;
locale?: string;
}
export interface CoreReferenceResult<T> {
source: T;
target: T | null;
sourceGUID: string;
targetGUID: string;
}
export interface BulkMappingResult {
source: number;
target: number | null;
}
export interface ReferenceMapperV2Config {
enableLegacyMode?: boolean;
autoMigrate?: boolean;
enableBackupOnWrite?: boolean;
cacheSize?: number;
}