# -*- coding: utf-8 -*-
# Copyright (c) 2020, JINGROW
# For license information, please see license.txt


# import jingrow
import copy

from jingrow.model.page import Page

DEFAULT_DEPENDENCIES = [
	{"dependency": "NVM_VERSION", "version": "0.36.0"},
	{"dependency": "NODE_VERSION", "version": "24.13.0"},
	{"dependency": "PYTHON_VERSION", "version": "3.11"},
	{"dependency": "WKHTMLTOPDF_VERSION", "version": "0.12.5"},
	{"dependency": "BENCH_VERSION", "version": "5.22.6"},
]


class JingrowVersion(Page):
	# begin: auto-generated types
	# This code is auto-generated. Do not modify anything in this block.

	from typing import TYPE_CHECKING

	if TYPE_CHECKING:
		from jingrow.types import DF

		from jcloud.jcloud.pagetype.jingrow_version_dependency.jingrow_version_dependency import (
			JingrowVersionDependency,
		)

		default: DF.Check
		dependencies: DF.Table[JingrowVersionDependency]
		number: DF.Int
		public: DF.Check
		status: DF.Literal["Develop", "Beta", "Stable", "End of Life"]
	# end: auto-generated types

	def before_insert(self):
		self.set_dependencies()

	def set_dependencies(self):
		dependencies = copy.deepcopy(DEFAULT_DEPENDENCIES)
		if not hasattr(self, "dependencies") or not self.dependencies:
			self.extend("dependencies", dependencies)
