import { VarDefType,VarBoolDefType,VarNumDefType } from '~/typs/inputs'

export interface ReqRouteType {
	path: string
	param: string
}
export interface WebRouteType {
	[key: string]: ReqRouteType
}
export interface TemplateFileType {
	path: string
	rooute: string
}
export interface TemplateType {
	[key: string]: TemplateFileType
}
export interface TplMailType{
	path: string
	type: string
}
export interface TplsMailType {
	[key: string]: TplMailType
}
export interface VarsConfigType {
	[key: string]: any
  sec_logs: {
		logOut: VarDefType
		requestOut: VarDefType
		trackOut: VarDefType
		debugLevel: VarDefType
	}
	sec_webserver: {
		host: VarDefType
		port: VarNumDefType
		protocol: VarDefType
		keyPem: VarDefType
		certPem: VarDefType
		allowOrigins: {
			typ: string
			dflt: string[]
		}
	}
	sec_jwt: {
		useJWT: VarBoolDefType
		jwtRealm: VarDefType
		jwtKey: VarDefType
		jwtTimeout: VarNumDefType
		jwtMaxRefresh: VarNumDefType
	}
	sec_auth: {
		authSep: VarDefType
		useAuthz: VarBoolDefType
		authzModel: VarDefType
		authzPolicy: VarDefType
		adminRole: VarDefType
	}
	sec_perms: {
		pubUser: VarDefType
		usersPath: VarDefType
		usersModelsPath: VarDefType
		identityKey: VarDefType
	}
	sec_routes: {
		rootAuthGroup: VarDefType
		routes: {
		  typ: string
		  dflt: WebRouteType[]
		}
	}
	sec_templates: {
    templatesRoot: VarDefType
    templatesExt: VarDefType
    templatesIncludes: VarDefType
    templatesLayouts: VarDefType
		templatesFiles: {
    	typ: string
    	dflt: TemplateType
	  }
  }
	sec_assets: {
		assetsPath: VarDefType
		assetsURL: VarDefType
	}
	sec_models: {
		useDist: VarBoolDefType
		genDist: VarBoolDefType
		genExcludeList: {
			typ: string
			dflt: string[]
		}
		dataDistPath: VarDefType
		dataPath: VarDefType
		dataModelsRoot: VarDefType
		dataCorePath: VarDefType
		dataDflt: VarDefType
		dataItems: {
			typ: string
			dflt: string[]
		}
	}
	sec_langs: {
		langs: {
			typ: string
			dflt: string[] 
		}
		mainLang: VarDefType
	}
	sec_git: {
		useRepo: VarBoolDefType
		useRepoOnReq: VarBoolDefType
		quietGit: VarBoolDefType
		backgGit: VarBoolDefType
		repoPath: VarDefType
		repoName:VarDefType
		repoCommit:VarDefType
	}
  sec_others: {
	  openBrowser: VarBoolDefType
	}
}
export interface ConfUrlsType {
	[key: string]: string
}
export interface ServConfigType {
	[key: string]: any
  logOut: string
  requestOut: string
  requestStore: string
  trackOut: string
  trackStore: string
  debugLevel: number
  host: string
  port: number
  protocol: string
  keyPem: string
  certPem: string
  allowOrigins: string[]
  useJWT: boolean
  jwtRealm: string
  jwtKey: string
  jwtTimeout: number
  jwtMaxRefresh: number
	signingAlgorithm: string    
  jwtKeyPem: string
  jwtCertPem: string
  authSep: string
  useAuthz: boolean
  authzModel: string
  authzPolicy: string
  adminRole: string
  pubUser: string
  usersPath: string
  usersModelsPath: string
  identityKey: string
	usersStore: string
  rootAuthGroup: string
  routes: WebRouteType
  templatesRoot: string
  templatesExt: string
  templatesIncludes: string
  templatesLayouts: string
  templatesFiles: TemplateType
  mailHost: string
  mailPort: number
  mailFrom: string
  mailUser: string
  mailPswd: string
  tplsMailPath: string
  tplsMail: TplsMailType
  assetsPath: string
  assetsURL: string
  useDist: boolean
  genDist: boolean
  genExcludeList: string[]
  dataDistPath: string
  dataPath: string
  dataModelsRoot: string
  dataCorePath: string
  dataDflt: string
  dataItems: string[]
  dataStore: string
  langs: string[]
  mainLang: string
  useRepo: boolean
  useRepoOnReq: boolean
  quietGit: boolean
  backgGit: boolean
  repoPath: boolean
  repoName: string
  repoCommit: string
  openBrowser: boolean
  redisHost: string
  redisPort: number
  redisDB: string
  redisPswd: string
}