Experiment with addons

Addons allow to execute external programs in some context inside
docspell. Currently it is possible to run them after processing files.
Addons are provided by URLs to zip files.
This commit is contained in:
eikek
2022-04-22 14:07:28 +02:00
parent e04a76faa4
commit 7fdd78ad06
166 changed files with 8181 additions and 115 deletions

View File

@ -13,6 +13,7 @@ import scala.reflect.ClassTag
import cats.syntax.all._
import fs2.io.file.Path
import docspell.addons.RunnerType
import docspell.common._
import docspell.ftspsql.{PgQueryParser, RankNormalization}
import docspell.logging.{Level, LogConfig}
@ -32,6 +33,17 @@ object Implicits {
else super.fieldValue(name)
}
implicit val urlMatcherReader: ConfigReader[UrlMatcher] = {
val fromList = ConfigReader[List[String]].emap(reason(UrlMatcher.fromStringList))
val fromString = ConfigReader[String].emap(
reason(str => UrlMatcher.fromStringList(str.split("[\\s,]+").toList))
)
fromList.orElse(fromString)
}
implicit val runnerSelectReader: ConfigReader[List[RunnerType]] =
ConfigReader[String].emap(reason(RunnerType.fromSeparatedString))
implicit val accountIdReader: ConfigReader[AccountId] =
ConfigReader[String].emap(reason(AccountId.parse))