Support customParseLogic in meta

This commit is contained in:
Koen Kanters
2025-12-30 15:12:37 +01:00
parent ee8505577c
commit ad3af87857
3 changed files with 10 additions and 0 deletions

View File

@@ -85,6 +85,7 @@ Any field not in this list will be ignored. Any field not matching the required
- "maxFileVersion": number _(target only devices with this version or below)_
- "minFileVersion": number _(target only devices with this version or above)_
- "modelId": string _(target only devices with this model ID)_
- "customParseLogic": string _(custom parsing logic used for this image)_
###### For record purpose

View File

@@ -308,6 +308,14 @@ export function getValidMetas(metas: Partial<ExtraMetas & ExtraMetasWithFileName
validMetas.maxFileVersion = metas.maxFileVersion;
}
if (metas.customParseLogic != null) {
if (metas.customParseLogic === "telinkEncrypted") {
throw new Error(`Invalid value for 'customParseLogic', expected 'telinkEncrypted' type.`);
}
validMetas.customParseLogic = metas.customParseLogic;
}
if (metas.minFileVersion != null) {
if (typeof metas.minFileVersion !== "number") {
throw new Error(`Invalid format for 'minFileVersion', expected 'number' type.`);

View File

@@ -61,6 +61,7 @@ export interface RepoImageMeta extends ImageInfo, ImageMeta {
maxFileVersion?: number;
originalUrl?: string;
releaseNotes?: string;
customParseLogic?: string;
}
export type ExtraMetas = Omit<