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
+1
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)_ - "maxFileVersion": number _(target only devices with this version or below)_
- "minFileVersion": number _(target only devices with this version or above)_ - "minFileVersion": number _(target only devices with this version or above)_
- "modelId": string _(target only devices with this model ID)_ - "modelId": string _(target only devices with this model ID)_
- "customParseLogic": string _(custom parsing logic used for this image)_
###### For record purpose ###### For record purpose
+8
View File
@@ -308,6 +308,14 @@ export function getValidMetas(metas: Partial<ExtraMetas & ExtraMetasWithFileName
validMetas.maxFileVersion = metas.maxFileVersion; 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 (metas.minFileVersion != null) {
if (typeof metas.minFileVersion !== "number") { if (typeof metas.minFileVersion !== "number") {
throw new Error(`Invalid format for 'minFileVersion', expected 'number' type.`); throw new Error(`Invalid format for 'minFileVersion', expected 'number' type.`);
+1
View File
@@ -61,6 +61,7 @@ export interface RepoImageMeta extends ImageInfo, ImageMeta {
maxFileVersion?: number; maxFileVersion?: number;
originalUrl?: string; originalUrl?: string;
releaseNotes?: string; releaseNotes?: string;
customParseLogic?: string;
} }
export type ExtraMetas = Omit< export type ExtraMetas = Omit<