feat: add optional version field to Template type and remove unused version parsing function

This commit is contained in:
yessenia 2026-03-03 19:33:49 +08:00
parent 39f4e205a8
commit 7934b0222d
2 changed files with 1 additions and 16 deletions

View File

@ -74,6 +74,7 @@ export type TemplateCollection = {
export type Template = {
id: string
index_id: string
version?: string
template_name: string
icon: string
icon_background?: string

View File

@ -9,7 +9,6 @@ type GraphPayload = {
}
type DslPayload = {
version?: string | number
workflow?: {
graph?: GraphPayload
}
@ -43,21 +42,6 @@ export const parseGraphFromDsl = (dslContent: string): ParsedGraph => {
}
}
export const parseDslVersionFromDsl = (dslContent: string): string | null => {
if (!dslContent)
return null
try {
const data = yamlLoad(dslContent) as DslPayload
if (data?.version === undefined || data?.version === null)
return null
return String(data.version)
}
catch {
return null
}
}
type UsedCountFormatOptions = {
precision?: number
rounding?: 'round' | 'floor'