81 lines
3.0 KiB
C#
81 lines
3.0 KiB
C#
|
|
namespace FlatRender.ContentSvc.Models;
|
||
|
|
|
||
|
|
// ── Canonical scan result ────────────────────────────────────────────────────
|
||
|
|
// Produced by either engine (the AE-JSX scanner on a render node, or the headless
|
||
|
|
// Go quick-scan) and consumed by AepImportService. Both engines emit this shape;
|
||
|
|
// the Go scan simply leaves colour/font/text fields null.
|
||
|
|
|
||
|
|
public record ScanResult(
|
||
|
|
string? Source, // "ae-jsx" | "go-parser"
|
||
|
|
string? RenderComp, // final render comp name, e.g. "frfinal"
|
||
|
|
List<ScanScene>? Scenes,
|
||
|
|
List<ScanColor>? SharedColors
|
||
|
|
);
|
||
|
|
|
||
|
|
public record ScanScene(
|
||
|
|
string Key, // AE comp name
|
||
|
|
string? Title,
|
||
|
|
string? SceneType, // Normal | Config | DesignStart | DesignEnd
|
||
|
|
decimal? DefaultDurationSec,
|
||
|
|
decimal? MinDurationSec,
|
||
|
|
decimal? MaxDurationSec,
|
||
|
|
int? Sort,
|
||
|
|
List<ScanElement>? Elements, // frl_/frd_ editable layers
|
||
|
|
List<ScanColor>? Colors // per-scene frd_ colour zones
|
||
|
|
);
|
||
|
|
|
||
|
|
public record ScanElement(
|
||
|
|
string Key, // AE layer name (frl_… / frd_…)
|
||
|
|
string? Title,
|
||
|
|
string? Type, // Text | TextArea | Media | Audio | … (content_element_type)
|
||
|
|
string? DefaultValue,
|
||
|
|
string? FontFace,
|
||
|
|
string? FontFaceName,
|
||
|
|
int? FontSize,
|
||
|
|
string? Justify, // LEFT_JUSTIFY | CENTER_JUSTIFY | RIGHT_JUSTIFY | FULL_JUSTIFY
|
||
|
|
int? PositionInContainer,
|
||
|
|
bool? IsTextBox,
|
||
|
|
int? MaxSize,
|
||
|
|
bool? VideoSupport,
|
||
|
|
int? Width,
|
||
|
|
int? Height,
|
||
|
|
bool? IsHidden,
|
||
|
|
string? DirectionLayerKey,
|
||
|
|
int? Sort
|
||
|
|
);
|
||
|
|
|
||
|
|
public record ScanColor(
|
||
|
|
string ElementKey, // AE frd_ layer name / shared colour key
|
||
|
|
string? Title,
|
||
|
|
string? AttrValue, // fill | stroke | tracking | dropshadow
|
||
|
|
string? DefaultColor, // #RRGGBB
|
||
|
|
int? Sort
|
||
|
|
);
|
||
|
|
|
||
|
|
// ── Import request + diff ─────────────────────────────────────────────────────
|
||
|
|
|
||
|
|
public record ScanApplyOptions(
|
||
|
|
bool RemoveOrphanScenes = false, // soft-delete scenes not present in the scan
|
||
|
|
bool RemoveOrphanElements = false, // delete elements/colours not present in the scan
|
||
|
|
bool OverwriteExisting = true // refresh matched items from the scan (null scan fields are kept)
|
||
|
|
);
|
||
|
|
|
||
|
|
public record ScanImportRequest(
|
||
|
|
ScanResult Scan,
|
||
|
|
ScanApplyOptions? Options
|
||
|
|
);
|
||
|
|
|
||
|
|
public record SceneDiff(
|
||
|
|
string Key, string Title, string Status, // added | changed | unchanged | orphan
|
||
|
|
int ElementsAdded, int ElementsChanged, int ElementsRemoved,
|
||
|
|
int ColorsAdded, int ColorsChanged, int ColorsRemoved
|
||
|
|
);
|
||
|
|
|
||
|
|
public record ImportDiff(
|
||
|
|
bool Applied,
|
||
|
|
int ScenesAdded, int ScenesChanged, int ScenesUnchanged, int ScenesOrphan,
|
||
|
|
int SharedColorsAdded, int SharedColorsChanged, int SharedColorsRemoved,
|
||
|
|
List<SceneDiff> Scenes,
|
||
|
|
List<string> OrphanSceneKeys
|
||
|
|
);
|