From 5bad157b9e9929c048bd16cf63c2c619f5e19990 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sun, 28 Jun 2020 19:34:28 +0200 Subject: [PATCH 1/3] Change link on home page --- modules/microsite/docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/microsite/docs/index.md b/modules/microsite/docs/index.md index 3b50c529..39d4ac69 100644 --- a/modules/microsite/docs/index.md +++ b/modules/microsite/docs/index.md @@ -3,7 +3,7 @@ layout: homeFeatures features: - first: ["Stow documents away", "Most of the time documents (emails, postal mail) are received or created. It should be fast to stow them away, knowing that they can be found if necessary.", "uploading"] - second: ["Automatic Tagging", "All documents are analyzed and tagged automatically. It may not always be correct; results can be reviewed and corrected.", "metadata"] - - third: ["Work with them", "Search for documents by their meta data. Send them via e-mail. Add your own tags, names etc to better match your workflow.", "curate"] + - third: ["Work with them", "Search for documents by their meta data or via full-text search. Send them via e-mail. Add your own tags, names etc to better match your workflow.", "finding"] --- From 672ed445b1694b5d4980132c99de7b47c100f723 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sun, 28 Jun 2020 20:47:19 +0200 Subject: [PATCH 2/3] Add scalafix and organize-imports rule --- .scalafix.conf | 13 +++++++++++++ build.sbt | 9 +++++++-- project/Dependencies.scala | 5 +++++ project/plugins.sbt | 1 + 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .scalafix.conf diff --git a/.scalafix.conf b/.scalafix.conf new file mode 100644 index 00000000..9cd16781 --- /dev/null +++ b/.scalafix.conf @@ -0,0 +1,13 @@ +rules = [ + ProcedureSyntax + OrganizeImports +] +OrganizeImports { + coalesceToWildcardImportThreshold = 3 + expandRelative = true + groupedImports = Keep + importsOrder = Ascii + groups = ["re:javax?\\.", "scala.", "re:(cats|fs2)\\.", "docspell.", "*"] + importSelectorsOrder = Ascii + removeUnused = true +} \ No newline at end of file diff --git a/build.sbt b/build.sbt index f0e27e5d..d9c31f2c 100644 --- a/build.sbt +++ b/build.sbt @@ -11,6 +11,12 @@ val elmCompileMode = settingKey[ElmCompileMode]("How to compile elm sources") // --- Settings +val scalafixSettings = Seq( + semanticdbEnabled := true, // enable SemanticDB + semanticdbVersion := scalafixSemanticdb.revision, //"4.3.10", // use Scalafix compatible version + ThisBuild / scalafixDependencies ++= Dependencies.organizeImports +) + val sharedSettings = Seq( organization := "com.github.eikek", scalaVersion := "2.13.2", @@ -37,7 +43,7 @@ val sharedSettings = Seq( (scalacOptions.value.filter(o => !o.contains("Xlint")) ++ Seq("-Xlint:_,-unused")), scalacOptions in (Test, console) := (scalacOptions.value.filter(o => !o.contains("Xlint")) ++ Seq("-Xlint:_,-unused")) -) +) ++ scalafixSettings val testSettings = Seq( testFrameworks += new TestFramework("minitest.runner.Framework"), @@ -143,7 +149,6 @@ val openapiScalaSettings = Seq( ) - // --- Modules // Base module, everything depends on this – including restapi and diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 9f920ac6..30f16b26 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -24,6 +24,7 @@ object Dependencies { val LogbackVersion = "1.2.3" val MariaDbVersion = "2.6.1" val MiniTestVersion = "2.8.2" + val OrganizeImportsVersion = "0.3.1-RC3" val PdfboxVersion = "2.0.20" val PoiVersion = "4.1.2" val PostgresVersion = "42.2.14" @@ -253,4 +254,8 @@ object Dependencies { val icu4j = Seq( "com.ibm.icu" % "icu4j" % Icu4jVersion ) + + val organizeImports = Seq( + "com.github.liancheng" %% "organize-imports" % OrganizeImportsVersion + ) } diff --git a/project/plugins.sbt b/project/plugins.sbt index 7a4ea605..30e994f4 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,3 +1,4 @@ +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.17") addSbtPlugin("com.47deg" % "sbt-microsites" % "1.2.1") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") addSbtPlugin("com.github.eikek" % "sbt-openapi-schema" % "0.6.1") From 347a029af883e9767a9196b05ff1ecd078116fff Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sun, 28 Jun 2020 21:10:38 +0200 Subject: [PATCH 3/3] Scalafix organize-imports --- .../docspell/analysis/TextAnalyser.scala | 1 + .../docspell/analysis/contact/Contact.scala | 4 +-- .../docspell/analysis/contact/Domain.scala | 1 + .../docspell/analysis/date/DateFind.scala | 9 ++++--- .../analysis/nlp/StanfordNerClassifier.scala | 10 +++---- .../scala/docspell/backend/BackendApp.scala | 11 ++++---- .../main/scala/docspell/backend/Common.scala | 1 + .../scala/docspell/backend/JobFactory.scala | 1 + .../docspell/backend/PasswordCrypt.scala | 1 + .../docspell/backend/auth/AuthToken.scala | 13 ++++----- .../scala/docspell/backend/auth/Login.scala | 6 +++-- .../docspell/backend/ops/OCollective.scala | 13 ++++----- .../docspell/backend/ops/OEquipment.scala | 5 ++-- .../docspell/backend/ops/OFulltext.scala | 9 ++++--- .../scala/docspell/backend/ops/OItem.scala | 14 +++++----- .../docspell/backend/ops/OItemSearch.scala | 23 ++++++---------- .../scala/docspell/backend/ops/OJob.scala | 5 ++-- .../scala/docspell/backend/ops/OJoex.scala | 9 ++++--- .../scala/docspell/backend/ops/OMail.scala | 15 ++++++----- .../scala/docspell/backend/ops/ONode.scala | 2 ++ .../docspell/backend/ops/OOrganization.scala | 7 ++--- .../scala/docspell/backend/ops/OSource.scala | 5 ++-- .../scala/docspell/backend/ops/OTag.scala | 5 ++-- .../scala/docspell/backend/ops/OUpload.scala | 6 +++-- .../docspell/backend/ops/OUserTask.scala | 9 ++++--- .../docspell/backend/signup/Config.scala | 1 + .../docspell/backend/signup/OSignup.scala | 8 +++--- .../main/scala/docspell/common/Binary.scala | 6 +++-- .../main/scala/docspell/common/Duration.scala | 9 ++++--- .../src/main/scala/docspell/common/File.scala | 7 ++--- .../src/main/scala/docspell/common/Hash.scala | 3 ++- .../main/scala/docspell/common/Ident.scala | 3 ++- .../scala/docspell/common/ItemState.scala | 3 ++- .../scala/docspell/common/LenientUri.scala | 24 +++++++++-------- .../main/scala/docspell/common/Logger.scala | 2 ++ .../scala/docspell/common/MetaProposal.scala | 11 +++++--- .../docspell/common/MetaProposalList.scala | 2 ++ .../main/scala/docspell/common/MimeType.scala | 9 ++++--- .../docspell/common/NotifyDueItemsArgs.scala | 4 ++- .../main/scala/docspell/common/Pools.scala | 3 ++- .../main/scala/docspell/common/Priority.scala | 3 ++- .../docspell/common/ProcessItemArgs.scala | 6 +++-- .../docspell/common/ScanMailboxArgs.scala | 4 ++- .../scala/docspell/common/SystemCommand.scala | 8 +++--- .../docspell/common/ThreadFactories.scala | 10 ++++--- .../scala/docspell/common/Timestamp.scala | 7 ++--- .../docspell/common/config/Implicits.scala | 7 ++--- .../docspell/common/syntax/LoggerSyntax.scala | 1 + .../docspell/common/syntax/StreamSyntax.scala | 3 ++- .../docspell/common/syntax/StringSyntax.scala | 1 + .../scala/docspell/convert/Conversion.scala | 3 ++- .../docspell/convert/ConversionResult.scala | 1 + .../scala/docspell/convert/SanitizeHtml.scala | 3 ++- .../docspell/convert/extern/ExternConv.scala | 3 ++- .../docspell/convert/extern/Tesseract.scala | 1 + .../docspell/convert/extern/Unoconv.scala | 1 + .../docspell/convert/extern/WkHtmlPdf.scala | 5 ++-- .../docspell/convert/flexmark/Markdown.scala | 8 +++--- .../docspell/extract/ExtractResult.scala | 4 +-- .../scala/docspell/extract/Extraction.scala | 7 ++--- .../scala/docspell/extract/PdfExtract.scala | 5 ++-- .../main/scala/docspell/extract/ocr/Ocr.scala | 1 + .../docspell/extract/ocr/TextExtract.scala | 7 ++--- .../docspell/extract/odf/OdfExtract.scala | 10 ++++--- .../extract/pdfbox/PdfboxExtract.scala | 12 +++++---- .../docspell/extract/poi/PoiExtract.scala | 16 ++++++----- .../docspell/extract/rtf/RtfExtract.scala | 13 ++++----- .../main/scala/docspell/files/ImageSize.scala | 8 +++--- .../scala/docspell/files/TikaMimetype.scala | 9 ++++--- .../src/main/scala/docspell/files/Zip.scala | 8 +++--- .../scala/docspell/ftsclient/FtsClient.scala | 8 +++--- .../scala/docspell/ftsclient/FtsResult.scala | 3 +-- .../main/scala/docspell/ftssolr/Field.scala | 3 ++- .../scala/docspell/ftssolr/JsonCodec.scala | 5 ++-- .../scala/docspell/ftssolr/QueryData.scala | 3 ++- .../docspell/ftssolr/SolrFtsClient.scala | 9 ++++--- .../scala/docspell/ftssolr/SolrQuery.scala | 15 ++++++----- .../scala/docspell/ftssolr/SolrSetup.scala | 14 +++++----- .../scala/docspell/ftssolr/SolrUpdate.scala | 15 ++++++----- .../src/main/scala/docspell/joex/Config.scala | 8 +++--- .../main/scala/docspell/joex/ConfigFile.scala | 3 ++- .../scala/docspell/joex/JoexAppImpl.scala | 25 +++++++++-------- .../main/scala/docspell/joex/JoexServer.scala | 12 +++++---- .../src/main/scala/docspell/joex/Main.scala | 7 ++--- .../joex/extract/JsoupSanitizer.scala | 3 ++- .../scala/docspell/joex/fts/FtsContext.scala | 2 +- .../scala/docspell/joex/fts/FtsWork.scala | 7 ++--- .../scala/docspell/joex/fts/Migration.scala | 11 ++++---- .../docspell/joex/fts/MigrationTask.scala | 3 ++- .../scala/docspell/joex/fts/ReIndexTask.scala | 7 ++--- .../docspell/joex/hk/CleanupInvitesTask.scala | 2 +- .../docspell/joex/hk/CleanupJobsTask.scala | 2 +- .../docspell/joex/hk/HouseKeepingConfig.scala | 4 +-- .../docspell/joex/hk/HouseKeepingTask.scala | 5 ++-- .../scala/docspell/joex/mail/ReadMail.scala | 11 ++++---- .../docspell/joex/notify/MailContext.scala | 8 +++--- .../joex/notify/NotifyDueItemsTask.scala | 21 ++++++++------- .../joex/notify/YamuscaConverter.scala | 5 ++-- .../docspell/joex/process/ConvertPdf.scala | 14 +++++----- .../docspell/joex/process/CreateItem.scala | 8 +++--- .../docspell/joex/process/EvalProposals.scala | 4 ++- .../joex/process/ExtractArchive.scala | 12 +++++---- .../docspell/joex/process/FindProposal.scala | 5 ++-- .../docspell/joex/process/ItemHandler.scala | 7 ++--- .../docspell/joex/process/LinkProposal.scala | 3 ++- .../docspell/joex/process/ProcessItem.scala | 5 ++-- .../docspell/joex/process/SaveProposals.scala | 3 ++- .../docspell/joex/process/TestTasks.scala | 4 ++- .../docspell/joex/process/TextAnalysis.scala | 3 ++- .../joex/process/TextExtraction.scala | 8 +++--- .../docspell/joex/routes/InfoRoutes.scala | 2 ++ .../docspell/joex/routes/JoexRoutes.scala | 2 ++ .../joex/scanmailbox/ScanMailboxTask.scala | 27 ++++++++++--------- .../docspell/joex/scheduler/Context.scala | 6 +++-- .../joex/scheduler/CountingScheme.scala | 1 + .../docspell/joex/scheduler/JobTask.scala | 4 ++- .../docspell/joex/scheduler/LogEvent.scala | 5 ++-- .../docspell/joex/scheduler/LogSink.scala | 6 +++-- .../joex/scheduler/PeriodicScheduler.scala | 2 +- .../scheduler/PeriodicSchedulerImpl.scala | 10 +++---- .../docspell/joex/scheduler/QueueLogger.scala | 5 ++-- .../docspell/joex/scheduler/Scheduler.scala | 1 + .../joex/scheduler/SchedulerBuilder.scala | 7 ++--- .../joex/scheduler/SchedulerImpl.scala | 20 +++++++------- .../scala/docspell/joex/scheduler/Task.scala | 5 ++-- .../docspell/joexapi/client/JoexClient.scala | 20 +++++++------- .../scala/docspell/restserver/Config.scala | 3 ++- .../docspell/restserver/ConfigFile.scala | 3 ++- .../main/scala/docspell/restserver/Main.scala | 5 ++-- .../docspell/restserver/RestAppImpl.scala | 8 +++--- .../docspell/restserver/RestServer.scala | 8 +++--- .../docspell/restserver/auth/CookieData.scala | 5 ++-- .../restserver/conv/Conversions.scala | 24 +++++++++-------- .../restserver/http4s/QueryParam.scala | 5 ++-- .../restserver/http4s/ResponseGenerator.scala | 5 ++-- .../restserver/http4s/Responses.scala | 3 ++- .../restserver/routes/AttachmentRoutes.scala | 16 ++++++----- .../restserver/routes/Authenticate.scala | 2 ++ .../routes/CalEventCheckRoutes.scala | 11 ++++---- .../restserver/routes/CheckFileRoutes.scala | 4 ++- .../restserver/routes/CollectiveRoutes.scala | 2 ++ .../restserver/routes/EquipmentRoutes.scala | 9 ++++--- .../routes/FullTextIndexRoutes.scala | 12 ++++----- .../restserver/routes/InfoRoutes.scala | 2 ++ .../routes/IntegrationEndpointRoutes.scala | 3 ++- .../restserver/routes/ItemRoutes.scala | 18 +++++++------ .../restserver/routes/JobQueueRoutes.scala | 2 ++ .../restserver/routes/LoginRoutes.scala | 4 ++- .../restserver/routes/MailSendRoutes.scala | 13 ++++----- .../routes/MailSettingsRoutes.scala | 17 ++++++------ .../routes/NotifyDueItemsRoutes.scala | 15 ++++++----- .../routes/OrganizationRoutes.scala | 2 ++ .../restserver/routes/PersonRoutes.scala | 2 ++ .../restserver/routes/RegisterRoutes.scala | 4 ++- .../restserver/routes/ScanMailboxRoutes.scala | 13 ++++----- .../restserver/routes/SentMailRoutes.scala | 11 ++++---- .../restserver/routes/SourceRoutes.scala | 2 ++ .../restserver/routes/TagRoutes.scala | 2 ++ .../restserver/routes/UploadRoutes.scala | 5 ++-- .../restserver/routes/UserRoutes.scala | 2 ++ .../docspell/restserver/webapp/Flags.scala | 9 ++++--- .../restserver/webapp/TemplateRoutes.scala | 24 +++++++++-------- .../restserver/webapp/WebjarRoutes.scala | 5 ++-- .../main/scala/docspell/store/AddResult.scala | 2 +- .../src/main/scala/docspell/store/Store.scala | 10 ++++--- .../scala/docspell/store/impl/Column.scala | 7 +++-- .../docspell/store/impl/DoobieMeta.scala | 11 ++++---- .../docspell/store/impl/DoobieSyntax.scala | 1 + .../scala/docspell/store/impl/StoreImpl.scala | 4 ++- .../store/migrate/FlywayMigrate.scala | 2 ++ .../docspell/store/queries/QAttachment.scala | 14 +++++----- .../docspell/store/queries/QCollective.scala | 8 +++--- .../scala/docspell/store/queries/QItem.scala | 18 +++++++------ .../scala/docspell/store/queries/QJob.scala | 4 ++- .../scala/docspell/store/queries/QLogin.scala | 1 + .../scala/docspell/store/queries/QMails.scala | 7 ++--- .../store/queries/QOrganization.scala | 10 ++++--- .../store/queries/QPeriodicTask.scala | 1 + .../docspell/store/queries/QUserTask.scala | 2 ++ .../scala/docspell/store/queue/JobQueue.scala | 4 ++- .../store/queue/PeriodicTaskStore.scala | 10 ++++--- .../docspell/store/records/RAttachment.scala | 10 ++++--- .../store/records/RAttachmentArchive.scala | 10 ++++--- .../store/records/RAttachmentMeta.scala | 8 +++--- .../store/records/RAttachmentSource.scala | 7 ++--- .../docspell/store/records/RCollective.scala | 4 ++- .../docspell/store/records/RContact.scala | 6 +++-- .../docspell/store/records/REquipment.scala | 6 +++-- .../docspell/store/records/RFileMeta.scala | 8 +++--- .../store/records/RFtsMigration.scala | 10 ++++--- .../docspell/store/records/RInvitation.scala | 10 ++++--- .../scala/docspell/store/records/RItem.scala | 8 +++--- .../scala/docspell/store/records/RJob.scala | 7 ++--- .../docspell/store/records/RJobGroupUse.scala | 6 +++-- .../docspell/store/records/RJobLog.scala | 5 ++-- .../scala/docspell/store/records/RNode.scala | 6 +++-- .../store/records/ROrganization.scala | 8 +++--- .../store/records/RPeriodicTask.scala | 8 +++--- .../docspell/store/records/RPerson.scala | 10 ++++--- .../docspell/store/records/RSentMail.scala | 12 +++++---- .../store/records/RSentMailItem.scala | 6 +++-- .../docspell/store/records/RSource.scala | 7 ++--- .../scala/docspell/store/records/RTag.scala | 6 +++-- .../docspell/store/records/RTagItem.scala | 8 +++--- .../scala/docspell/store/records/RUser.scala | 6 +++-- .../docspell/store/records/RUserEmail.scala | 8 +++--- .../docspell/store/records/RUserImap.scala | 8 +++--- .../docspell/store/syntax/MimeTypes.scala | 3 ++- .../docspell/store/usertask/UserTask.scala | 7 ++--- .../store/usertask/UserTaskStore.scala | 12 +++++---- 210 files changed, 886 insertions(+), 605 deletions(-) diff --git a/modules/analysis/src/main/scala/docspell/analysis/TextAnalyser.scala b/modules/analysis/src/main/scala/docspell/analysis/TextAnalyser.scala index 53e14235..443fd47d 100644 --- a/modules/analysis/src/main/scala/docspell/analysis/TextAnalyser.scala +++ b/modules/analysis/src/main/scala/docspell/analysis/TextAnalyser.scala @@ -2,6 +2,7 @@ package docspell.analysis import cats.effect._ import cats.implicits._ + import docspell.analysis.contact.Contact import docspell.analysis.date.DateFind import docspell.analysis.nlp.StanfordNerClassifier diff --git a/modules/analysis/src/main/scala/docspell/analysis/contact/Contact.scala b/modules/analysis/src/main/scala/docspell/analysis/contact/Contact.scala index 24bb0585..175f293f 100644 --- a/modules/analysis/src/main/scala/docspell/analysis/contact/Contact.scala +++ b/modules/analysis/src/main/scala/docspell/analysis/contact/Contact.scala @@ -1,10 +1,10 @@ package docspell.analysis.contact -import fs2.Stream import cats.implicits._ +import fs2.Stream -import docspell.common._ import docspell.analysis.split._ +import docspell.common._ object Contact { private[this] val protocols = Set("ftp", "http", "https") diff --git a/modules/analysis/src/main/scala/docspell/analysis/contact/Domain.scala b/modules/analysis/src/main/scala/docspell/analysis/contact/Domain.scala index 69cb6aa7..aeb479cf 100644 --- a/modules/analysis/src/main/scala/docspell/analysis/contact/Domain.scala +++ b/modules/analysis/src/main/scala/docspell/analysis/contact/Domain.scala @@ -1,6 +1,7 @@ package docspell.analysis.contact import cats.data.NonEmptyList + import docspell.common.LenientUri case class Domain(labels: NonEmptyList[String], tld: String) { diff --git a/modules/analysis/src/main/scala/docspell/analysis/date/DateFind.scala b/modules/analysis/src/main/scala/docspell/analysis/date/DateFind.scala index 8a97c3e1..86fea719 100644 --- a/modules/analysis/src/main/scala/docspell/analysis/date/DateFind.scala +++ b/modules/analysis/src/main/scala/docspell/analysis/date/DateFind.scala @@ -2,12 +2,13 @@ package docspell.analysis.date import java.time.LocalDate -import fs2.{Pure, Stream} -import docspell.common._ -import docspell.analysis.split._ - import scala.util.Try +import fs2.{Pure, Stream} + +import docspell.analysis.split._ +import docspell.common._ + object DateFind { def findDates(text: String, lang: Language): Stream[Pure, NerDateLabel] = diff --git a/modules/analysis/src/main/scala/docspell/analysis/nlp/StanfordNerClassifier.scala b/modules/analysis/src/main/scala/docspell/analysis/nlp/StanfordNerClassifier.scala index 53f5c93b..094abcca 100644 --- a/modules/analysis/src/main/scala/docspell/analysis/nlp/StanfordNerClassifier.scala +++ b/modules/analysis/src/main/scala/docspell/analysis/nlp/StanfordNerClassifier.scala @@ -3,16 +3,16 @@ package docspell.analysis.nlp import java.net.URL import java.util.zip.GZIPInputStream +import scala.jdk.CollectionConverters._ +import scala.util.Using + +import docspell.common._ + import edu.stanford.nlp.ie.AbstractSequenceClassifier import edu.stanford.nlp.ie.crf.CRFClassifier import edu.stanford.nlp.ling.{CoreAnnotations, CoreLabel} import org.log4s.getLogger -import docspell.common._ - -import scala.util.Using -import scala.jdk.CollectionConverters._ - object StanfordNerClassifier { private[this] val logger = getLogger diff --git a/modules/backend/src/main/scala/docspell/backend/BackendApp.scala b/modules/backend/src/main/scala/docspell/backend/BackendApp.scala index acb4e08d..a9f6274c 100644 --- a/modules/backend/src/main/scala/docspell/backend/BackendApp.scala +++ b/modules/backend/src/main/scala/docspell/backend/BackendApp.scala @@ -1,20 +1,21 @@ package docspell.backend -import cats.effect.{Blocker, ConcurrentEffect, ContextShift, Resource} -import org.http4s.client.Client -import org.http4s.client.blaze.BlazeClientBuilder +import scala.concurrent.ExecutionContext + +import cats.effect._ import docspell.backend.auth.Login import docspell.backend.ops._ import docspell.backend.signup.OSignup +import docspell.ftsclient.FtsClient import docspell.joexapi.client.JoexClient import docspell.store.Store import docspell.store.queue.JobQueue import docspell.store.usertask.UserTaskStore -import docspell.ftsclient.FtsClient -import scala.concurrent.ExecutionContext import emil.javamail.{JavaMailEmil, Settings} +import org.http4s.client.Client +import org.http4s.client.blaze.BlazeClientBuilder trait BackendApp[F[_]] { diff --git a/modules/backend/src/main/scala/docspell/backend/Common.scala b/modules/backend/src/main/scala/docspell/backend/Common.scala index bd86c900..bf16e8eb 100644 --- a/modules/backend/src/main/scala/docspell/backend/Common.scala +++ b/modules/backend/src/main/scala/docspell/backend/Common.scala @@ -1,6 +1,7 @@ package docspell.backend import cats.effect._ + import org.mindrot.jbcrypt.BCrypt object Common { diff --git a/modules/backend/src/main/scala/docspell/backend/JobFactory.scala b/modules/backend/src/main/scala/docspell/backend/JobFactory.scala index 42d6a654..d7d8fe91 100644 --- a/modules/backend/src/main/scala/docspell/backend/JobFactory.scala +++ b/modules/backend/src/main/scala/docspell/backend/JobFactory.scala @@ -2,6 +2,7 @@ package docspell.backend import cats.effect._ import cats.implicits._ + import docspell.common._ import docspell.store.records.RJob diff --git a/modules/backend/src/main/scala/docspell/backend/PasswordCrypt.scala b/modules/backend/src/main/scala/docspell/backend/PasswordCrypt.scala index 003ad510..965ffb02 100644 --- a/modules/backend/src/main/scala/docspell/backend/PasswordCrypt.scala +++ b/modules/backend/src/main/scala/docspell/backend/PasswordCrypt.scala @@ -1,6 +1,7 @@ package docspell.backend import docspell.common.Password + import org.mindrot.jbcrypt.BCrypt object PasswordCrypt { diff --git a/modules/backend/src/main/scala/docspell/backend/auth/AuthToken.scala b/modules/backend/src/main/scala/docspell/backend/auth/AuthToken.scala index 094cd3ad..2b986f88 100644 --- a/modules/backend/src/main/scala/docspell/backend/auth/AuthToken.scala +++ b/modules/backend/src/main/scala/docspell/backend/auth/AuthToken.scala @@ -1,17 +1,18 @@ package docspell.backend.auth +import java.time.Instant +import javax.crypto.Mac +import javax.crypto.spec.SecretKeySpec + import cats.effect._ import cats.implicits._ -import java.time.Instant - -import javax.crypto.Mac -import javax.crypto.spec.SecretKeySpec -import scodec.bits.ByteVector import docspell.backend.Common -import AuthToken._ +import docspell.backend.auth.AuthToken._ import docspell.common._ +import scodec.bits.ByteVector + case class AuthToken(millis: Long, account: AccountId, salt: String, sig: String) { def asString = s"$millis-${b64enc(account.asString)}-$salt-$sig" diff --git a/modules/backend/src/main/scala/docspell/backend/auth/Login.scala b/modules/backend/src/main/scala/docspell/backend/auth/Login.scala index 38fd4ada..7d495467 100644 --- a/modules/backend/src/main/scala/docspell/backend/auth/Login.scala +++ b/modules/backend/src/main/scala/docspell/backend/auth/Login.scala @@ -2,14 +2,16 @@ package docspell.backend.auth import cats.effect._ import cats.implicits._ -import Login._ + +import docspell.backend.auth.Login._ import docspell.common._ import docspell.store.Store import docspell.store.queries.QLogin import docspell.store.records.RUser + +import org.log4s._ import org.mindrot.jbcrypt.BCrypt import scodec.bits.ByteVector -import org.log4s._ trait Login[F[_]] { diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OCollective.scala b/modules/backend/src/main/scala/docspell/backend/ops/OCollective.scala index eda0f00b..72e82f50 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OCollective.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OCollective.scala @@ -1,14 +1,15 @@ package docspell.backend.ops -import fs2.Stream -import cats.implicits._ import cats.effect.{Effect, Resource} -import docspell.common._ -import docspell.store.{AddResult, Store} -import docspell.store.records.{RCollective, RContact, RUser} -import OCollective._ +import cats.implicits._ +import fs2.Stream + import docspell.backend.PasswordCrypt +import docspell.backend.ops.OCollective._ +import docspell.common._ import docspell.store.queries.QCollective +import docspell.store.records.{RCollective, RContact, RUser} +import docspell.store.{AddResult, Store} trait OCollective[F[_]] { diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OEquipment.scala b/modules/backend/src/main/scala/docspell/backend/ops/OEquipment.scala index 197449ba..bfb8537d 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OEquipment.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OEquipment.scala @@ -1,10 +1,11 @@ package docspell.backend.ops -import cats.implicits._ import cats.effect.{Effect, Resource} +import cats.implicits._ + import docspell.common.{AccountId, Ident} -import docspell.store.{AddResult, Store} import docspell.store.records.{REquipment, RItem} +import docspell.store.{AddResult, Store} trait OEquipment[F[_]] { diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OFulltext.scala b/modules/backend/src/main/scala/docspell/backend/ops/OFulltext.scala index 33bedffc..77f9fab4 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OFulltext.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OFulltext.scala @@ -3,14 +3,15 @@ package docspell.backend.ops import cats.effect._ import cats.implicits._ import fs2.Stream + +import docspell.backend.JobFactory +import docspell.backend.ops.OItemSearch._ import docspell.common._ import docspell.ftsclient._ -import docspell.backend.JobFactory import docspell.store.Store -import docspell.store.records.RJob -import docspell.store.queue.JobQueue import docspell.store.queries.QItem -import OItemSearch.{Batch, ListItem, ListItemWithTags, Query} +import docspell.store.queue.JobQueue +import docspell.store.records.RJob trait OFulltext[F[_]] { diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OItem.scala b/modules/backend/src/main/scala/docspell/backend/ops/OItem.scala index 9a9cd646..7c170230 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OItem.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OItem.scala @@ -1,16 +1,18 @@ package docspell.backend.ops import cats.data.OptionT -import cats.implicits._ import cats.effect.{Effect, Resource} +import cats.implicits._ + +import docspell.common._ +import docspell.ftsclient.FtsClient +import docspell.store.queries.{QAttachment, QItem} +import docspell.store.records._ +import docspell.store.{AddResult, Store} + import doobie._ import doobie.implicits._ import org.log4s.getLogger -import docspell.store.{AddResult, Store} -import docspell.store.queries.{QAttachment, QItem} -import docspell.common._ -import docspell.store.records._ -import docspell.ftsclient.FtsClient trait OItem[F[_]] { diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OItemSearch.scala b/modules/backend/src/main/scala/docspell/backend/ops/OItemSearch.scala index d6bf64ee..de517fb5 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OItemSearch.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OItemSearch.scala @@ -1,26 +1,19 @@ package docspell.backend.ops -import fs2.Stream import cats.data.OptionT -import cats.implicits._ import cats.effect.{Effect, Resource} -import doobie.implicits._ +import cats.implicits._ +import fs2.Stream + +import docspell.backend.ops.OItemSearch._ +import docspell.common._ import docspell.store.Store import docspell.store.queries.{QAttachment, QItem} -import OItemSearch.{ - AttachmentArchiveData, - AttachmentData, - AttachmentSourceData, - Batch, - ItemData, - ListItem, - ListItemWithTags, - Query -} -import bitpeace.{FileMeta, RangeDef} -import docspell.common._ import docspell.store.records._ +import bitpeace.{FileMeta, RangeDef} +import doobie.implicits._ + trait OItemSearch[F[_]] { def findItem(id: Ident, collective: Ident): F[Option[ItemData]] diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OJob.scala b/modules/backend/src/main/scala/docspell/backend/ops/OJob.scala index d24cd975..9a05337c 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OJob.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OJob.scala @@ -1,8 +1,9 @@ package docspell.backend.ops -import cats.implicits._ -import cats.effect._ import cats.data.OptionT +import cats.effect._ +import cats.implicits._ + import docspell.backend.ops.OJob.{CollectiveQueueState, JobCancelResult} import docspell.common.{Ident, JobState} import docspell.store.Store diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OJoex.scala b/modules/backend/src/main/scala/docspell/backend/ops/OJoex.scala index 95659b93..a954488b 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OJoex.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OJoex.scala @@ -1,15 +1,16 @@ package docspell.backend.ops -import cats.implicits._ -import cats.effect._ +import scala.concurrent.ExecutionContext + import cats.data.OptionT +import cats.effect._ +import cats.implicits._ + import docspell.common.{Ident, NodeType} import docspell.joexapi.client.JoexClient import docspell.store.Store import docspell.store.records.RNode -import scala.concurrent.ExecutionContext - trait OJoex[F[_]] { def notifyAllNodes: F[Unit] diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OMail.scala b/modules/backend/src/main/scala/docspell/backend/ops/OMail.scala index 18b59f93..f761570c 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OMail.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OMail.scala @@ -1,18 +1,19 @@ package docspell.backend.ops -import fs2.Stream +import cats.data.OptionT import cats.effect._ import cats.implicits._ -import cats.data.OptionT -import emil._ -import bitpeace.{FileMeta, RangeDef} +import fs2.Stream +import docspell.backend.ops.OMail._ import docspell.common._ import docspell.store._ -import docspell.store.syntax.MimeTypes._ -import docspell.store.records._ import docspell.store.queries.QMails -import OMail.{ImapSettings, ItemMail, Sent, SmtpSettings} +import docspell.store.records._ +import docspell.store.syntax.MimeTypes._ + +import bitpeace.{FileMeta, RangeDef} +import emil._ trait OMail[F[_]] { diff --git a/modules/backend/src/main/scala/docspell/backend/ops/ONode.scala b/modules/backend/src/main/scala/docspell/backend/ops/ONode.scala index 722ceef3..b81de589 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/ONode.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/ONode.scala @@ -2,10 +2,12 @@ package docspell.backend.ops import cats.effect.{Effect, Resource} import cats.implicits._ + import docspell.common.syntax.all._ import docspell.common.{Ident, LenientUri, NodeType} import docspell.store.Store import docspell.store.records.RNode + import org.log4s._ trait ONode[F[_]] { diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OOrganization.scala b/modules/backend/src/main/scala/docspell/backend/ops/OOrganization.scala index 1690fc8d..ca192b97 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OOrganization.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OOrganization.scala @@ -1,12 +1,13 @@ package docspell.backend.ops -import cats.implicits._ import cats.effect.{Effect, Resource} +import cats.implicits._ + +import docspell.backend.ops.OOrganization._ import docspell.common._ import docspell.store._ -import docspell.store.records._ -import OOrganization._ import docspell.store.queries.QOrganization +import docspell.store.records._ trait OOrganization[F[_]] { def findAllOrg(account: AccountId, query: Option[String]): F[Vector[OrgAndContacts]] diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OSource.scala b/modules/backend/src/main/scala/docspell/backend/ops/OSource.scala index 286670fc..1208e987 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OSource.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OSource.scala @@ -1,10 +1,11 @@ package docspell.backend.ops -import cats.implicits._ import cats.effect.{Effect, Resource} +import cats.implicits._ + import docspell.common.{AccountId, Ident} -import docspell.store.{AddResult, Store} import docspell.store.records.RSource +import docspell.store.{AddResult, Store} trait OSource[F[_]] { diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OTag.scala b/modules/backend/src/main/scala/docspell/backend/ops/OTag.scala index 45eaa230..2a805546 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OTag.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OTag.scala @@ -1,10 +1,11 @@ package docspell.backend.ops -import cats.implicits._ import cats.effect.{Effect, Resource} +import cats.implicits._ + import docspell.common.{AccountId, Ident} -import docspell.store.{AddResult, Store} import docspell.store.records.{RTag, RTagItem} +import docspell.store.{AddResult, Store} trait OTag[F[_]] { diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OUpload.scala b/modules/backend/src/main/scala/docspell/backend/ops/OUpload.scala index 44f89a9f..6d9f0669 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OUpload.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OUpload.scala @@ -1,17 +1,19 @@ package docspell.backend.ops -import bitpeace.MimetypeHint import cats.Functor import cats.data.{EitherT, OptionT} import cats.effect._ import cats.implicits._ -import docspell.backend.{Config, JobFactory} import fs2.Stream + +import docspell.backend.{Config, JobFactory} import docspell.common._ import docspell.common.syntax.all._ import docspell.store.Store import docspell.store.queue.JobQueue import docspell.store.records._ + +import bitpeace.MimetypeHint import org.log4s._ trait OUpload[F[_]] { diff --git a/modules/backend/src/main/scala/docspell/backend/ops/OUserTask.scala b/modules/backend/src/main/scala/docspell/backend/ops/OUserTask.scala index 3582240d..ca2816c6 100644 --- a/modules/backend/src/main/scala/docspell/backend/ops/OUserTask.scala +++ b/modules/backend/src/main/scala/docspell/backend/ops/OUserTask.scala @@ -1,14 +1,15 @@ package docspell.backend.ops -import cats.implicits._ -import cats.effect._ import cats.data.OptionT -import io.circe.Encoder +import cats.effect._ +import cats.implicits._ import fs2.Stream +import docspell.common._ import docspell.store.queue.JobQueue import docspell.store.usertask._ -import docspell.common._ + +import io.circe.Encoder trait OUserTask[F[_]] { diff --git a/modules/backend/src/main/scala/docspell/backend/signup/Config.scala b/modules/backend/src/main/scala/docspell/backend/signup/Config.scala index e7b9b1dd..0635044d 100644 --- a/modules/backend/src/main/scala/docspell/backend/signup/Config.scala +++ b/modules/backend/src/main/scala/docspell/backend/signup/Config.scala @@ -1,6 +1,7 @@ package docspell.backend.signup import docspell.common.{Duration, Password} + import io.circe._ case class Config(mode: Config.Mode, newInvitePassword: Password, inviteTime: Duration) diff --git a/modules/backend/src/main/scala/docspell/backend/signup/OSignup.scala b/modules/backend/src/main/scala/docspell/backend/signup/OSignup.scala index 65cb6276..0ea599c7 100644 --- a/modules/backend/src/main/scala/docspell/backend/signup/OSignup.scala +++ b/modules/backend/src/main/scala/docspell/backend/signup/OSignup.scala @@ -1,13 +1,15 @@ package docspell.backend.signup -import cats.implicits._ import cats.effect.{Effect, Resource} +import cats.implicits._ + import docspell.backend.PasswordCrypt import docspell.backend.ops.OCollective.RegisterData -import docspell.common.syntax.all._ import docspell.common._ -import docspell.store.{AddResult, Store} +import docspell.common.syntax.all._ import docspell.store.records.{RCollective, RInvitation, RUser} +import docspell.store.{AddResult, Store} + import doobie.free.connection.ConnectionIO import org.log4s.getLogger diff --git a/modules/common/src/main/scala/docspell/common/Binary.scala b/modules/common/src/main/scala/docspell/common/Binary.scala index f45c28a2..74fb27e2 100644 --- a/modules/common/src/main/scala/docspell/common/Binary.scala +++ b/modules/common/src/main/scala/docspell/common/Binary.scala @@ -1,9 +1,11 @@ package docspell.common +import java.nio.charset.Charset +import java.nio.charset.StandardCharsets + import cats.effect._ import fs2.{Chunk, Pipe, Stream} -import java.nio.charset.Charset -import java.nio.charset.StandardCharsets + import scodec.bits.ByteVector final case class Binary[F[_]](name: String, mime: MimeType, data: Stream[F, Byte]) { diff --git a/modules/common/src/main/scala/docspell/common/Duration.scala b/modules/common/src/main/scala/docspell/common/Duration.scala index f010fbd0..f154a292 100644 --- a/modules/common/src/main/scala/docspell/common/Duration.scala +++ b/modules/common/src/main/scala/docspell/common/Duration.scala @@ -1,11 +1,14 @@ package docspell.common -import cats.implicits._ -import scala.concurrent.duration.{FiniteDuration, Duration => SDur} import java.time.{Duration => JDur} import java.util.concurrent.TimeUnit -import io.circe._ + +import scala.concurrent.duration.{Duration => SDur, FiniteDuration} + import cats.effect.Sync +import cats.implicits._ + +import io.circe._ case class Duration(nanos: Long) { diff --git a/modules/common/src/main/scala/docspell/common/File.scala b/modules/common/src/main/scala/docspell/common/File.scala index c20f35ef..e9596fa8 100644 --- a/modules/common/src/main/scala/docspell/common/File.scala +++ b/modules/common/src/main/scala/docspell/common/File.scala @@ -1,14 +1,15 @@ package docspell.common import java.io.IOException +import java.nio.file._ import java.nio.file.attribute.BasicFileAttributes -import java.nio.file.{FileVisitResult, Files, Path, SimpleFileVisitor} import java.util.concurrent.atomic.AtomicInteger import scala.jdk.CollectionConverters._ -import fs2.Stream -import cats.implicits._ + import cats.effect._ +import cats.implicits._ +import fs2.Stream object File { diff --git a/modules/common/src/main/scala/docspell/common/Hash.scala b/modules/common/src/main/scala/docspell/common/Hash.scala index 2737c3e7..a3c3c6ad 100644 --- a/modules/common/src/main/scala/docspell/common/Hash.scala +++ b/modules/common/src/main/scala/docspell/common/Hash.scala @@ -1,8 +1,9 @@ package docspell.common -import scodec.bits.ByteVector import java.nio.charset.StandardCharsets +import scodec.bits.ByteVector + final class Hash(bytes: ByteVector) { private def digest(name: String): String = diff --git a/modules/common/src/main/scala/docspell/common/Ident.scala b/modules/common/src/main/scala/docspell/common/Ident.scala index 3d752053..dcb8cf2d 100644 --- a/modules/common/src/main/scala/docspell/common/Ident.scala +++ b/modules/common/src/main/scala/docspell/common/Ident.scala @@ -4,8 +4,9 @@ import java.security.SecureRandom import java.util.UUID import cats.Eq -import cats.implicits._ import cats.effect.Sync +import cats.implicits._ + import io.circe.{Decoder, Encoder} import scodec.bits.ByteVector diff --git a/modules/common/src/main/scala/docspell/common/ItemState.scala b/modules/common/src/main/scala/docspell/common/ItemState.scala index 77766295..aa3ede41 100644 --- a/modules/common/src/main/scala/docspell/common/ItemState.scala +++ b/modules/common/src/main/scala/docspell/common/ItemState.scala @@ -1,8 +1,9 @@ package docspell.common -import io.circe.{Decoder, Encoder} import cats.data.NonEmptyList +import io.circe.{Decoder, Encoder} + sealed trait ItemState { self: Product => final def name: String = diff --git a/modules/common/src/main/scala/docspell/common/LenientUri.scala b/modules/common/src/main/scala/docspell/common/LenientUri.scala index a3aa7151..57adf4b8 100644 --- a/modules/common/src/main/scala/docspell/common/LenientUri.scala +++ b/modules/common/src/main/scala/docspell/common/LenientUri.scala @@ -1,17 +1,19 @@ package docspell.common -import java.net.URL - -import fs2.Stream -import cats.implicits._ -import cats.data.NonEmptyList -import cats.effect.{Blocker, ContextShift, Sync} -import docspell.common.LenientUri.Path -import io.circe.{Decoder, Encoder} -import java.net.URLEncoder -import scodec.bits.ByteVector -import cats.effect.Resource import java.net.HttpURLConnection +import java.net.URL +import java.net.URLEncoder + +import cats.data.NonEmptyList +import cats.effect.Resource +import cats.effect.{Blocker, ContextShift, Sync} +import cats.implicits._ +import fs2.Stream + +import docspell.common.LenientUri.Path + +import io.circe.{Decoder, Encoder} +import scodec.bits.ByteVector /** A URI. * diff --git a/modules/common/src/main/scala/docspell/common/Logger.scala b/modules/common/src/main/scala/docspell/common/Logger.scala index 2472f2e1..6b340cce 100644 --- a/modules/common/src/main/scala/docspell/common/Logger.scala +++ b/modules/common/src/main/scala/docspell/common/Logger.scala @@ -1,7 +1,9 @@ package docspell.common import cats.effect.Sync + import docspell.common.syntax.all._ + import org.log4s.{Logger => Log4sLogger} trait Logger[F[_]] { diff --git a/modules/common/src/main/scala/docspell/common/MetaProposal.scala b/modules/common/src/main/scala/docspell/common/MetaProposal.scala index d1e236ec..a68affff 100644 --- a/modules/common/src/main/scala/docspell/common/MetaProposal.scala +++ b/modules/common/src/main/scala/docspell/common/MetaProposal.scala @@ -1,13 +1,16 @@ package docspell.common -import cats.implicits._ +import java.time.LocalDate + import cats.data.NonEmptyList -import docspell.common._ +import cats.implicits._ +import cats.kernel.Order + import docspell.common.MetaProposal.Candidate +import docspell.common._ + import io.circe._ import io.circe.generic.semiauto._ -import java.time.LocalDate -import cats.kernel.Order /** A proposed meta data to an item. * diff --git a/modules/common/src/main/scala/docspell/common/MetaProposalList.scala b/modules/common/src/main/scala/docspell/common/MetaProposalList.scala index 4b62b686..d75693d8 100644 --- a/modules/common/src/main/scala/docspell/common/MetaProposalList.scala +++ b/modules/common/src/main/scala/docspell/common/MetaProposalList.scala @@ -2,7 +2,9 @@ package docspell.common import cats.data.NonEmptyList import cats.kernel.Monoid + import docspell.common.MetaProposal.Candidate + import io.circe._ import io.circe.generic.semiauto._ diff --git a/modules/common/src/main/scala/docspell/common/MimeType.scala b/modules/common/src/main/scala/docspell/common/MimeType.scala index a73a7a53..67fe15cb 100644 --- a/modules/common/src/main/scala/docspell/common/MimeType.scala +++ b/modules/common/src/main/scala/docspell/common/MimeType.scala @@ -1,11 +1,14 @@ package docspell.common -import docspell.common.syntax.all._ -import io.circe.{Decoder, Encoder} -import java.nio.charset.StandardCharsets import java.nio.charset.Charset +import java.nio.charset.StandardCharsets + import cats.data.NonEmptyList +import docspell.common.syntax.all._ + +import io.circe.{Decoder, Encoder} + /** A MIME Type impl with just enough features for the use here. */ case class MimeType(primary: String, sub: String, params: Map[String, String]) { diff --git a/modules/common/src/main/scala/docspell/common/NotifyDueItemsArgs.scala b/modules/common/src/main/scala/docspell/common/NotifyDueItemsArgs.scala index 0310c295..4e3ec089 100644 --- a/modules/common/src/main/scala/docspell/common/NotifyDueItemsArgs.scala +++ b/modules/common/src/main/scala/docspell/common/NotifyDueItemsArgs.scala @@ -1,8 +1,10 @@ package docspell.common -import io.circe._, io.circe.generic.semiauto._ import docspell.common.syntax.all._ +import io.circe._ +import io.circe.generic.semiauto._ + /** Arguments to the notification task. * * This tasks queries items with a due date and informs the user via diff --git a/modules/common/src/main/scala/docspell/common/Pools.scala b/modules/common/src/main/scala/docspell/common/Pools.scala index fd30b9fb..c55ec1c5 100644 --- a/modules/common/src/main/scala/docspell/common/Pools.scala +++ b/modules/common/src/main/scala/docspell/common/Pools.scala @@ -1,8 +1,9 @@ package docspell.common -import cats.effect._ import scala.concurrent.ExecutionContext +import cats.effect._ + /** Captures thread pools to use in an application. */ case class Pools( diff --git a/modules/common/src/main/scala/docspell/common/Priority.scala b/modules/common/src/main/scala/docspell/common/Priority.scala index 25f6f1c6..10e5f003 100644 --- a/modules/common/src/main/scala/docspell/common/Priority.scala +++ b/modules/common/src/main/scala/docspell/common/Priority.scala @@ -1,7 +1,8 @@ package docspell.common -import cats.implicits._ import cats.Order +import cats.implicits._ + import io.circe.{Decoder, Encoder} sealed trait Priority { self: Product => diff --git a/modules/common/src/main/scala/docspell/common/ProcessItemArgs.scala b/modules/common/src/main/scala/docspell/common/ProcessItemArgs.scala index 799831f9..a4b209dd 100644 --- a/modules/common/src/main/scala/docspell/common/ProcessItemArgs.scala +++ b/modules/common/src/main/scala/docspell/common/ProcessItemArgs.scala @@ -1,8 +1,10 @@ package docspell.common -import io.circe._, io.circe.generic.semiauto._ +import docspell.common.ProcessItemArgs._ import docspell.common.syntax.all._ -import ProcessItemArgs._ + +import io.circe._ +import io.circe.generic.semiauto._ /** Arguments to the process-item task. * diff --git a/modules/common/src/main/scala/docspell/common/ScanMailboxArgs.scala b/modules/common/src/main/scala/docspell/common/ScanMailboxArgs.scala index f84e30ea..c4687a41 100644 --- a/modules/common/src/main/scala/docspell/common/ScanMailboxArgs.scala +++ b/modules/common/src/main/scala/docspell/common/ScanMailboxArgs.scala @@ -1,8 +1,10 @@ package docspell.common -import io.circe._, io.circe.generic.semiauto._ import docspell.common.syntax.all._ +import io.circe._ +import io.circe.generic.semiauto._ + /** Arguments to the poll-mailbox task. * * This tasks queries user mailboxes and pushes found mails into diff --git a/modules/common/src/main/scala/docspell/common/SystemCommand.scala b/modules/common/src/main/scala/docspell/common/SystemCommand.scala index ddff8dc0..88cf7bac 100644 --- a/modules/common/src/main/scala/docspell/common/SystemCommand.scala +++ b/modules/common/src/main/scala/docspell/common/SystemCommand.scala @@ -5,12 +5,12 @@ import java.lang.ProcessBuilder.Redirect import java.nio.file.Path import java.util.concurrent.TimeUnit -import cats.implicits._ -import cats.effect.{Blocker, ContextShift, Sync} -import fs2.{Stream, io, text} - import scala.jdk.CollectionConverters._ +import cats.effect.{Blocker, ContextShift, Sync} +import cats.implicits._ +import fs2.{Stream, io, text} + object SystemCommand { final case class Config(program: String, args: Seq[String], timeout: Duration) { diff --git a/modules/common/src/main/scala/docspell/common/ThreadFactories.scala b/modules/common/src/main/scala/docspell/common/ThreadFactories.scala index e3e4cc9d..230e7885 100644 --- a/modules/common/src/main/scala/docspell/common/ThreadFactories.scala +++ b/modules/common/src/main/scala/docspell/common/ThreadFactories.scala @@ -1,12 +1,14 @@ package docspell.common -import java.util.concurrent.atomic.AtomicLong -import java.util.concurrent.{Executors, ThreadFactory} -import cats.effect._ -import scala.concurrent._ import java.util.concurrent.ForkJoinPool import java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory import java.util.concurrent.ForkJoinWorkerThread +import java.util.concurrent.atomic.AtomicLong +import java.util.concurrent.{Executors, ThreadFactory} + +import scala.concurrent._ + +import cats.effect._ object ThreadFactories { diff --git a/modules/common/src/main/scala/docspell/common/Timestamp.scala b/modules/common/src/main/scala/docspell/common/Timestamp.scala index 1f970d41..c18bb6aa 100644 --- a/modules/common/src/main/scala/docspell/common/Timestamp.scala +++ b/modules/common/src/main/scala/docspell/common/Timestamp.scala @@ -1,12 +1,13 @@ package docspell.common +import java.time.LocalDateTime +import java.time.ZonedDateTime +import java.time.temporal.ChronoUnit import java.time.{Instant, LocalDate, ZoneId} import cats.effect.Sync + import io.circe.{Decoder, Encoder} -import java.time.temporal.ChronoUnit -import java.time.LocalDateTime -import java.time.ZonedDateTime case class Timestamp(value: Instant) { diff --git a/modules/common/src/main/scala/docspell/common/config/Implicits.scala b/modules/common/src/main/scala/docspell/common/config/Implicits.scala index 2a6619e4..c99c430a 100644 --- a/modules/common/src/main/scala/docspell/common/config/Implicits.scala +++ b/modules/common/src/main/scala/docspell/common/config/Implicits.scala @@ -1,12 +1,13 @@ package docspell.common.config +import scala.reflect.ClassTag + import docspell.common._ + +import com.github.eikek.calev.CalEvent import pureconfig._ import pureconfig.error.{CannotConvert, FailureReason} import scodec.bits.ByteVector -import com.github.eikek.calev.CalEvent - -import scala.reflect.ClassTag object Implicits { implicit val lenientUriReader: ConfigReader[LenientUri] = diff --git a/modules/common/src/main/scala/docspell/common/syntax/LoggerSyntax.scala b/modules/common/src/main/scala/docspell/common/syntax/LoggerSyntax.scala index 35d8ce4d..c58e7f08 100644 --- a/modules/common/src/main/scala/docspell/common/syntax/LoggerSyntax.scala +++ b/modules/common/src/main/scala/docspell/common/syntax/LoggerSyntax.scala @@ -2,6 +2,7 @@ package docspell.common.syntax import cats.effect.Sync import fs2.Stream + import org.log4s.Logger trait LoggerSyntax { diff --git a/modules/common/src/main/scala/docspell/common/syntax/StreamSyntax.scala b/modules/common/src/main/scala/docspell/common/syntax/StreamSyntax.scala index 88098648..a17931f0 100644 --- a/modules/common/src/main/scala/docspell/common/syntax/StreamSyntax.scala +++ b/modules/common/src/main/scala/docspell/common/syntax/StreamSyntax.scala @@ -1,8 +1,9 @@ package docspell.common.syntax import cats.effect.Sync -import fs2.Stream import cats.implicits._ +import fs2.Stream + import io.circe._ import io.circe.parser._ diff --git a/modules/common/src/main/scala/docspell/common/syntax/StringSyntax.scala b/modules/common/src/main/scala/docspell/common/syntax/StringSyntax.scala index d14f602e..67d29f24 100644 --- a/modules/common/src/main/scala/docspell/common/syntax/StringSyntax.scala +++ b/modules/common/src/main/scala/docspell/common/syntax/StringSyntax.scala @@ -1,6 +1,7 @@ package docspell.common.syntax import cats.implicits._ + import io.circe.Decoder import io.circe.parser._ diff --git a/modules/convert/src/main/scala/docspell/convert/Conversion.scala b/modules/convert/src/main/scala/docspell/convert/Conversion.scala index a77672f9..518340f3 100644 --- a/modules/convert/src/main/scala/docspell/convert/Conversion.scala +++ b/modules/convert/src/main/scala/docspell/convert/Conversion.scala @@ -2,9 +2,10 @@ package docspell.convert import java.nio.charset.StandardCharsets -import fs2._ import cats.effect._ import cats.implicits._ +import fs2._ + import docspell.common._ import docspell.convert.ConversionResult.Handler import docspell.convert.extern.{Tesseract, Unoconv, WkHtmlPdf} diff --git a/modules/convert/src/main/scala/docspell/convert/ConversionResult.scala b/modules/convert/src/main/scala/docspell/convert/ConversionResult.scala index 4f75a133..a5456649 100644 --- a/modules/convert/src/main/scala/docspell/convert/ConversionResult.scala +++ b/modules/convert/src/main/scala/docspell/convert/ConversionResult.scala @@ -2,6 +2,7 @@ package docspell.convert import cats.data.Kleisli import fs2.Stream + import docspell.common.MimeType sealed trait ConversionResult[F[_]] { diff --git a/modules/convert/src/main/scala/docspell/convert/SanitizeHtml.scala b/modules/convert/src/main/scala/docspell/convert/SanitizeHtml.scala index 8601789a..0badbb45 100644 --- a/modules/convert/src/main/scala/docspell/convert/SanitizeHtml.scala +++ b/modules/convert/src/main/scala/docspell/convert/SanitizeHtml.scala @@ -1,7 +1,8 @@ package docspell.convert -import scodec.bits.ByteVector import java.nio.charset.Charset +import scodec.bits.ByteVector + @FunctionalInterface trait SanitizeHtml { diff --git a/modules/convert/src/main/scala/docspell/convert/extern/ExternConv.scala b/modules/convert/src/main/scala/docspell/convert/extern/ExternConv.scala index 7e9a2a28..677affdf 100644 --- a/modules/convert/src/main/scala/docspell/convert/extern/ExternConv.scala +++ b/modules/convert/src/main/scala/docspell/convert/extern/ExternConv.scala @@ -2,9 +2,10 @@ package docspell.convert.extern import java.nio.file.Path -import cats.implicits._ import cats.effect._ +import cats.implicits._ import fs2.{Pipe, Stream} + import docspell.common._ import docspell.convert.ConversionResult import docspell.convert.ConversionResult.{Handler, successPdf, successPdfTxt} diff --git a/modules/convert/src/main/scala/docspell/convert/extern/Tesseract.scala b/modules/convert/src/main/scala/docspell/convert/extern/Tesseract.scala index 113e3e63..90fea777 100644 --- a/modules/convert/src/main/scala/docspell/convert/extern/Tesseract.scala +++ b/modules/convert/src/main/scala/docspell/convert/extern/Tesseract.scala @@ -4,6 +4,7 @@ import java.nio.file.Path import cats.effect._ import fs2.Stream + import docspell.common._ import docspell.convert.ConversionResult import docspell.convert.ConversionResult.Handler diff --git a/modules/convert/src/main/scala/docspell/convert/extern/Unoconv.scala b/modules/convert/src/main/scala/docspell/convert/extern/Unoconv.scala index a990d946..b27609aa 100644 --- a/modules/convert/src/main/scala/docspell/convert/extern/Unoconv.scala +++ b/modules/convert/src/main/scala/docspell/convert/extern/Unoconv.scala @@ -4,6 +4,7 @@ import java.nio.file.Path import cats.effect._ import fs2.Stream + import docspell.common._ import docspell.convert.ConversionResult import docspell.convert.ConversionResult.Handler diff --git a/modules/convert/src/main/scala/docspell/convert/extern/WkHtmlPdf.scala b/modules/convert/src/main/scala/docspell/convert/extern/WkHtmlPdf.scala index 41c88040..cf7d0678 100644 --- a/modules/convert/src/main/scala/docspell/convert/extern/WkHtmlPdf.scala +++ b/modules/convert/src/main/scala/docspell/convert/extern/WkHtmlPdf.scala @@ -1,14 +1,15 @@ package docspell.convert.extern +import java.nio.charset.Charset import java.nio.file.Path import cats.effect._ import cats.implicits._ import fs2.{Chunk, Stream} + import docspell.common._ -import docspell.convert.{ConversionResult, SanitizeHtml} import docspell.convert.ConversionResult.Handler -import java.nio.charset.Charset +import docspell.convert.{ConversionResult, SanitizeHtml} object WkHtmlPdf { diff --git a/modules/convert/src/main/scala/docspell/convert/flexmark/Markdown.scala b/modules/convert/src/main/scala/docspell/convert/flexmark/Markdown.scala index 2c801dbd..41e2c85e 100644 --- a/modules/convert/src/main/scala/docspell/convert/flexmark/Markdown.scala +++ b/modules/convert/src/main/scala/docspell/convert/flexmark/Markdown.scala @@ -3,18 +3,20 @@ package docspell.convert.flexmark import java.io.{InputStream, InputStreamReader} import java.nio.charset.Charset import java.util + import scala.util.Try import cats.effect.Sync import cats.implicits._ +import fs2.Stream + +import docspell.common._ + import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension import com.vladsch.flexmark.ext.tables.TablesExtension import com.vladsch.flexmark.html.HtmlRenderer import com.vladsch.flexmark.parser.Parser import com.vladsch.flexmark.util.data.{DataKey, MutableDataSet} -import fs2.Stream - -import docspell.common._ object Markdown { diff --git a/modules/extract/src/main/scala/docspell/extract/ExtractResult.scala b/modules/extract/src/main/scala/docspell/extract/ExtractResult.scala index ee948c53..3a0f3a1b 100644 --- a/modules/extract/src/main/scala/docspell/extract/ExtractResult.scala +++ b/modules/extract/src/main/scala/docspell/extract/ExtractResult.scala @@ -1,9 +1,9 @@ package docspell.extract -import docspell.common.MimeType - import scala.util.Try +import docspell.common.MimeType + sealed trait ExtractResult { def textOption: Option[String] diff --git a/modules/extract/src/main/scala/docspell/extract/Extraction.scala b/modules/extract/src/main/scala/docspell/extract/Extraction.scala index 54d41a09..cc333b71 100644 --- a/modules/extract/src/main/scala/docspell/extract/Extraction.scala +++ b/modules/extract/src/main/scala/docspell/extract/Extraction.scala @@ -2,15 +2,16 @@ package docspell.extract import cats.effect._ import cats.implicits._ +import fs2.Stream + import docspell.common._ +import docspell.extract.internal.Text import docspell.extract.ocr.{OcrType, TextExtract} import docspell.extract.odf.{OdfExtract, OdfType} import docspell.extract.poi.{PoiExtract, PoiType} import docspell.extract.rtf.RtfExtract -import docspell.extract.internal.Text -import fs2.Stream -import docspell.files.TikaMimetype import docspell.files.ImageSize +import docspell.files.TikaMimetype trait Extraction[F[_]] { diff --git a/modules/extract/src/main/scala/docspell/extract/PdfExtract.scala b/modules/extract/src/main/scala/docspell/extract/PdfExtract.scala index bcdd0226..6d2d4a7b 100644 --- a/modules/extract/src/main/scala/docspell/extract/PdfExtract.scala +++ b/modules/extract/src/main/scala/docspell/extract/PdfExtract.scala @@ -1,12 +1,13 @@ package docspell.extract -import cats.implicits._ import cats.effect._ +import cats.implicits._ import fs2.Stream + import docspell.common.{Language, Logger} +import docspell.extract.internal.Text import docspell.extract.ocr.{OcrConfig, TextExtract} import docspell.extract.pdfbox.PdfboxExtract -import docspell.extract.internal.Text object PdfExtract { diff --git a/modules/extract/src/main/scala/docspell/extract/ocr/Ocr.scala b/modules/extract/src/main/scala/docspell/extract/ocr/Ocr.scala index 292afd8d..bc39f94a 100644 --- a/modules/extract/src/main/scala/docspell/extract/ocr/Ocr.scala +++ b/modules/extract/src/main/scala/docspell/extract/ocr/Ocr.scala @@ -4,6 +4,7 @@ import java.nio.file.Path import cats.effect.{Blocker, ContextShift, Sync} import fs2.Stream + import docspell.common._ object Ocr { diff --git a/modules/extract/src/main/scala/docspell/extract/ocr/TextExtract.scala b/modules/extract/src/main/scala/docspell/extract/ocr/TextExtract.scala index 4abc00e1..afc0df7b 100644 --- a/modules/extract/src/main/scala/docspell/extract/ocr/TextExtract.scala +++ b/modules/extract/src/main/scala/docspell/extract/ocr/TextExtract.scala @@ -1,11 +1,12 @@ package docspell.extract.ocr import cats.effect.{Blocker, ContextShift, Sync} -import docspell.common._ -import docspell.files._ -import docspell.extract.internal.Text import fs2.Stream +import docspell.common._ +import docspell.extract.internal.Text +import docspell.files._ + object TextExtract { def extract[F[_]: Sync: ContextShift]( diff --git a/modules/extract/src/main/scala/docspell/extract/odf/OdfExtract.scala b/modules/extract/src/main/scala/docspell/extract/odf/OdfExtract.scala index 232be427..cd8cbd30 100644 --- a/modules/extract/src/main/scala/docspell/extract/odf/OdfExtract.scala +++ b/modules/extract/src/main/scala/docspell/extract/odf/OdfExtract.scala @@ -1,18 +1,20 @@ package docspell.extract.odf +import java.io.{ByteArrayInputStream, InputStream} + +import scala.util.Try + import cats.effect._ import cats.implicits._ import fs2.Stream -import java.io.{ByteArrayInputStream, InputStream} + +import docspell.extract.internal.Text import org.apache.tika.metadata.Metadata import org.apache.tika.parser.ParseContext import org.apache.tika.parser.odf.OpenDocumentParser import org.apache.tika.sax.BodyContentHandler -import scala.util.Try -import docspell.extract.internal.Text - object OdfExtract { def get[F[_]: Sync](data: Stream[F, Byte]): F[Either[Throwable, Text]] = diff --git a/modules/extract/src/main/scala/docspell/extract/pdfbox/PdfboxExtract.scala b/modules/extract/src/main/scala/docspell/extract/pdfbox/PdfboxExtract.scala index 502db289..d44e2af7 100644 --- a/modules/extract/src/main/scala/docspell/extract/pdfbox/PdfboxExtract.scala +++ b/modules/extract/src/main/scala/docspell/extract/pdfbox/PdfboxExtract.scala @@ -3,15 +3,17 @@ package docspell.extract.pdfbox import java.io.InputStream import java.nio.file.Path -import cats.implicits._ +import scala.util.{Try, Using} + import cats.effect.Sync +import cats.implicits._ +import fs2.Stream + +import docspell.extract.internal.Text + import org.apache.pdfbox.pdmodel.PDDocument import org.apache.pdfbox.text.PDFTextStripper -import scala.util.{Try, Using} -import fs2.Stream -import docspell.extract.internal.Text - object PdfboxExtract { def get[F[_]: Sync](data: Stream[F, Byte]): F[Either[Throwable, Text]] = diff --git a/modules/extract/src/main/scala/docspell/extract/poi/PoiExtract.scala b/modules/extract/src/main/scala/docspell/extract/poi/PoiExtract.scala index daae9aae..fd36ded9 100644 --- a/modules/extract/src/main/scala/docspell/extract/poi/PoiExtract.scala +++ b/modules/extract/src/main/scala/docspell/extract/poi/PoiExtract.scala @@ -2,9 +2,17 @@ package docspell.extract.poi import java.io.{ByteArrayInputStream, InputStream} +import scala.util.Try + import cats.data.EitherT -import cats.implicits._ import cats.effect.Sync +import cats.implicits._ +import fs2.Stream + +import docspell.common._ +import docspell.extract.internal.Text +import docspell.files.TikaMimetype + import org.apache.poi.hssf.extractor.ExcelExtractor import org.apache.poi.hssf.usermodel.HSSFWorkbook import org.apache.poi.hwpf.extractor.WordExtractor @@ -12,12 +20,6 @@ import org.apache.poi.xssf.extractor.XSSFExcelExtractor import org.apache.poi.xssf.usermodel.XSSFWorkbook import org.apache.poi.xwpf.extractor.XWPFWordExtractor import org.apache.poi.xwpf.usermodel.XWPFDocument -import fs2.Stream - -import scala.util.Try -import docspell.common._ -import docspell.files.TikaMimetype -import docspell.extract.internal.Text object PoiExtract { diff --git a/modules/extract/src/main/scala/docspell/extract/rtf/RtfExtract.scala b/modules/extract/src/main/scala/docspell/extract/rtf/RtfExtract.scala index 6850ed33..7ea80cbf 100644 --- a/modules/extract/src/main/scala/docspell/extract/rtf/RtfExtract.scala +++ b/modules/extract/src/main/scala/docspell/extract/rtf/RtfExtract.scala @@ -1,16 +1,17 @@ package docspell.extract.rtf import java.io.{ByteArrayInputStream, InputStream} - -import cats.implicits._ -import cats.effect.Sync -import docspell.common.MimeType -import docspell.extract.internal.Text -import fs2.Stream import javax.swing.text.rtf.RTFEditorKit import scala.util.Try +import cats.effect.Sync +import cats.implicits._ +import fs2.Stream + +import docspell.common.MimeType +import docspell.extract.internal.Text + object RtfExtract { val rtfType = MimeType.application("rtf") diff --git a/modules/files/src/main/scala/docspell/files/ImageSize.scala b/modules/files/src/main/scala/docspell/files/ImageSize.scala index ba9342d2..e1dc23b2 100644 --- a/modules/files/src/main/scala/docspell/files/ImageSize.scala +++ b/modules/files/src/main/scala/docspell/files/ImageSize.scala @@ -2,16 +2,16 @@ package docspell.files import java.io.{ByteArrayInputStream, InputStream} import java.nio.file.Path - -import cats.implicits._ -import cats.effect._ -import fs2.Stream import javax.imageio.stream.{FileImageInputStream, ImageInputStream} import javax.imageio.{ImageIO, ImageReader} import scala.jdk.CollectionConverters._ import scala.util.{Try, Using} +import cats.effect._ +import cats.implicits._ +import fs2.Stream + object ImageSize { /** Return the image size from its header without reading diff --git a/modules/files/src/main/scala/docspell/files/TikaMimetype.scala b/modules/files/src/main/scala/docspell/files/TikaMimetype.scala index 55ccc51d..b6fd0c48 100644 --- a/modules/files/src/main/scala/docspell/files/TikaMimetype.scala +++ b/modules/files/src/main/scala/docspell/files/TikaMimetype.scala @@ -1,19 +1,22 @@ package docspell.files import java.io.BufferedInputStream -import java.nio.file.{Files, Path} import java.nio.charset.Charset +import java.nio.file.{Files, Path} import scala.jdk.CollectionConverters._ import scala.util.Using -import cats.implicits._ + import cats.effect.Sync +import cats.implicits._ import fs2.Stream + +import docspell.common._ + import org.apache.tika.config.TikaConfig import org.apache.tika.metadata.{HttpHeaders, Metadata, TikaMetadataKeys} import org.apache.tika.mime.MediaType import org.apache.tika.parser.txt.Icu4jEncodingDetector -import docspell.common._ object TikaMimetype { private val tika = new TikaConfig().getDetector diff --git a/modules/files/src/main/scala/docspell/files/Zip.scala b/modules/files/src/main/scala/docspell/files/Zip.scala index fd786fa9..f09bd66d 100644 --- a/modules/files/src/main/scala/docspell/files/Zip.scala +++ b/modules/files/src/main/scala/docspell/files/Zip.scala @@ -1,11 +1,13 @@ package docspell.files +import java.io.InputStream +import java.nio.file.Paths +import java.util.zip.ZipInputStream + import cats.effect._ import cats.implicits._ import fs2.{Pipe, Stream} -import java.io.InputStream -import java.util.zip.ZipInputStream -import java.nio.file.Paths + import docspell.common.Binary object Zip { diff --git a/modules/fts-client/src/main/scala/docspell/ftsclient/FtsClient.scala b/modules/fts-client/src/main/scala/docspell/ftsclient/FtsClient.scala index 703162cc..3a0e3d17 100644 --- a/modules/fts-client/src/main/scala/docspell/ftsclient/FtsClient.scala +++ b/modules/fts-client/src/main/scala/docspell/ftsclient/FtsClient.scala @@ -1,11 +1,13 @@ package docspell.ftsclient -import fs2.Stream -import cats.implicits._ import cats.effect._ -import org.log4s.getLogger +import cats.implicits._ +import fs2.Stream + import docspell.common._ +import org.log4s.getLogger + /** The fts client is the interface for docspell to a fulltext search * engine. * diff --git a/modules/fts-client/src/main/scala/docspell/ftsclient/FtsResult.scala b/modules/fts-client/src/main/scala/docspell/ftsclient/FtsResult.scala index df1c43ac..5a5be229 100644 --- a/modules/fts-client/src/main/scala/docspell/ftsclient/FtsResult.scala +++ b/modules/fts-client/src/main/scala/docspell/ftsclient/FtsResult.scala @@ -1,8 +1,7 @@ package docspell.ftsclient import docspell.common._ - -import FtsResult.ItemMatch +import docspell.ftsclient.FtsResult.ItemMatch final case class FtsResult( qtime: Duration, diff --git a/modules/fts-solr/src/main/scala/docspell/ftssolr/Field.scala b/modules/fts-solr/src/main/scala/docspell/ftssolr/Field.scala index 256844ee..053eb5c8 100644 --- a/modules/fts-solr/src/main/scala/docspell/ftssolr/Field.scala +++ b/modules/fts-solr/src/main/scala/docspell/ftssolr/Field.scala @@ -1,8 +1,9 @@ package docspell.ftssolr -import io.circe._ import docspell.common._ +import io.circe._ + final class Field(val name: String) extends AnyVal { override def toString(): String = s"Field($name)" diff --git a/modules/fts-solr/src/main/scala/docspell/ftssolr/JsonCodec.scala b/modules/fts-solr/src/main/scala/docspell/ftssolr/JsonCodec.scala index 96ee969d..e532bf6b 100644 --- a/modules/fts-solr/src/main/scala/docspell/ftssolr/JsonCodec.scala +++ b/modules/fts-solr/src/main/scala/docspell/ftssolr/JsonCodec.scala @@ -1,9 +1,10 @@ package docspell.ftssolr +import docspell.common._ +import docspell.ftsclient._ + import io.circe._ import io.circe.syntax._ -import docspell.common._ -import docspell.ftsclient._ trait JsonCodec { diff --git a/modules/fts-solr/src/main/scala/docspell/ftssolr/QueryData.scala b/modules/fts-solr/src/main/scala/docspell/ftssolr/QueryData.scala index 063f3048..1ca3e483 100644 --- a/modules/fts-solr/src/main/scala/docspell/ftssolr/QueryData.scala +++ b/modules/fts-solr/src/main/scala/docspell/ftssolr/QueryData.scala @@ -1,8 +1,9 @@ package docspell.ftssolr +import docspell.ftsclient.FtsQuery + import io.circe._ import io.circe.generic.semiauto._ -import docspell.ftsclient.FtsQuery final case class QueryData( query: String, diff --git a/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrFtsClient.scala b/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrFtsClient.scala index 4bdf3fda..635c0d97 100644 --- a/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrFtsClient.scala +++ b/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrFtsClient.scala @@ -1,15 +1,16 @@ package docspell.ftssolr -import fs2.Stream import cats.effect._ import cats.implicits._ -import org.http4s.client.Client -import org.http4s.client.middleware.Logger -import org.log4s.getLogger +import fs2.Stream import docspell.common._ import docspell.ftsclient._ +import org.http4s.client.Client +import org.http4s.client.middleware.Logger +import org.log4s.getLogger + final class SolrFtsClient[F[_]: Effect]( solrUpdate: SolrUpdate[F], solrSetup: SolrSetup[F], diff --git a/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrQuery.scala b/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrQuery.scala index c557344d..e07e9c36 100644 --- a/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrQuery.scala +++ b/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrQuery.scala @@ -1,15 +1,16 @@ package docspell.ftssolr import cats.effect._ -import org.http4s._ -import org.http4s.client.Client -import org.http4s.circe._ -import org.http4s.circe.CirceEntityDecoder._ -import org.http4s.client.dsl.Http4sClientDsl -import _root_.io.circe.syntax._ import docspell.ftsclient._ -import JsonCodec._ +import docspell.ftssolr.JsonCodec._ + +import _root_.io.circe.syntax._ +import org.http4s._ +import org.http4s.circe.CirceEntityDecoder._ +import org.http4s.circe._ +import org.http4s.client.Client +import org.http4s.client.dsl.Http4sClientDsl trait SolrQuery[F[_]] { diff --git a/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrSetup.scala b/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrSetup.scala index c25431a8..6952c823 100644 --- a/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrSetup.scala +++ b/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrSetup.scala @@ -1,15 +1,17 @@ package docspell.ftssolr import cats.effect._ -import org.http4s._ import cats.implicits._ -import org.http4s.client.Client -import org.http4s.circe._ -import org.http4s.client.dsl.Http4sClientDsl -import _root_.io.circe.syntax._ + +import docspell.common._ + import _root_.io.circe._ import _root_.io.circe.generic.semiauto._ -import docspell.common._ +import _root_.io.circe.syntax._ +import org.http4s._ +import org.http4s.circe._ +import org.http4s.client.Client +import org.http4s.client.dsl.Http4sClientDsl trait SolrSetup[F[_]] { diff --git a/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrUpdate.scala b/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrUpdate.scala index fcfe1151..88089d51 100644 --- a/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrUpdate.scala +++ b/modules/fts-solr/src/main/scala/docspell/ftssolr/SolrUpdate.scala @@ -1,15 +1,16 @@ package docspell.ftssolr import cats.effect._ -import org.http4s._ -import org.http4s.client.Client -import org.http4s.circe._ -import org.http4s.client.dsl.Http4sClientDsl -import _root_.io.circe._ -import _root_.io.circe.syntax._ import docspell.ftsclient._ -import JsonCodec._ +import docspell.ftssolr.JsonCodec._ + +import _root_.io.circe._ +import _root_.io.circe.syntax._ +import org.http4s._ +import org.http4s.circe._ +import org.http4s.client.Client +import org.http4s.client.dsl.Http4sClientDsl trait SolrUpdate[F[_]] { diff --git a/modules/joex/src/main/scala/docspell/joex/Config.scala b/modules/joex/src/main/scala/docspell/joex/Config.scala index 095bfdc3..3625ffb1 100644 --- a/modules/joex/src/main/scala/docspell/joex/Config.scala +++ b/modules/joex/src/main/scala/docspell/joex/Config.scala @@ -1,14 +1,14 @@ package docspell.joex import docspell.analysis.TextAnalysisConfig +import docspell.backend.Config.Files import docspell.common._ -import docspell.joex.scheduler.{PeriodicSchedulerConfig, SchedulerConfig} -import docspell.store.JdbcConfig import docspell.convert.ConvertConfig import docspell.extract.ExtractConfig -import docspell.joex.hk.HouseKeepingConfig -import docspell.backend.Config.Files import docspell.ftssolr.SolrConfig +import docspell.joex.hk.HouseKeepingConfig +import docspell.joex.scheduler.{PeriodicSchedulerConfig, SchedulerConfig} +import docspell.store.JdbcConfig case class Config( appId: Ident, diff --git a/modules/joex/src/main/scala/docspell/joex/ConfigFile.scala b/modules/joex/src/main/scala/docspell/joex/ConfigFile.scala index 647fde6d..24af4ca9 100644 --- a/modules/joex/src/main/scala/docspell/joex/ConfigFile.scala +++ b/modules/joex/src/main/scala/docspell/joex/ConfigFile.scala @@ -1,9 +1,10 @@ package docspell.joex import docspell.common.config.Implicits._ +import docspell.joex.scheduler.CountingScheme + import pureconfig._ import pureconfig.generic.auto._ -import docspell.joex.scheduler.CountingScheme object ConfigFile { import Implicits._ diff --git a/modules/joex/src/main/scala/docspell/joex/JoexAppImpl.scala b/modules/joex/src/main/scala/docspell/joex/JoexAppImpl.scala index fe3fc586..ee59f2f9 100644 --- a/modules/joex/src/main/scala/docspell/joex/JoexAppImpl.scala +++ b/modules/joex/src/main/scala/docspell/joex/JoexAppImpl.scala @@ -1,26 +1,29 @@ package docspell.joex -import cats.implicits._ -import cats.effect._ -import emil.javamail._ -import fs2.concurrent.SignallingRef import scala.concurrent.ExecutionContext -import org.http4s.client.Client -import org.http4s.client.blaze.BlazeClientBuilder -import docspell.common._ + +import cats.effect._ +import cats.implicits._ +import fs2.concurrent.SignallingRef + import docspell.backend.ops._ +import docspell.common._ +import docspell.ftsclient.FtsClient +import docspell.ftssolr.SolrFtsClient +import docspell.joex.fts.{MigrationTask, ReIndexTask} import docspell.joex.hk._ import docspell.joex.notify._ -import docspell.joex.fts.{MigrationTask, ReIndexTask} -import docspell.joex.scanmailbox._ import docspell.joex.process.ItemHandler +import docspell.joex.scanmailbox._ import docspell.joex.scheduler._ import docspell.joexapi.client.JoexClient import docspell.store.Store import docspell.store.queue._ import docspell.store.records.RJobLog -import docspell.ftsclient.FtsClient -import docspell.ftssolr.SolrFtsClient + +import emil.javamail._ +import org.http4s.client.Client +import org.http4s.client.blaze.BlazeClientBuilder final class JoexAppImpl[F[_]: ConcurrentEffect: ContextShift: Timer]( cfg: Config, diff --git a/modules/joex/src/main/scala/docspell/joex/JoexServer.scala b/modules/joex/src/main/scala/docspell/joex/JoexServer.scala index 065360db..f103e76f 100644 --- a/modules/joex/src/main/scala/docspell/joex/JoexServer.scala +++ b/modules/joex/src/main/scala/docspell/joex/JoexServer.scala @@ -2,15 +2,17 @@ package docspell.joex import cats.effect._ import cats.effect.concurrent.Ref -import docspell.common.Pools -import docspell.joex.routes._ -import org.http4s.server.blaze.BlazeServerBuilder -import org.http4s.implicits._ import fs2.Stream import fs2.concurrent.SignallingRef + +import docspell.common.Pools +import docspell.joex.routes._ + import org.http4s.HttpApp -import org.http4s.server.middleware.Logger +import org.http4s.implicits._ import org.http4s.server.Router +import org.http4s.server.blaze.BlazeServerBuilder +import org.http4s.server.middleware.Logger object JoexServer { diff --git a/modules/joex/src/main/scala/docspell/joex/Main.scala b/modules/joex/src/main/scala/docspell/joex/Main.scala index bc984815..8a1890f5 100644 --- a/modules/joex/src/main/scala/docspell/joex/Main.scala +++ b/modules/joex/src/main/scala/docspell/joex/Main.scala @@ -1,11 +1,12 @@ package docspell.joex -import cats.effect.{Blocker, ExitCode, IO, IOApp} -import cats.implicits._ - import java.nio.file.{Files, Paths} +import cats.effect._ +import cats.implicits._ + import docspell.common.{Banner, Pools, ThreadFactories} + import org.log4s._ object Main extends IOApp { diff --git a/modules/joex/src/main/scala/docspell/joex/extract/JsoupSanitizer.scala b/modules/joex/src/main/scala/docspell/joex/extract/JsoupSanitizer.scala index d78fefbd..87d3ed2a 100644 --- a/modules/joex/src/main/scala/docspell/joex/extract/JsoupSanitizer.scala +++ b/modules/joex/src/main/scala/docspell/joex/extract/JsoupSanitizer.scala @@ -1,9 +1,10 @@ package docspell.joex.extract +import java.nio.charset.Charset + import emil.BodyContent import emil.jsoup._ import scodec.bits.ByteVector -import java.nio.charset.Charset object JsoupSanitizer { diff --git a/modules/joex/src/main/scala/docspell/joex/fts/FtsContext.scala b/modules/joex/src/main/scala/docspell/joex/fts/FtsContext.scala index ac1267e6..8bf28b77 100644 --- a/modules/joex/src/main/scala/docspell/joex/fts/FtsContext.scala +++ b/modules/joex/src/main/scala/docspell/joex/fts/FtsContext.scala @@ -1,10 +1,10 @@ package docspell.joex.fts import docspell.common.Logger +import docspell.ftsclient.FtsClient import docspell.joex.Config import docspell.joex.scheduler.Context import docspell.store.Store -import docspell.ftsclient.FtsClient case class FtsContext[F[_]]( cfg: Config.FullTextSearch, diff --git a/modules/joex/src/main/scala/docspell/joex/fts/FtsWork.scala b/modules/joex/src/main/scala/docspell/joex/fts/FtsWork.scala index 5e861b8d..a4952271 100644 --- a/modules/joex/src/main/scala/docspell/joex/fts/FtsWork.scala +++ b/modules/joex/src/main/scala/docspell/joex/fts/FtsWork.scala @@ -1,13 +1,14 @@ package docspell.joex.fts -import cats.effect._ import cats.data.{Kleisli, NonEmptyList} -import cats.{ApplicativeError, FlatMap, Semigroup} +import cats.effect._ import cats.implicits._ +import cats.{ApplicativeError, FlatMap, Semigroup} + import docspell.common._ import docspell.ftsclient._ -import docspell.joex.scheduler.Context import docspell.joex.Config +import docspell.joex.scheduler.Context import docspell.store.queries.{QAttachment, QItem} object FtsWork { diff --git a/modules/joex/src/main/scala/docspell/joex/fts/Migration.scala b/modules/joex/src/main/scala/docspell/joex/fts/Migration.scala index cfc63940..4eb7df6c 100644 --- a/modules/joex/src/main/scala/docspell/joex/fts/Migration.scala +++ b/modules/joex/src/main/scala/docspell/joex/fts/Migration.scala @@ -1,14 +1,15 @@ package docspell.joex.fts +import cats.Traverse +import cats.data.{Kleisli, OptionT} import cats.effect._ import cats.implicits._ -import cats.data.{Kleisli, OptionT} -import cats.Traverse + import docspell.common._ -import docspell.joex.Config -import docspell.store.{AddResult, Store} -import docspell.store.records.RFtsMigration import docspell.ftsclient._ +import docspell.joex.Config +import docspell.store.records.RFtsMigration +import docspell.store.{AddResult, Store} case class Migration[F[_]]( version: Int, diff --git a/modules/joex/src/main/scala/docspell/joex/fts/MigrationTask.scala b/modules/joex/src/main/scala/docspell/joex/fts/MigrationTask.scala index f7d1b980..4189fc25 100644 --- a/modules/joex/src/main/scala/docspell/joex/fts/MigrationTask.scala +++ b/modules/joex/src/main/scala/docspell/joex/fts/MigrationTask.scala @@ -2,10 +2,11 @@ package docspell.joex.fts import cats.effect._ import cats.implicits._ + import docspell.common._ +import docspell.ftsclient._ import docspell.joex.Config import docspell.joex.scheduler.Task -import docspell.ftsclient._ import docspell.store.records.RJob object MigrationTask { diff --git a/modules/joex/src/main/scala/docspell/joex/fts/ReIndexTask.scala b/modules/joex/src/main/scala/docspell/joex/fts/ReIndexTask.scala index edb1cc0d..205f31c8 100644 --- a/modules/joex/src/main/scala/docspell/joex/fts/ReIndexTask.scala +++ b/modules/joex/src/main/scala/docspell/joex/fts/ReIndexTask.scala @@ -1,11 +1,12 @@ package docspell.joex.fts import cats.effect._ + import docspell.common._ -import docspell.joex.Config -import docspell.joex.scheduler.Task import docspell.ftsclient._ -import FtsWork.syntax._ +import docspell.joex.Config +import docspell.joex.fts.FtsWork.syntax._ +import docspell.joex.scheduler.Task object ReIndexTask { type Args = ReIndexTaskArgs diff --git a/modules/joex/src/main/scala/docspell/joex/hk/CleanupInvitesTask.scala b/modules/joex/src/main/scala/docspell/joex/hk/CleanupInvitesTask.scala index 8a717864..2bbccfa1 100644 --- a/modules/joex/src/main/scala/docspell/joex/hk/CleanupInvitesTask.scala +++ b/modules/joex/src/main/scala/docspell/joex/hk/CleanupInvitesTask.scala @@ -1,7 +1,7 @@ package docspell.joex.hk -import cats.implicits._ import cats.effect._ +import cats.implicits._ import docspell.common._ import docspell.joex.scheduler.Task diff --git a/modules/joex/src/main/scala/docspell/joex/hk/CleanupJobsTask.scala b/modules/joex/src/main/scala/docspell/joex/hk/CleanupJobsTask.scala index 16baeb5f..3d2a84b0 100644 --- a/modules/joex/src/main/scala/docspell/joex/hk/CleanupJobsTask.scala +++ b/modules/joex/src/main/scala/docspell/joex/hk/CleanupJobsTask.scala @@ -1,7 +1,7 @@ package docspell.joex.hk -import cats.implicits._ import cats.effect._ +import cats.implicits._ import fs2.Stream import docspell.common._ diff --git a/modules/joex/src/main/scala/docspell/joex/hk/HouseKeepingConfig.scala b/modules/joex/src/main/scala/docspell/joex/hk/HouseKeepingConfig.scala index b7d7dcd3..be0f3f5e 100644 --- a/modules/joex/src/main/scala/docspell/joex/hk/HouseKeepingConfig.scala +++ b/modules/joex/src/main/scala/docspell/joex/hk/HouseKeepingConfig.scala @@ -1,9 +1,9 @@ package docspell.joex.hk -import com.github.eikek.calev.CalEvent import docspell.common._ +import docspell.joex.hk.HouseKeepingConfig._ -import HouseKeepingConfig._ +import com.github.eikek.calev.CalEvent case class HouseKeepingConfig( schedule: CalEvent, diff --git a/modules/joex/src/main/scala/docspell/joex/hk/HouseKeepingTask.scala b/modules/joex/src/main/scala/docspell/joex/hk/HouseKeepingTask.scala index 1ebcaa96..c124717f 100644 --- a/modules/joex/src/main/scala/docspell/joex/hk/HouseKeepingTask.scala +++ b/modules/joex/src/main/scala/docspell/joex/hk/HouseKeepingTask.scala @@ -1,14 +1,15 @@ package docspell.joex.hk -import cats.implicits._ import cats.effect._ -import com.github.eikek.calev._ +import cats.implicits._ import docspell.common._ import docspell.joex.Config import docspell.joex.scheduler.Task import docspell.store.records._ +import com.github.eikek.calev._ + object HouseKeepingTask { private val periodicId = Ident.unsafe("docspell-houskeeping") diff --git a/modules/joex/src/main/scala/docspell/joex/mail/ReadMail.scala b/modules/joex/src/main/scala/docspell/joex/mail/ReadMail.scala index 59b277e4..0f144ab7 100644 --- a/modules/joex/src/main/scala/docspell/joex/mail/ReadMail.scala +++ b/modules/joex/src/main/scala/docspell/joex/mail/ReadMail.scala @@ -3,15 +3,16 @@ package docspell.joex.mail import cats.effect._ import cats.implicits._ import fs2.{Pipe, Stream} -import emil.{MimeType => _, _} -import emil.javamail.syntax._ -import emil.tnef.TnefExtract -import emil.markdown._ -import emil.jsoup._ import docspell.common._ import docspell.store.syntax.MimeTypes._ +import emil.javamail.syntax._ +import emil.jsoup._ +import emil.markdown._ +import emil.tnef.TnefExtract +import emil.{MimeType => _, _} + object ReadMail { def readBytesP[F[_]: ConcurrentEffect: ContextShift]( diff --git a/modules/joex/src/main/scala/docspell/joex/notify/MailContext.scala b/modules/joex/src/main/scala/docspell/joex/notify/MailContext.scala index cb1f3ce3..1713b80b 100644 --- a/modules/joex/src/main/scala/docspell/joex/notify/MailContext.scala +++ b/modules/joex/src/main/scala/docspell/joex/notify/MailContext.scala @@ -1,12 +1,12 @@ package docspell.joex.notify +import docspell.common._ +import docspell.joex.notify.YamuscaConverter._ +import docspell.store.queries.QItem + import yamusca.implicits._ import yamusca.imports._ -import docspell.common._ -import docspell.store.queries.QItem -import docspell.joex.notify.YamuscaConverter._ - /** The context for rendering the e-mail template. */ case class MailContext( items: List[MailContext.ItemData], diff --git a/modules/joex/src/main/scala/docspell/joex/notify/NotifyDueItemsTask.scala b/modules/joex/src/main/scala/docspell/joex/notify/NotifyDueItemsTask.scala index d99e0ef2..218b4d0d 100644 --- a/modules/joex/src/main/scala/docspell/joex/notify/NotifyDueItemsTask.scala +++ b/modules/joex/src/main/scala/docspell/joex/notify/NotifyDueItemsTask.scala @@ -1,19 +1,20 @@ package docspell.joex.notify -import cats.implicits._ +import cats.data.OptionT import cats.effect._ +import cats.implicits._ + +import docspell.backend.ops.OItemSearch.Batch +import docspell.common._ +import docspell.joex.mail.EmilHeader +import docspell.joex.scheduler.{Context, Task} +import docspell.store.queries.QItem +import docspell.store.records._ + import emil._ import emil.builder._ -import emil.markdown._ import emil.javamail.syntax._ - -import docspell.common._ -import docspell.backend.ops.OItemSearch.Batch -import docspell.store.records._ -import docspell.store.queries.QItem -import docspell.joex.scheduler.{Context, Task} -import cats.data.OptionT -import docspell.joex.mail.EmilHeader +import emil.markdown._ object NotifyDueItemsTask { val maxItems: Int = 7 diff --git a/modules/joex/src/main/scala/docspell/joex/notify/YamuscaConverter.scala b/modules/joex/src/main/scala/docspell/joex/notify/YamuscaConverter.scala index 361a4cd7..0f09c862 100644 --- a/modules/joex/src/main/scala/docspell/joex/notify/YamuscaConverter.scala +++ b/modules/joex/src/main/scala/docspell/joex/notify/YamuscaConverter.scala @@ -1,9 +1,10 @@ package docspell.joex.notify -import yamusca.imports._ -import yamusca.implicits._ import docspell.common._ +import yamusca.implicits._ +import yamusca.imports._ + trait YamuscaConverter { implicit val uriConverter: ValueConverter[LenientUri] = diff --git a/modules/joex/src/main/scala/docspell/joex/process/ConvertPdf.scala b/modules/joex/src/main/scala/docspell/joex/process/ConvertPdf.scala index 790b758d..b571a306 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/ConvertPdf.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/ConvertPdf.scala @@ -1,19 +1,21 @@ package docspell.joex.process -import bitpeace.{Mimetype, MimetypeHint, RangeDef} import cats.Functor -import cats.implicits._ -import cats.effect._ import cats.data.{Kleisli, OptionT} +import cats.effect._ +import cats.implicits._ import fs2.Stream + import docspell.common._ +import docspell.convert.ConversionResult.Handler +import docspell.convert.SanitizeHtml import docspell.convert._ +import docspell.joex.extract.JsoupSanitizer import docspell.joex.scheduler._ import docspell.store.records._ import docspell.store.syntax.MimeTypes._ -import docspell.convert.ConversionResult.Handler -import docspell.convert.SanitizeHtml -import docspell.joex.extract.JsoupSanitizer + +import bitpeace.{Mimetype, MimetypeHint, RangeDef} /** Goes through all attachments and creates a PDF version of it where * supported. diff --git a/modules/joex/src/main/scala/docspell/joex/process/CreateItem.scala b/modules/joex/src/main/scala/docspell/joex/process/CreateItem.scala index 0a06b421..bf48f49e 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/CreateItem.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/CreateItem.scala @@ -1,15 +1,17 @@ package docspell.joex.process -import bitpeace.FileMeta -import cats.implicits._ -import cats.effect.Sync import cats.data.OptionT +import cats.effect.Sync +import cats.implicits._ import fs2.Stream + import docspell.common._ import docspell.joex.scheduler.{Context, Task} import docspell.store.queries.QItem import docspell.store.records.{RAttachment, RAttachmentSource, RItem} +import bitpeace.FileMeta + /** * Task that creates the item. */ diff --git a/modules/joex/src/main/scala/docspell/joex/process/EvalProposals.scala b/modules/joex/src/main/scala/docspell/joex/process/EvalProposals.scala index cf5ecb1c..170958c9 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/EvalProposals.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/EvalProposals.scala @@ -1,8 +1,10 @@ package docspell.joex.process import java.time.{LocalDate, Period} -import cats.implicits._ + import cats.effect.Sync +import cats.implicits._ + import docspell.common._ import docspell.joex.scheduler.Task import docspell.store.records.RAttachmentMeta diff --git a/modules/joex/src/main/scala/docspell/joex/process/ExtractArchive.scala b/modules/joex/src/main/scala/docspell/joex/process/ExtractArchive.scala index 5717ade2..92add9d6 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/ExtractArchive.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/ExtractArchive.scala @@ -1,21 +1,23 @@ package docspell.joex.process -import bitpeace.{Mimetype, MimetypeHint, RangeDef} import cats.Functor +import cats.data.NonEmptyList import cats.data.OptionT import cats.effect._ import cats.implicits._ +import cats.kernel.Monoid +import cats.kernel.Order import fs2.Stream + import docspell.common._ +import docspell.files.Zip import docspell.joex.mail._ import docspell.joex.scheduler._ import docspell.store.records._ import docspell.store.syntax.MimeTypes._ -import docspell.files.Zip -import cats.kernel.Monoid + +import bitpeace.{Mimetype, MimetypeHint, RangeDef} import emil.Mail -import cats.kernel.Order -import cats.data.NonEmptyList /** Goes through all attachments and extracts archive files, like zip * files. The process is recursive, until all archives have been diff --git a/modules/joex/src/main/scala/docspell/joex/process/FindProposal.scala b/modules/joex/src/main/scala/docspell/joex/process/FindProposal.scala index aa06ee39..45b6bd85 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/FindProposal.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/FindProposal.scala @@ -2,9 +2,10 @@ package docspell.joex.process import java.time.ZoneId -import cats.{Applicative, FlatMap} -import cats.implicits._ import cats.effect.Sync +import cats.implicits._ +import cats.{Applicative, FlatMap} + import docspell.analysis.contact._ import docspell.common.MetaProposal.Candidate import docspell.common._ diff --git a/modules/joex/src/main/scala/docspell/joex/process/ItemHandler.scala b/modules/joex/src/main/scala/docspell/joex/process/ItemHandler.scala index 2346d69c..f18f29e7 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/ItemHandler.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/ItemHandler.scala @@ -1,15 +1,16 @@ package docspell.joex.process -import cats.implicits._ -import cats.effect._ import cats.data.OptionT +import cats.effect._ +import cats.implicits._ import fs2.Stream + import docspell.common.{ItemState, ProcessItemArgs} +import docspell.ftsclient.FtsClient import docspell.joex.Config import docspell.joex.scheduler.Task import docspell.store.queries.QItem import docspell.store.records.RItem -import docspell.ftsclient.FtsClient object ItemHandler { type Args = ProcessItemArgs diff --git a/modules/joex/src/main/scala/docspell/joex/process/LinkProposal.scala b/modules/joex/src/main/scala/docspell/joex/process/LinkProposal.scala index a6d7bc16..fde5fcd3 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/LinkProposal.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/LinkProposal.scala @@ -1,7 +1,8 @@ package docspell.joex.process -import cats.implicits._ import cats.effect.Sync +import cats.implicits._ + import docspell.common._ import docspell.joex.scheduler.{Context, Task} import docspell.store.records.RItem diff --git a/modules/joex/src/main/scala/docspell/joex/process/ProcessItem.scala b/modules/joex/src/main/scala/docspell/joex/process/ProcessItem.scala index 48542638..c81230bf 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/ProcessItem.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/ProcessItem.scala @@ -1,10 +1,11 @@ package docspell.joex.process import cats.effect._ + import docspell.common.ProcessItemArgs -import docspell.joex.scheduler.Task -import docspell.joex.Config import docspell.ftsclient.FtsClient +import docspell.joex.Config +import docspell.joex.scheduler.Task object ProcessItem { diff --git a/modules/joex/src/main/scala/docspell/joex/process/SaveProposals.scala b/modules/joex/src/main/scala/docspell/joex/process/SaveProposals.scala index 47f7e2a7..ee4fd923 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/SaveProposals.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/SaveProposals.scala @@ -1,7 +1,8 @@ package docspell.joex.process -import cats.implicits._ import cats.effect.Sync +import cats.implicits._ + import docspell.common._ import docspell.joex.scheduler.Task import docspell.store.records._ diff --git a/modules/joex/src/main/scala/docspell/joex/process/TestTasks.scala b/modules/joex/src/main/scala/docspell/joex/process/TestTasks.scala index 0ec21d08..5fa6c69e 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/TestTasks.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/TestTasks.scala @@ -1,10 +1,12 @@ package docspell.joex.process -import cats.implicits._ import cats.effect.Sync +import cats.implicits._ + import docspell.common.ProcessItemArgs import docspell.common.syntax.all._ import docspell.joex.scheduler.Task + import org.log4s._ object TestTasks { diff --git a/modules/joex/src/main/scala/docspell/joex/process/TextAnalysis.scala b/modules/joex/src/main/scala/docspell/joex/process/TextAnalysis.scala index e369421b..5e31e2d9 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/TextAnalysis.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/TextAnalysis.scala @@ -1,7 +1,8 @@ package docspell.joex.process -import cats.implicits._ import cats.effect.Sync +import cats.implicits._ + import docspell.analysis.{TextAnalyser, TextAnalysisConfig} import docspell.common._ import docspell.joex.process.ItemData.AttachmentDates diff --git a/modules/joex/src/main/scala/docspell/joex/process/TextExtraction.scala b/modules/joex/src/main/scala/docspell/joex/process/TextExtraction.scala index 8bfa250b..23024d4e 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/TextExtraction.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/TextExtraction.scala @@ -1,15 +1,17 @@ package docspell.joex.process -import bitpeace.{Mimetype, RangeDef} import cats.data.OptionT -import cats.implicits._ import cats.effect._ +import cats.implicits._ + import docspell.common._ import docspell.extract.{ExtractConfig, ExtractResult, Extraction} +import docspell.ftsclient.{FtsClient, TextData} import docspell.joex.scheduler.{Context, Task} import docspell.store.records.{RAttachment, RAttachmentMeta, RFileMeta} import docspell.store.syntax.MimeTypes._ -import docspell.ftsclient.{FtsClient, TextData} + +import bitpeace.{Mimetype, RangeDef} object TextExtraction { diff --git a/modules/joex/src/main/scala/docspell/joex/routes/InfoRoutes.scala b/modules/joex/src/main/scala/docspell/joex/routes/InfoRoutes.scala index a27ea544..a6b7f4cb 100644 --- a/modules/joex/src/main/scala/docspell/joex/routes/InfoRoutes.scala +++ b/modules/joex/src/main/scala/docspell/joex/routes/InfoRoutes.scala @@ -1,8 +1,10 @@ package docspell.joex.routes import cats.effect.Sync + import docspell.joex.BuildInfo import docspell.joexapi.model.VersionInfo + import org.http4s.HttpRoutes import org.http4s.circe.CirceEntityEncoder._ import org.http4s.dsl.Http4sDsl diff --git a/modules/joex/src/main/scala/docspell/joex/routes/JoexRoutes.scala b/modules/joex/src/main/scala/docspell/joex/routes/JoexRoutes.scala index 84838be2..a5c5c04e 100644 --- a/modules/joex/src/main/scala/docspell/joex/routes/JoexRoutes.scala +++ b/modules/joex/src/main/scala/docspell/joex/routes/JoexRoutes.scala @@ -2,10 +2,12 @@ package docspell.joex.routes import cats.effect._ import cats.implicits._ + import docspell.common.{Duration, Ident, Timestamp} import docspell.joex.JoexApp import docspell.joexapi.model._ import docspell.store.records.{RJob, RJobLog} + import org.http4s.HttpRoutes import org.http4s.circe.CirceEntityEncoder._ import org.http4s.dsl.Http4sDsl diff --git a/modules/joex/src/main/scala/docspell/joex/scanmailbox/ScanMailboxTask.scala b/modules/joex/src/main/scala/docspell/joex/scanmailbox/ScanMailboxTask.scala index 96648995..7c0ef6bb 100644 --- a/modules/joex/src/main/scala/docspell/joex/scanmailbox/ScanMailboxTask.scala +++ b/modules/joex/src/main/scala/docspell/joex/scanmailbox/ScanMailboxTask.scala @@ -1,21 +1,22 @@ package docspell.joex.scanmailbox -import fs2._ -import cats.implicits._ -import cats.effect._ -import emil.{MimeType => _, _} -import emil.javamail.syntax._ -import emil.SearchQuery.{All, ReceivedDate} - -import docspell.common._ -import docspell.backend.ops.{OJoex, OUpload} -import docspell.store.records._ -import docspell.joex.Config -import docspell.joex.scheduler.{Context, Task} -import docspell.store.queries.QOrganization import cats.data.Kleisli import cats.data.NonEmptyList import cats.data.OptionT +import cats.effect._ +import cats.implicits._ +import fs2._ + +import docspell.backend.ops.{OJoex, OUpload} +import docspell.common._ +import docspell.joex.Config +import docspell.joex.scheduler.{Context, Task} +import docspell.store.queries.QOrganization +import docspell.store.records._ + +import emil.SearchQuery.{All, ReceivedDate} +import emil.javamail.syntax._ +import emil.{MimeType => _, _} object ScanMailboxTask { val maxItems: Long = 7 diff --git a/modules/joex/src/main/scala/docspell/joex/scheduler/Context.scala b/modules/joex/src/main/scala/docspell/joex/scheduler/Context.scala index d8a98906..fc51759a 100644 --- a/modules/joex/src/main/scala/docspell/joex/scheduler/Context.scala +++ b/modules/joex/src/main/scala/docspell/joex/scheduler/Context.scala @@ -1,12 +1,14 @@ package docspell.joex.scheduler -import cats.{Applicative, Functor} import cats.effect._ import cats.implicits._ +import cats.{Applicative, Functor} + import docspell.common._ +import docspell.common.syntax.all._ import docspell.store.Store import docspell.store.records.RJob -import docspell.common.syntax.all._ + import org.log4s.{Logger => _, _} trait Context[F[_], A] { self => diff --git a/modules/joex/src/main/scala/docspell/joex/scheduler/CountingScheme.scala b/modules/joex/src/main/scala/docspell/joex/scheduler/CountingScheme.scala index 034d4844..b8580e82 100644 --- a/modules/joex/src/main/scala/docspell/joex/scheduler/CountingScheme.scala +++ b/modules/joex/src/main/scala/docspell/joex/scheduler/CountingScheme.scala @@ -1,6 +1,7 @@ package docspell.joex.scheduler import cats.implicits._ + import docspell.common.Priority /** A counting scheme to indicate a ratio between scheduling high and diff --git a/modules/joex/src/main/scala/docspell/joex/scheduler/JobTask.scala b/modules/joex/src/main/scala/docspell/joex/scheduler/JobTask.scala index 891636c3..31e35150 100644 --- a/modules/joex/src/main/scala/docspell/joex/scheduler/JobTask.scala +++ b/modules/joex/src/main/scala/docspell/joex/scheduler/JobTask.scala @@ -1,9 +1,11 @@ package docspell.joex.scheduler -import cats.implicits._ import cats.effect.Sync +import cats.implicits._ + import docspell.common.Ident import docspell.common.syntax.all._ + import io.circe.Decoder /** diff --git a/modules/joex/src/main/scala/docspell/joex/scheduler/LogEvent.scala b/modules/joex/src/main/scala/docspell/joex/scheduler/LogEvent.scala index da9949cf..99e389e2 100644 --- a/modules/joex/src/main/scala/docspell/joex/scheduler/LogEvent.scala +++ b/modules/joex/src/main/scala/docspell/joex/scheduler/LogEvent.scala @@ -1,8 +1,9 @@ package docspell.joex.scheduler -import cats.implicits._ -import docspell.common._ import cats.effect.Sync +import cats.implicits._ + +import docspell.common._ case class LogEvent( jobId: Ident, diff --git a/modules/joex/src/main/scala/docspell/joex/scheduler/LogSink.scala b/modules/joex/src/main/scala/docspell/joex/scheduler/LogSink.scala index b26dd22b..ae5c7cdd 100644 --- a/modules/joex/src/main/scala/docspell/joex/scheduler/LogSink.scala +++ b/modules/joex/src/main/scala/docspell/joex/scheduler/LogSink.scala @@ -1,14 +1,16 @@ package docspell.joex.scheduler -import cats.implicits._ import cats.effect.{Concurrent, Sync} +import cats.implicits._ import fs2.{Pipe, Stream} -import org.log4s.{LogLevel => _, _} + import docspell.common._ import docspell.common.syntax.all._ import docspell.store.Store import docspell.store.records.RJobLog +import org.log4s.{LogLevel => _, _} + trait LogSink[F[_]] { def receive: Pipe[F, LogEvent, Unit] diff --git a/modules/joex/src/main/scala/docspell/joex/scheduler/PeriodicScheduler.scala b/modules/joex/src/main/scala/docspell/joex/scheduler/PeriodicScheduler.scala index 27517ad0..106adb77 100644 --- a/modules/joex/src/main/scala/docspell/joex/scheduler/PeriodicScheduler.scala +++ b/modules/joex/src/main/scala/docspell/joex/scheduler/PeriodicScheduler.scala @@ -1,8 +1,8 @@ package docspell.joex.scheduler +import cats.effect._ import fs2._ import fs2.concurrent.SignallingRef -import cats.effect._ import docspell.joexapi.client.JoexClient import docspell.store.queue._ diff --git a/modules/joex/src/main/scala/docspell/joex/scheduler/PeriodicSchedulerImpl.scala b/modules/joex/src/main/scala/docspell/joex/scheduler/PeriodicSchedulerImpl.scala index f8de3c8c..a757d387 100644 --- a/modules/joex/src/main/scala/docspell/joex/scheduler/PeriodicSchedulerImpl.scala +++ b/modules/joex/src/main/scala/docspell/joex/scheduler/PeriodicSchedulerImpl.scala @@ -1,19 +1,19 @@ package docspell.joex.scheduler -import fs2._ -import fs2.concurrent.SignallingRef import cats.effect._ import cats.implicits._ -import org.log4s.getLogger -import com.github.eikek.fs2calev._ +import fs2._ +import fs2.concurrent.SignallingRef import docspell.common._ import docspell.common.syntax.all._ +import docspell.joex.scheduler.PeriodicSchedulerImpl.State import docspell.joexapi.client.JoexClient import docspell.store.queue._ import docspell.store.records.RPeriodicTask -import PeriodicSchedulerImpl.State +import com.github.eikek.fs2calev._ +import org.log4s.getLogger final class PeriodicSchedulerImpl[F[_]: ConcurrentEffect: ContextShift]( val config: PeriodicSchedulerConfig, diff --git a/modules/joex/src/main/scala/docspell/joex/scheduler/QueueLogger.scala b/modules/joex/src/main/scala/docspell/joex/scheduler/QueueLogger.scala index b9b9cd56..f9e45264 100644 --- a/modules/joex/src/main/scala/docspell/joex/scheduler/QueueLogger.scala +++ b/modules/joex/src/main/scala/docspell/joex/scheduler/QueueLogger.scala @@ -1,10 +1,11 @@ package docspell.joex.scheduler -import cats.implicits._ import cats.effect.{Concurrent, Sync} -import docspell.common._ +import cats.implicits._ import fs2.concurrent.Queue +import docspell.common._ + object QueueLogger { def create[F[_]: Sync]( diff --git a/modules/joex/src/main/scala/docspell/joex/scheduler/Scheduler.scala b/modules/joex/src/main/scala/docspell/joex/scheduler/Scheduler.scala index 32341cfd..7558425c 100644 --- a/modules/joex/src/main/scala/docspell/joex/scheduler/Scheduler.scala +++ b/modules/joex/src/main/scala/docspell/joex/scheduler/Scheduler.scala @@ -2,6 +2,7 @@ package docspell.joex.scheduler import cats.effect.{Fiber, Timer} import fs2.Stream + import docspell.common.Ident import docspell.store.records.RJob diff --git a/modules/joex/src/main/scala/docspell/joex/scheduler/SchedulerBuilder.scala b/modules/joex/src/main/scala/docspell/joex/scheduler/SchedulerBuilder.scala index d69558cf..50ed7a17 100644 --- a/modules/joex/src/main/scala/docspell/joex/scheduler/SchedulerBuilder.scala +++ b/modules/joex/src/main/scala/docspell/joex/scheduler/SchedulerBuilder.scala @@ -1,11 +1,12 @@ package docspell.joex.scheduler -import cats.implicits._ +import cats.effect._ import cats.effect.concurrent.Semaphore -import cats.effect.{Blocker, ConcurrentEffect, ContextShift, Resource} +import cats.implicits._ +import fs2.concurrent.SignallingRef + import docspell.store.Store import docspell.store.queue.JobQueue -import fs2.concurrent.SignallingRef case class SchedulerBuilder[F[_]: ConcurrentEffect: ContextShift]( config: SchedulerConfig, diff --git a/modules/joex/src/main/scala/docspell/joex/scheduler/SchedulerImpl.scala b/modules/joex/src/main/scala/docspell/joex/scheduler/SchedulerImpl.scala index ab2e7cc1..d3093529 100644 --- a/modules/joex/src/main/scala/docspell/joex/scheduler/SchedulerImpl.scala +++ b/modules/joex/src/main/scala/docspell/joex/scheduler/SchedulerImpl.scala @@ -1,19 +1,21 @@ package docspell.joex.scheduler -import fs2.Stream -import cats.implicits._ -import cats.effect.concurrent.Semaphore import cats.data.OptionT +import cats.effect._ +import cats.effect.concurrent.Semaphore +import cats.implicits._ +import fs2.Stream +import fs2.concurrent.SignallingRef + import docspell.common._ import docspell.common.syntax.all._ -import docspell.store.queue.JobQueue -import docspell.store.records.RJob -import fs2.concurrent.SignallingRef -import cats.effect._ -import org.log4s._ -import SchedulerImpl._ +import docspell.joex.scheduler.SchedulerImpl._ import docspell.store.Store import docspell.store.queries.QJob +import docspell.store.queue.JobQueue +import docspell.store.records.RJob + +import org.log4s._ final class SchedulerImpl[F[_]: ConcurrentEffect: ContextShift]( val config: SchedulerConfig, diff --git a/modules/joex/src/main/scala/docspell/joex/scheduler/Task.scala b/modules/joex/src/main/scala/docspell/joex/scheduler/Task.scala index 7c5f7616..445168b1 100644 --- a/modules/joex/src/main/scala/docspell/joex/scheduler/Task.scala +++ b/modules/joex/src/main/scala/docspell/joex/scheduler/Task.scala @@ -1,9 +1,10 @@ package docspell.joex.scheduler -import cats.implicits._ -import cats.{Applicative, ApplicativeError, FlatMap, Functor} +import cats._ import cats.data.Kleisli import cats.effect.Sync +import cats.implicits._ + import docspell.common.Logger /** diff --git a/modules/joexapi/src/main/scala/docspell/joexapi/client/JoexClient.scala b/modules/joexapi/src/main/scala/docspell/joexapi/client/JoexClient.scala index 509d9689..6cf72b74 100644 --- a/modules/joexapi/src/main/scala/docspell/joexapi/client/JoexClient.scala +++ b/modules/joexapi/src/main/scala/docspell/joexapi/client/JoexClient.scala @@ -1,16 +1,18 @@ package docspell.joexapi.client -import cats.implicits._ -import cats.effect._ -import docspell.common.{Ident, LenientUri} -import docspell.common.syntax.all._ -import docspell.joexapi.model.BasicResult -import org.http4s.{Method, Request, Uri} -import org.http4s.client.Client -import org.http4s.client.blaze.BlazeClientBuilder -import org.http4s.circe.CirceEntityDecoder._ import scala.concurrent.ExecutionContext +import cats.effect._ +import cats.implicits._ + +import docspell.common.syntax.all._ +import docspell.common.{Ident, LenientUri} +import docspell.joexapi.model.BasicResult + +import org.http4s.circe.CirceEntityDecoder._ +import org.http4s.client.Client +import org.http4s.client.blaze.BlazeClientBuilder +import org.http4s.{Method, Request, Uri} import org.log4s.getLogger trait JoexClient[F[_]] { diff --git a/modules/restserver/src/main/scala/docspell/restserver/Config.scala b/modules/restserver/src/main/scala/docspell/restserver/Config.scala index 165f6822..b83ee33f 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/Config.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/Config.scala @@ -1,9 +1,10 @@ package docspell.restserver import java.net.InetAddress -import docspell.common._ + import docspell.backend.auth.Login import docspell.backend.{Config => BackendConfig} +import docspell.common._ import docspell.ftssolr.SolrConfig case class Config( diff --git a/modules/restserver/src/main/scala/docspell/restserver/ConfigFile.scala b/modules/restserver/src/main/scala/docspell/restserver/ConfigFile.scala index df1584e1..c1c1dc1f 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/ConfigFile.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/ConfigFile.scala @@ -1,7 +1,8 @@ package docspell.restserver -import docspell.common.config.Implicits._ import docspell.backend.signup.{Config => SignupConfig} +import docspell.common.config.Implicits._ + import pureconfig._ import pureconfig.generic.auto._ diff --git a/modules/restserver/src/main/scala/docspell/restserver/Main.scala b/modules/restserver/src/main/scala/docspell/restserver/Main.scala index 47fadcfa..93e8b93d 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/Main.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/Main.scala @@ -1,11 +1,12 @@ package docspell.restserver +import java.nio.file.{Files, Paths} + import cats.effect._ import cats.implicits._ -import java.nio.file.{Files, Paths} - import docspell.common.{Banner, Pools, ThreadFactories} + import org.log4s._ object Main extends IOApp { diff --git a/modules/restserver/src/main/scala/docspell/restserver/RestAppImpl.scala b/modules/restserver/src/main/scala/docspell/restserver/RestAppImpl.scala index 220bf066..5ed4df61 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/RestAppImpl.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/RestAppImpl.scala @@ -1,14 +1,16 @@ package docspell.restserver -import cats.implicits._ +import scala.concurrent.ExecutionContext + import cats.effect._ -import org.http4s.client.Client +import cats.implicits._ + import docspell.backend.BackendApp import docspell.common.NodeType import docspell.ftsclient.FtsClient import docspell.ftssolr.SolrFtsClient -import scala.concurrent.ExecutionContext +import org.http4s.client.Client final class RestAppImpl[F[_]: Sync](val config: Config, val backend: BackendApp[F]) extends RestApp[F] { diff --git a/modules/restserver/src/main/scala/docspell/restserver/RestServer.scala b/modules/restserver/src/main/scala/docspell/restserver/RestServer.scala index b8f0a700..71934336 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/RestServer.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/RestServer.scala @@ -2,18 +2,20 @@ package docspell.restserver import cats.effect._ import cats.implicits._ -import docspell.common.Pools +import fs2.Stream + import docspell.backend.auth.AuthToken +import docspell.common.Pools import docspell.restserver.routes._ import docspell.restserver.webapp._ -import fs2.Stream + import org.http4s._ +import org.http4s.dsl.Http4sDsl import org.http4s.headers.Location import org.http4s.implicits._ import org.http4s.server.Router import org.http4s.server.blaze.BlazeServerBuilder import org.http4s.server.middleware.Logger -import org.http4s.dsl.Http4sDsl object RestServer { diff --git a/modules/restserver/src/main/scala/docspell/restserver/auth/CookieData.scala b/modules/restserver/src/main/scala/docspell/restserver/auth/CookieData.scala index ae15d434..91bf0938 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/auth/CookieData.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/auth/CookieData.scala @@ -1,11 +1,12 @@ package docspell.restserver.auth -import org.http4s._ -import org.http4s.util._ import docspell.backend.auth._ import docspell.common.AccountId import docspell.restserver.Config +import org.http4s._ +import org.http4s.util._ + case class CookieData(auth: AuthToken) { def accountId: AccountId = auth.account def asString: String = auth.asString diff --git a/modules/restserver/src/main/scala/docspell/restserver/conv/Conversions.scala b/modules/restserver/src/main/scala/docspell/restserver/conv/Conversions.scala index 86296a15..caf92d9d 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/conv/Conversions.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/conv/Conversions.scala @@ -2,23 +2,25 @@ package docspell.restserver.conv import java.time.{LocalDate, ZoneId} -import fs2.Stream -import cats.implicits._ import cats.effect.{Effect, Sync} -import docspell.common._ -import docspell.common.syntax.all._ -import docspell.restapi.model._ -import docspell.store.records._ -import Conversions._ -import bitpeace.FileMeta +import cats.implicits._ +import fs2.Stream + import docspell.backend.ops.OCollective.{InsightData, PassChangeResult} import docspell.backend.ops.OJob.JobCancelResult import docspell.backend.ops.OUpload.{UploadData, UploadMeta, UploadResult} -import docspell.backend.ops.{OFulltext, OItemSearch, OJob, OOrganization, OUpload} -import docspell.store.AddResult +import docspell.backend.ops._ +import docspell.common._ +import docspell.common.syntax.all._ import docspell.ftsclient.FtsResult -import org.http4s.multipart.Multipart +import docspell.restapi.model._ +import docspell.restserver.conv.Conversions._ +import docspell.store.AddResult +import docspell.store.records._ + +import bitpeace.FileMeta import org.http4s.headers.`Content-Type` +import org.http4s.multipart.Multipart import org.log4s.Logger trait Conversions { diff --git a/modules/restserver/src/main/scala/docspell/restserver/http4s/QueryParam.scala b/modules/restserver/src/main/scala/docspell/restserver/http4s/QueryParam.scala index 33d506bf..1c8ff477 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/http4s/QueryParam.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/http4s/QueryParam.scala @@ -1,8 +1,9 @@ package docspell.restserver.http4s -import org.http4s.QueryParamDecoder -import org.http4s.ParseFailure import docspell.common.ContactKind + +import org.http4s.ParseFailure +import org.http4s.QueryParamDecoder import org.http4s.dsl.impl.OptionalQueryParamDecoderMatcher object QueryParam { diff --git a/modules/restserver/src/main/scala/docspell/restserver/http4s/ResponseGenerator.scala b/modules/restserver/src/main/scala/docspell/restserver/http4s/ResponseGenerator.scala index 06927d2b..70fad0b6 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/http4s/ResponseGenerator.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/http4s/ResponseGenerator.scala @@ -1,9 +1,10 @@ package docspell.restserver.http4s -import cats.implicits._ import cats.Applicative -import org.http4s.{EntityEncoder, Header, Response} +import cats.implicits._ + import org.http4s.dsl.Http4sDsl +import org.http4s.{EntityEncoder, Header, Response} trait ResponseGenerator[F[_]] { self: Http4sDsl[F] => diff --git a/modules/restserver/src/main/scala/docspell/restserver/http4s/Responses.scala b/modules/restserver/src/main/scala/docspell/restserver/http4s/Responses.scala index ce31bb03..01bf9774 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/http4s/Responses.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/http4s/Responses.scala @@ -1,7 +1,8 @@ package docspell.restserver.http4s -import fs2.{Pure, Stream} import fs2.text.utf8Encode +import fs2.{Pure, Stream} + import org.http4s._ import org.http4s.headers._ diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/AttachmentRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/AttachmentRoutes.scala index 41503ffa..91c574e7 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/AttachmentRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/AttachmentRoutes.scala @@ -1,15 +1,9 @@ package docspell.restserver.routes -import bitpeace.FileMeta import cats.data.NonEmptyList import cats.effect._ import cats.implicits._ -import org.http4s._ -import org.http4s.dsl.Http4sDsl -import org.http4s.headers._ -import org.http4s.headers.ETag.EntityTag -import org.http4s.circe.CirceEntityEncoder._ -import org.http4s.circe.CirceEntityDecoder._ + import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.backend.ops._ @@ -18,6 +12,14 @@ import docspell.restapi.model._ import docspell.restserver.conv.Conversions import docspell.restserver.webapp.Webjars +import bitpeace.FileMeta +import org.http4s._ +import org.http4s.circe.CirceEntityDecoder._ +import org.http4s.circe.CirceEntityEncoder._ +import org.http4s.dsl.Http4sDsl +import org.http4s.headers.ETag.EntityTag +import org.http4s.headers._ + object AttachmentRoutes { def apply[F[_]: Effect](backend: BackendApp[F], user: AuthToken): HttpRoutes[F] = { diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/Authenticate.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/Authenticate.scala index 1218cbe1..d29d9ecc 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/Authenticate.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/Authenticate.scala @@ -3,8 +3,10 @@ package docspell.restserver.routes import cats.data._ import cats.effect._ import cats.implicits._ + import docspell.backend.auth._ import docspell.restserver.auth._ + import org.http4s._ import org.http4s.circe.CirceEntityEncoder._ import org.http4s.dsl.Http4sDsl diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/CalEventCheckRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/CalEventCheckRoutes.scala index cd46d844..cb97440e 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/CalEventCheckRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/CalEventCheckRoutes.scala @@ -2,15 +2,16 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ -import org.http4s._ -import org.http4s.dsl.Http4sDsl -import org.http4s.circe.CirceEntityEncoder._ -import org.http4s.circe.CirceEntityDecoder._ -import com.github.eikek.calev.CalEvent import docspell.common._ import docspell.restapi.model._ +import com.github.eikek.calev.CalEvent +import org.http4s._ +import org.http4s.circe.CirceEntityDecoder._ +import org.http4s.circe.CirceEntityEncoder._ +import org.http4s.dsl.Http4sDsl + object CalEventCheckRoutes { def apply[F[_]: Effect](): HttpRoutes[F] = { diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/CheckFileRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/CheckFileRoutes.scala index 73defa96..6534ed96 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/CheckFileRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/CheckFileRoutes.scala @@ -2,15 +2,17 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ + import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.common.Ident import docspell.restapi.model.{BasicItem, CheckFileResult} import docspell.restserver.http4s.ResponseGenerator +import docspell.store.records.RItem + import org.http4s.HttpRoutes import org.http4s.circe.CirceEntityEncoder._ import org.http4s.dsl.Http4sDsl -import docspell.store.records.RItem object CheckFileRoutes { diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/CollectiveRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/CollectiveRoutes.scala index 8e3300c4..5294e8a6 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/CollectiveRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/CollectiveRoutes.scala @@ -2,12 +2,14 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ + import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.backend.ops.OCollective import docspell.restapi.model._ import docspell.restserver.conv.Conversions import docspell.restserver.http4s._ + import org.http4s.HttpRoutes import org.http4s.circe.CirceEntityDecoder._ import org.http4s.circe.CirceEntityEncoder._ diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/EquipmentRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/EquipmentRoutes.scala index e04c49f5..a7699115 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/EquipmentRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/EquipmentRoutes.scala @@ -2,10 +2,6 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ -import org.http4s.HttpRoutes -import org.http4s.circe.CirceEntityDecoder._ -import org.http4s.circe.CirceEntityEncoder._ -import org.http4s.dsl.Http4sDsl import docspell.backend.BackendApp import docspell.backend.auth.AuthToken @@ -14,6 +10,11 @@ import docspell.restapi.model._ import docspell.restserver.conv.Conversions._ import docspell.restserver.http4s.QueryParam +import org.http4s.HttpRoutes +import org.http4s.circe.CirceEntityDecoder._ +import org.http4s.circe.CirceEntityEncoder._ +import org.http4s.dsl.Http4sDsl + object EquipmentRoutes { def apply[F[_]: Effect](backend: BackendApp[F], user: AuthToken): HttpRoutes[F] = { diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/FullTextIndexRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/FullTextIndexRoutes.scala index 9a8d2c7a..6ee6b08b 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/FullTextIndexRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/FullTextIndexRoutes.scala @@ -1,19 +1,19 @@ package docspell.restserver.routes +import cats.data.OptionT import cats.effect._ import cats.implicits._ -import cats.data.OptionT -import org.http4s._ -//import org.http4s.circe.CirceEntityDecoder._ -import org.http4s.circe.CirceEntityEncoder._ -import org.http4s.dsl.Http4sDsl -import docspell.common._ import docspell.backend.BackendApp import docspell.backend.auth.AuthToken +import docspell.common._ import docspell.restserver.Config import docspell.restserver.conv.Conversions +import org.http4s._ +import org.http4s.circe.CirceEntityEncoder._ +import org.http4s.dsl.Http4sDsl + object FullTextIndexRoutes { def secured[F[_]: Effect]( diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/InfoRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/InfoRoutes.scala index 0ab1de86..6efb0462 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/InfoRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/InfoRoutes.scala @@ -1,8 +1,10 @@ package docspell.restserver.routes import cats.effect.Sync + import docspell.restapi.model.VersionInfo import docspell.restserver.BuildInfo + import org.http4s.HttpRoutes import org.http4s.circe.CirceEntityEncoder._ import org.http4s.dsl.Http4sDsl diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/IntegrationEndpointRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/IntegrationEndpointRoutes.scala index c6a6f67e..6ff78e13 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/IntegrationEndpointRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/IntegrationEndpointRoutes.scala @@ -3,16 +3,17 @@ package docspell.restserver.routes import cats.data.{EitherT, OptionT} import cats.effect._ import cats.implicits._ + import docspell.backend.BackendApp import docspell.common._ import docspell.restserver.Config import docspell.restserver.conv.Conversions._ import docspell.restserver.http4s.Responses import docspell.store.records.RItem + import org.http4s._ import org.http4s.circe.CirceEntityEncoder._ import org.http4s.dsl.Http4sDsl -import org.http4s.EntityDecoder._ import org.http4s.headers.{Authorization, `WWW-Authenticate`} import org.http4s.multipart.Multipart import org.http4s.util.CaseInsensitiveString diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/ItemRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/ItemRoutes.scala index 03e8d7ae..ba1003d5 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/ItemRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/ItemRoutes.scala @@ -2,19 +2,21 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ + import docspell.backend.BackendApp import docspell.backend.auth.AuthToken -import docspell.backend.ops.OItemSearch.Batch import docspell.backend.ops.OFulltext -import docspell.common.{Ident, ItemState} -import org.http4s.HttpRoutes -import org.http4s.dsl.Http4sDsl -import org.http4s.circe.CirceEntityEncoder._ -import org.http4s.circe.CirceEntityDecoder._ -import docspell.restapi.model._ +import docspell.backend.ops.OItemSearch.Batch import docspell.common.syntax.all._ -import docspell.restserver.conv.Conversions +import docspell.common.{Ident, ItemState} +import docspell.restapi.model._ import docspell.restserver.Config +import docspell.restserver.conv.Conversions + +import org.http4s.HttpRoutes +import org.http4s.circe.CirceEntityDecoder._ +import org.http4s.circe.CirceEntityEncoder._ +import org.http4s.dsl.Http4sDsl import org.log4s._ object ItemRoutes { diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/JobQueueRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/JobQueueRoutes.scala index a2f343b8..fc605f74 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/JobQueueRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/JobQueueRoutes.scala @@ -2,10 +2,12 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ + import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.common.Ident import docspell.restserver.conv.Conversions + import org.http4s.HttpRoutes import org.http4s.circe.CirceEntityEncoder._ import org.http4s.dsl.Http4sDsl diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/LoginRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/LoginRoutes.scala index 00f6f8dc..26d9e6eb 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/LoginRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/LoginRoutes.scala @@ -2,13 +2,15 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ + import docspell.backend.auth._ import docspell.restapi.model._ import docspell.restserver._ import docspell.restserver.auth._ + import org.http4s._ -import org.http4s.circe.CirceEntityEncoder._ import org.http4s.circe.CirceEntityDecoder._ +import org.http4s.circe.CirceEntityEncoder._ import org.http4s.dsl.Http4sDsl object LoginRoutes { diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/MailSendRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/MailSendRoutes.scala index 58dd98b8..c9c1a0ef 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/MailSendRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/MailSendRoutes.scala @@ -2,12 +2,6 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ -import org.http4s._ -import org.http4s.dsl.Http4sDsl -import org.http4s.circe.CirceEntityEncoder._ -import org.http4s.circe.CirceEntityDecoder._ -import emil.MailAddress -import emil.javamail.syntax._ import docspell.backend.BackendApp import docspell.backend.auth.AuthToken @@ -16,6 +10,13 @@ import docspell.backend.ops.SendResult import docspell.common._ import docspell.restapi.model._ +import emil.MailAddress +import emil.javamail.syntax._ +import org.http4s._ +import org.http4s.circe.CirceEntityDecoder._ +import org.http4s.circe.CirceEntityEncoder._ +import org.http4s.dsl.Http4sDsl + object MailSendRoutes { def apply[F[_]: Effect](backend: BackendApp[F], user: AuthToken): HttpRoutes[F] = { diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/MailSettingsRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/MailSettingsRoutes.scala index a3bf338f..d9fc09dc 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/MailSettingsRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/MailSettingsRoutes.scala @@ -1,23 +1,24 @@ package docspell.restserver.routes +import cats.data.OptionT import cats.effect._ import cats.implicits._ -import cats.data.OptionT -import org.http4s._ -import org.http4s.dsl.Http4sDsl -import org.http4s.circe.CirceEntityEncoder._ -import org.http4s.circe.CirceEntityDecoder._ -import emil.{MailAddress, SSLType} -import emil.javamail.syntax._ import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.backend.ops.OMail import docspell.common._ import docspell.restapi.model._ -import docspell.store.records.{RUserEmail, RUserImap} import docspell.restserver.conv.Conversions import docspell.restserver.http4s.QueryParam +import docspell.store.records.{RUserEmail, RUserImap} + +import emil.javamail.syntax._ +import emil.{MailAddress, SSLType} +import org.http4s._ +import org.http4s.circe.CirceEntityDecoder._ +import org.http4s.circe.CirceEntityEncoder._ +import org.http4s.dsl.Http4sDsl object MailSettingsRoutes { diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/NotifyDueItemsRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/NotifyDueItemsRoutes.scala index 6e9b9cde..7b38e4f1 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/NotifyDueItemsRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/NotifyDueItemsRoutes.scala @@ -1,20 +1,21 @@ package docspell.restserver.routes +import cats.data.OptionT import cats.effect._ import cats.implicits._ -import cats.data.OptionT -import org.http4s._ -import org.http4s.dsl.Http4sDsl -import org.http4s.circe.CirceEntityEncoder._ -import org.http4s.circe.CirceEntityDecoder._ import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.common._ import docspell.restapi.model._ -import docspell.store.usertask._ -import docspell.restserver.conv.Conversions import docspell.restserver.Config +import docspell.restserver.conv.Conversions +import docspell.store.usertask._ + +import org.http4s._ +import org.http4s.circe.CirceEntityDecoder._ +import org.http4s.circe.CirceEntityEncoder._ +import org.http4s.dsl.Http4sDsl object NotifyDueItemsRoutes { diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/OrganizationRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/OrganizationRoutes.scala index 00f54fca..59d17017 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/OrganizationRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/OrganizationRoutes.scala @@ -2,12 +2,14 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ + import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.common.Ident import docspell.restapi.model._ import docspell.restserver.conv.Conversions._ import docspell.restserver.http4s.QueryParam + import org.http4s.HttpRoutes import org.http4s.circe.CirceEntityDecoder._ import org.http4s.circe.CirceEntityEncoder._ diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/PersonRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/PersonRoutes.scala index e2d97696..2e90a9b4 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/PersonRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/PersonRoutes.scala @@ -2,6 +2,7 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ + import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.common.Ident @@ -9,6 +10,7 @@ import docspell.common.syntax.all._ import docspell.restapi.model._ import docspell.restserver.conv.Conversions._ import docspell.restserver.http4s.QueryParam + import org.http4s.HttpRoutes import org.http4s.circe.CirceEntityDecoder._ import org.http4s.circe.CirceEntityEncoder._ diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/RegisterRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/RegisterRoutes.scala index 15b57319..1a548cd3 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/RegisterRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/RegisterRoutes.scala @@ -2,15 +2,17 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ + import docspell.backend.BackendApp import docspell.backend.ops.OCollective.RegisterData import docspell.backend.signup.{NewInviteResult, SignupResult} import docspell.restapi.model._ import docspell.restserver.Config import docspell.restserver.http4s.ResponseGenerator + import org.http4s.HttpRoutes -import org.http4s.circe.CirceEntityEncoder._ import org.http4s.circe.CirceEntityDecoder._ +import org.http4s.circe.CirceEntityEncoder._ import org.http4s.dsl.Http4sDsl import org.log4s._ diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/ScanMailboxRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/ScanMailboxRoutes.scala index f5ab3479..7e3ab8cc 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/ScanMailboxRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/ScanMailboxRoutes.scala @@ -1,19 +1,20 @@ package docspell.restserver.routes +import cats.data.OptionT import cats.effect._ import cats.implicits._ -import cats.data.OptionT -import org.http4s._ -import org.http4s.dsl.Http4sDsl -import org.http4s.circe.CirceEntityEncoder._ -import org.http4s.circe.CirceEntityDecoder._ import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.common._ import docspell.restapi.model._ -import docspell.store.usertask._ import docspell.restserver.conv.Conversions +import docspell.store.usertask._ + +import org.http4s._ +import org.http4s.circe.CirceEntityDecoder._ +import org.http4s.circe.CirceEntityEncoder._ +import org.http4s.dsl.Http4sDsl object ScanMailboxRoutes { diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/SentMailRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/SentMailRoutes.scala index d996f374..49884d12 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/SentMailRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/SentMailRoutes.scala @@ -1,12 +1,8 @@ package docspell.restserver.routes +import cats.data.OptionT import cats.effect._ import cats.implicits._ -import cats.data.OptionT -import org.http4s._ -import org.http4s.dsl.Http4sDsl -import org.http4s.circe.CirceEntityEncoder._ -import emil.javamail.syntax._ import docspell.backend.BackendApp import docspell.backend.auth.AuthToken @@ -14,6 +10,11 @@ import docspell.backend.ops.OMail.Sent import docspell.common._ import docspell.restapi.model._ +import emil.javamail.syntax._ +import org.http4s._ +import org.http4s.circe.CirceEntityEncoder._ +import org.http4s.dsl.Http4sDsl + object SentMailRoutes { def apply[F[_]: Effect](backend: BackendApp[F], user: AuthToken): HttpRoutes[F] = { diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/SourceRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/SourceRoutes.scala index 2f4bf80d..aa9034e9 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/SourceRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/SourceRoutes.scala @@ -2,12 +2,14 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ + import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.common.Ident import docspell.restapi.model._ import docspell.restserver.conv.Conversions._ import docspell.restserver.http4s.ResponseGenerator + import org.http4s.HttpRoutes import org.http4s.circe.CirceEntityDecoder._ import org.http4s.circe.CirceEntityEncoder._ diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/TagRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/TagRoutes.scala index b341931e..461389d6 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/TagRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/TagRoutes.scala @@ -2,12 +2,14 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ + import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.common.Ident import docspell.restapi.model._ import docspell.restserver.conv.Conversions._ import docspell.restserver.http4s._ + import org.http4s.HttpRoutes import org.http4s.circe.CirceEntityDecoder._ import org.http4s.circe.CirceEntityEncoder._ diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/UploadRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/UploadRoutes.scala index db62a32c..b14e4aac 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/UploadRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/UploadRoutes.scala @@ -2,15 +2,16 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ -import docspell.common._ + import docspell.backend.BackendApp import docspell.backend.auth.AuthToken +import docspell.common._ import docspell.restserver.Config import docspell.restserver.conv.Conversions._ import docspell.restserver.http4s.ResponseGenerator + import org.http4s._ import org.http4s.circe.CirceEntityEncoder._ -import org.http4s.EntityDecoder._ import org.http4s.dsl.Http4sDsl import org.http4s.multipart.Multipart import org.log4s._ diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/UserRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/UserRoutes.scala index 7667a3f4..dbe9008d 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/UserRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/UserRoutes.scala @@ -2,12 +2,14 @@ package docspell.restserver.routes import cats.effect._ import cats.implicits._ + import docspell.backend.BackendApp import docspell.backend.auth.AuthToken import docspell.common.Ident import docspell.restapi.model._ import docspell.restserver.conv.Conversions._ import docspell.restserver.http4s.ResponseGenerator + import org.http4s.HttpRoutes import org.http4s.circe.CirceEntityDecoder._ import org.http4s.circe.CirceEntityEncoder._ diff --git a/modules/restserver/src/main/scala/docspell/restserver/webapp/Flags.scala b/modules/restserver/src/main/scala/docspell/restserver/webapp/Flags.scala index 0ceb466c..ebea34ee 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/webapp/Flags.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/webapp/Flags.scala @@ -1,12 +1,13 @@ package docspell.restserver.webapp +import docspell.backend.signup.{Config => SignupConfig} +import docspell.common.LenientUri +import docspell.restserver.{BuildInfo, Config} + import io.circe._ import io.circe.generic.semiauto._ -import docspell.common.LenientUri -import docspell.restserver.{BuildInfo, Config} -import docspell.backend.signup.{Config => SignupConfig} -import yamusca.imports._ import yamusca.implicits._ +import yamusca.imports._ case class Flags( appName: String, diff --git a/modules/restserver/src/main/scala/docspell/restserver/webapp/TemplateRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/webapp/TemplateRoutes.scala index 6686ce7f..ba46c2e5 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/webapp/TemplateRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/webapp/TemplateRoutes.scala @@ -1,21 +1,23 @@ package docspell.restserver.webapp -import fs2.{Stream, text} -import cats.effect._ -import cats.implicits._ -import org.http4s._ -import org.http4s.headers._ -import org.http4s.HttpRoutes -import org.http4s.dsl.Http4sDsl -import org.log4s._ -import io.circe.syntax._ -import yamusca.imports._ -import yamusca.implicits._ import java.net.URL import java.util.concurrent.atomic.AtomicReference +import cats.effect._ +import cats.implicits._ +import fs2.{Stream, text} + import docspell.restserver.{BuildInfo, Config} +import io.circe.syntax._ +import org.http4s.HttpRoutes +import org.http4s._ +import org.http4s.dsl.Http4sDsl +import org.http4s.headers._ +import org.log4s._ +import yamusca.implicits._ +import yamusca.imports._ + object TemplateRoutes { private[this] val logger = getLogger diff --git a/modules/restserver/src/main/scala/docspell/restserver/webapp/WebjarRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/webapp/WebjarRoutes.scala index efb25289..48f03102 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/webapp/WebjarRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/webapp/WebjarRoutes.scala @@ -1,10 +1,11 @@ package docspell.restserver.webapp import cats.effect._ + import org.http4s.HttpRoutes -import org.http4s.server.staticcontent.webjarService import org.http4s.server.staticcontent.NoopCacheStrategy -import org.http4s.server.staticcontent.WebjarService.{WebjarAsset, Config => WebjarConfig} +import org.http4s.server.staticcontent.WebjarService.{Config => WebjarConfig, WebjarAsset} +import org.http4s.server.staticcontent.webjarService object WebjarRoutes { diff --git a/modules/store/src/main/scala/docspell/store/AddResult.scala b/modules/store/src/main/scala/docspell/store/AddResult.scala index 0810f413..fd6baf33 100644 --- a/modules/store/src/main/scala/docspell/store/AddResult.scala +++ b/modules/store/src/main/scala/docspell/store/AddResult.scala @@ -1,6 +1,6 @@ package docspell.store -import AddResult._ +import docspell.store.AddResult._ sealed trait AddResult { def toEither: Either[Throwable, Unit] diff --git a/modules/store/src/main/scala/docspell/store/Store.scala b/modules/store/src/main/scala/docspell/store/Store.scala index 766e088b..49a25c91 100644 --- a/modules/store/src/main/scala/docspell/store/Store.scala +++ b/modules/store/src/main/scala/docspell/store/Store.scala @@ -1,14 +1,16 @@ package docspell.store -import bitpeace.Bitpeace +import scala.concurrent.ExecutionContext + +import cats.effect._ import fs2._ -import cats.effect.{Blocker, ContextShift, Effect, Resource} + import docspell.store.impl.StoreImpl + +import bitpeace.Bitpeace import doobie._ import doobie.hikari.HikariTransactor -import scala.concurrent.ExecutionContext - trait Store[F[_]] { def transact[A](prg: ConnectionIO[A]): F[A] diff --git a/modules/store/src/main/scala/docspell/store/impl/Column.scala b/modules/store/src/main/scala/docspell/store/impl/Column.scala index 72a69e08..67c1097e 100644 --- a/modules/store/src/main/scala/docspell/store/impl/Column.scala +++ b/modules/store/src/main/scala/docspell/store/impl/Column.scala @@ -1,9 +1,12 @@ package docspell.store.impl -import doobie._, doobie.implicits._ -import docspell.store.impl.DoobieSyntax._ import cats.data.NonEmptyList +import docspell.store.impl.DoobieSyntax._ + +import doobie._ +import doobie.implicits._ + case class Column(name: String, ns: String = "", alias: String = "") { val f = { diff --git a/modules/store/src/main/scala/docspell/store/impl/DoobieMeta.scala b/modules/store/src/main/scala/docspell/store/impl/DoobieMeta.scala index 772fdca6..338cdc69 100644 --- a/modules/store/src/main/scala/docspell/store/impl/DoobieMeta.scala +++ b/modules/store/src/main/scala/docspell/store/impl/DoobieMeta.scala @@ -2,15 +2,16 @@ package docspell.store.impl import java.time.format.DateTimeFormatter import java.time.{Instant, LocalDate} -import io.circe.{Decoder, Encoder} + +import docspell.common._ +import docspell.common.syntax.all._ + +import com.github.eikek.calev.CalEvent import doobie._ import doobie.implicits.legacy.instant._ import doobie.util.log.Success import emil.doobie.EmilDoobieMeta -import com.github.eikek.calev.CalEvent - -import docspell.common._ -import docspell.common.syntax.all._ +import io.circe.{Decoder, Encoder} trait DoobieMeta extends EmilDoobieMeta { diff --git a/modules/store/src/main/scala/docspell/store/impl/DoobieSyntax.scala b/modules/store/src/main/scala/docspell/store/impl/DoobieSyntax.scala index 9af4f8e0..e4a67538 100644 --- a/modules/store/src/main/scala/docspell/store/impl/DoobieSyntax.scala +++ b/modules/store/src/main/scala/docspell/store/impl/DoobieSyntax.scala @@ -1,6 +1,7 @@ package docspell.store.impl import docspell.common.Timestamp + import doobie._ import doobie.implicits._ diff --git a/modules/store/src/main/scala/docspell/store/impl/StoreImpl.scala b/modules/store/src/main/scala/docspell/store/impl/StoreImpl.scala index 14d2156d..06e63e9b 100644 --- a/modules/store/src/main/scala/docspell/store/impl/StoreImpl.scala +++ b/modules/store/src/main/scala/docspell/store/impl/StoreImpl.scala @@ -1,11 +1,13 @@ package docspell.store.impl -import bitpeace.{Bitpeace, BitpeaceConfig, TikaMimetypeDetect} import cats.effect.Effect import cats.implicits._ + import docspell.common.Ident import docspell.store.migrate.FlywayMigrate import docspell.store.{AddResult, JdbcConfig, Store} + +import bitpeace.{Bitpeace, BitpeaceConfig, TikaMimetypeDetect} import doobie._ import doobie.implicits._ diff --git a/modules/store/src/main/scala/docspell/store/migrate/FlywayMigrate.scala b/modules/store/src/main/scala/docspell/store/migrate/FlywayMigrate.scala index 138ea485..1bcba86e 100644 --- a/modules/store/src/main/scala/docspell/store/migrate/FlywayMigrate.scala +++ b/modules/store/src/main/scala/docspell/store/migrate/FlywayMigrate.scala @@ -1,7 +1,9 @@ package docspell.store.migrate import cats.effect.Sync + import docspell.store.JdbcConfig + import org.flywaydb.core.Flyway import org.log4s._ diff --git a/modules/store/src/main/scala/docspell/store/queries/QAttachment.scala b/modules/store/src/main/scala/docspell/store/queries/QAttachment.scala index 90060fba..81c734c3 100644 --- a/modules/store/src/main/scala/docspell/store/queries/QAttachment.scala +++ b/modules/store/src/main/scala/docspell/store/queries/QAttachment.scala @@ -1,16 +1,18 @@ package docspell.store.queries -import fs2.Stream -import cats.implicits._ -import cats.effect.Sync import cats.data.OptionT -import doobie._ -import doobie.implicits._ +import cats.effect.Sync +import cats.implicits._ +import fs2.Stream + import docspell.common._ +import docspell.common.syntax.all._ import docspell.store.Store import docspell.store.impl.Implicits._ import docspell.store.records._ -import docspell.common.syntax.all._ + +import doobie._ +import doobie.implicits._ object QAttachment { private[this] val logger = org.log4s.getLogger diff --git a/modules/store/src/main/scala/docspell/store/queries/QCollective.scala b/modules/store/src/main/scala/docspell/store/queries/QCollective.scala index 8f9f4067..4eb129d4 100644 --- a/modules/store/src/main/scala/docspell/store/queries/QCollective.scala +++ b/modules/store/src/main/scala/docspell/store/queries/QCollective.scala @@ -1,12 +1,14 @@ package docspell.store.queries import fs2.Stream -import doobie._ -import doobie.implicits._ + +import docspell.common.ContactKind import docspell.common.{Direction, Ident} import docspell.store.impl.Implicits._ import docspell.store.records._ -import docspell.common.ContactKind + +import doobie._ +import doobie.implicits._ object QCollective { diff --git a/modules/store/src/main/scala/docspell/store/queries/QItem.scala b/modules/store/src/main/scala/docspell/store/queries/QItem.scala index d481656f..84c81e9a 100644 --- a/modules/store/src/main/scala/docspell/store/queries/QItem.scala +++ b/modules/store/src/main/scala/docspell/store/queries/QItem.scala @@ -1,19 +1,21 @@ package docspell.store.queries -import bitpeace.FileMeta -import cats.effect.Sync -import cats.data.OptionT import cats.data.NonEmptyList -import cats.implicits._ +import cats.data.OptionT +import cats.effect.Sync import cats.effect.concurrent.Ref +import cats.implicits._ import fs2.Stream -import doobie._ -import doobie.implicits._ + import docspell.common.{IdRef, _} import docspell.store.Store -import docspell.store.records._ -import docspell.store.impl._ import docspell.store.impl.Implicits._ +import docspell.store.impl._ +import docspell.store.records._ + +import bitpeace.FileMeta +import doobie._ +import doobie.implicits._ import org.log4s._ object QItem { diff --git a/modules/store/src/main/scala/docspell/store/queries/QJob.scala b/modules/store/src/main/scala/docspell/store/queries/QJob.scala index 852f1ade..99f94b67 100644 --- a/modules/store/src/main/scala/docspell/store/queries/QJob.scala +++ b/modules/store/src/main/scala/docspell/store/queries/QJob.scala @@ -2,14 +2,16 @@ package docspell.store.queries import cats.effect.Effect import cats.implicits._ +import fs2.Stream + import docspell.common._ import docspell.common.syntax.all._ import docspell.store.Store import docspell.store.impl.Implicits._ import docspell.store.records.{RJob, RJobGroupUse, RJobLog} + import doobie._ import doobie.implicits._ -import fs2.Stream import org.log4s._ object QJob { diff --git a/modules/store/src/main/scala/docspell/store/queries/QLogin.scala b/modules/store/src/main/scala/docspell/store/queries/QLogin.scala index 7c114a76..da5f6637 100644 --- a/modules/store/src/main/scala/docspell/store/queries/QLogin.scala +++ b/modules/store/src/main/scala/docspell/store/queries/QLogin.scala @@ -5,6 +5,7 @@ import docspell.store.impl.Implicits._ import docspell.store.records.RCollective.{Columns => CC} import docspell.store.records.RUser.{Columns => UC} import docspell.store.records.{RCollective, RUser} + import doobie._ import doobie.implicits._ import org.log4s._ diff --git a/modules/store/src/main/scala/docspell/store/queries/QMails.scala b/modules/store/src/main/scala/docspell/store/queries/QMails.scala index 6053df10..90046d33 100644 --- a/modules/store/src/main/scala/docspell/store/queries/QMails.scala +++ b/modules/store/src/main/scala/docspell/store/queries/QMails.scala @@ -1,13 +1,14 @@ package docspell.store.queries import cats.data.OptionT -import doobie._ -import doobie.implicits._ import docspell.common._ import docspell.store.impl.Column import docspell.store.impl.Implicits._ -import docspell.store.records.{RItem, RSentMail, RSentMailItem, RUser} +import docspell.store.records._ + +import doobie._ +import doobie.implicits._ object QMails { diff --git a/modules/store/src/main/scala/docspell/store/queries/QOrganization.scala b/modules/store/src/main/scala/docspell/store/queries/QOrganization.scala index 5fd63b15..159f423c 100644 --- a/modules/store/src/main/scala/docspell/store/queries/QOrganization.scala +++ b/modules/store/src/main/scala/docspell/store/queries/QOrganization.scala @@ -1,16 +1,18 @@ package docspell.store.queries -import fs2._ import cats.implicits._ -import doobie._ -import doobie.implicits._ +import fs2._ + import docspell.common._ -import docspell.store.{AddResult, Store} import docspell.store.impl.Column import docspell.store.impl.Implicits._ import docspell.store.records.ROrganization.{Columns => OC} import docspell.store.records.RPerson.{Columns => PC} import docspell.store.records._ +import docspell.store.{AddResult, Store} + +import doobie._ +import doobie.implicits._ object QOrganization { diff --git a/modules/store/src/main/scala/docspell/store/queries/QPeriodicTask.scala b/modules/store/src/main/scala/docspell/store/queries/QPeriodicTask.scala index 21624f7a..cf8451c5 100644 --- a/modules/store/src/main/scala/docspell/store/queries/QPeriodicTask.scala +++ b/modules/store/src/main/scala/docspell/store/queries/QPeriodicTask.scala @@ -3,6 +3,7 @@ package docspell.store.queries import docspell.common._ import docspell.store.impl.Implicits._ import docspell.store.records._ + import doobie._ import doobie.implicits._ diff --git a/modules/store/src/main/scala/docspell/store/queries/QUserTask.scala b/modules/store/src/main/scala/docspell/store/queries/QUserTask.scala index 41c9457f..9ef601fa 100644 --- a/modules/store/src/main/scala/docspell/store/queries/QUserTask.scala +++ b/modules/store/src/main/scala/docspell/store/queries/QUserTask.scala @@ -1,10 +1,12 @@ package docspell.store.queries import fs2._ + import docspell.common._ import docspell.store.impl.Implicits._ import docspell.store.records._ import docspell.store.usertask.UserTask + import doobie._ object QUserTask { diff --git a/modules/store/src/main/scala/docspell/store/queue/JobQueue.scala b/modules/store/src/main/scala/docspell/store/queue/JobQueue.scala index 2fa60d91..f7d15ed5 100644 --- a/modules/store/src/main/scala/docspell/store/queue/JobQueue.scala +++ b/modules/store/src/main/scala/docspell/store/queue/JobQueue.scala @@ -1,12 +1,14 @@ package docspell.store.queue -import cats.implicits._ import cats.effect.{Effect, Resource} +import cats.implicits._ + import docspell.common._ import docspell.common.syntax.all._ import docspell.store.Store import docspell.store.queries.QJob import docspell.store.records.RJob + import org.log4s._ trait JobQueue[F[_]] { diff --git a/modules/store/src/main/scala/docspell/store/queue/PeriodicTaskStore.scala b/modules/store/src/main/scala/docspell/store/queue/PeriodicTaskStore.scala index 16350602..dfbdb2d5 100644 --- a/modules/store/src/main/scala/docspell/store/queue/PeriodicTaskStore.scala +++ b/modules/store/src/main/scala/docspell/store/queue/PeriodicTaskStore.scala @@ -2,13 +2,15 @@ package docspell.store.queue import cats.effect._ import cats.implicits._ -import org.log4s.getLogger -import com.github.eikek.fs2calev._ + import docspell.common._ import docspell.common.syntax.all._ -import docspell.store.{AddResult, Store} -import docspell.store.records._ import docspell.store.queries.QPeriodicTask +import docspell.store.records._ +import docspell.store.{AddResult, Store} + +import com.github.eikek.fs2calev._ +import org.log4s.getLogger trait PeriodicTaskStore[F[_]] { diff --git a/modules/store/src/main/scala/docspell/store/records/RAttachment.scala b/modules/store/src/main/scala/docspell/store/records/RAttachment.scala index e11c76b7..61d676b6 100644 --- a/modules/store/src/main/scala/docspell/store/records/RAttachment.scala +++ b/modules/store/src/main/scala/docspell/store/records/RAttachment.scala @@ -1,12 +1,14 @@ package docspell.store.records -import bitpeace.FileMeta import cats.implicits._ + +import docspell.common._ +import docspell.store.impl.Implicits._ +import docspell.store.impl._ + +import bitpeace.FileMeta import doobie._ import doobie.implicits._ -import docspell.common._ -import docspell.store.impl._ -import docspell.store.impl.Implicits._ case class RAttachment( id: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RAttachmentArchive.scala b/modules/store/src/main/scala/docspell/store/records/RAttachmentArchive.scala index 09ccbab7..917741c3 100644 --- a/modules/store/src/main/scala/docspell/store/records/RAttachmentArchive.scala +++ b/modules/store/src/main/scala/docspell/store/records/RAttachmentArchive.scala @@ -1,12 +1,14 @@ package docspell.store.records +import cats.data.NonEmptyList + +import docspell.common._ +import docspell.store.impl.Implicits._ +import docspell.store.impl._ + import bitpeace.FileMeta import doobie._ import doobie.implicits._ -import docspell.common._ -import docspell.store.impl._ -import docspell.store.impl.Implicits._ -import cats.data.NonEmptyList /** The archive file of some attachment. The `id` is shared with the * attachment, to create a 0..1-1 relationship. diff --git a/modules/store/src/main/scala/docspell/store/records/RAttachmentMeta.scala b/modules/store/src/main/scala/docspell/store/records/RAttachmentMeta.scala index eeb598fa..72223180 100644 --- a/modules/store/src/main/scala/docspell/store/records/RAttachmentMeta.scala +++ b/modules/store/src/main/scala/docspell/store/records/RAttachmentMeta.scala @@ -1,11 +1,13 @@ package docspell.store.records import cats.implicits._ + +import docspell.common._ +import docspell.store.impl.Implicits._ +import docspell.store.impl._ + import doobie._ import doobie.implicits._ -import docspell.common._ -import docspell.store.impl._ -import docspell.store.impl.Implicits._ case class RAttachmentMeta( id: Ident, //same as RAttachment.id diff --git a/modules/store/src/main/scala/docspell/store/records/RAttachmentSource.scala b/modules/store/src/main/scala/docspell/store/records/RAttachmentSource.scala index 9ab6e024..58b0a6c7 100644 --- a/modules/store/src/main/scala/docspell/store/records/RAttachmentSource.scala +++ b/modules/store/src/main/scala/docspell/store/records/RAttachmentSource.scala @@ -1,11 +1,12 @@ package docspell.store.records +import docspell.common._ +import docspell.store.impl.Implicits._ +import docspell.store.impl._ + import bitpeace.FileMeta import doobie._ import doobie.implicits._ -import docspell.common._ -import docspell.store.impl._ -import docspell.store.impl.Implicits._ /** The origin file of an attachment. The `id` is shared with the * attachment, to create a 1-1 (or 0..1-1) relationship. diff --git a/modules/store/src/main/scala/docspell/store/records/RCollective.scala b/modules/store/src/main/scala/docspell/store/records/RCollective.scala index 843960d2..9d27bd1e 100644 --- a/modules/store/src/main/scala/docspell/store/records/RCollective.scala +++ b/modules/store/src/main/scala/docspell/store/records/RCollective.scala @@ -1,11 +1,13 @@ package docspell.store.records +import fs2.Stream + import docspell.common._ import docspell.store.impl.Column import docspell.store.impl.Implicits._ + import doobie._ import doobie.implicits._ -import fs2.Stream case class RCollective( id: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RContact.scala b/modules/store/src/main/scala/docspell/store/records/RContact.scala index 0df3459a..f6d3598a 100644 --- a/modules/store/src/main/scala/docspell/store/records/RContact.scala +++ b/modules/store/src/main/scala/docspell/store/records/RContact.scala @@ -1,9 +1,11 @@ package docspell.store.records -import doobie._, doobie.implicits._ import docspell.common._ -import docspell.store.impl._ import docspell.store.impl.Implicits._ +import docspell.store.impl._ + +import doobie._ +import doobie.implicits._ case class RContact( contactId: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/REquipment.scala b/modules/store/src/main/scala/docspell/store/records/REquipment.scala index ed2b8d0f..78d2e7f8 100644 --- a/modules/store/src/main/scala/docspell/store/records/REquipment.scala +++ b/modules/store/src/main/scala/docspell/store/records/REquipment.scala @@ -1,9 +1,11 @@ package docspell.store.records -import doobie._, doobie.implicits._ import docspell.common._ -import docspell.store.impl._ import docspell.store.impl.Implicits._ +import docspell.store.impl._ + +import doobie._ +import doobie.implicits._ case class REquipment(eid: Ident, cid: Ident, name: String, created: Timestamp) {} diff --git a/modules/store/src/main/scala/docspell/store/records/RFileMeta.scala b/modules/store/src/main/scala/docspell/store/records/RFileMeta.scala index 1749a653..dc04054d 100644 --- a/modules/store/src/main/scala/docspell/store/records/RFileMeta.scala +++ b/modules/store/src/main/scala/docspell/store/records/RFileMeta.scala @@ -1,13 +1,13 @@ package docspell.store.records +import docspell.common._ +import docspell.store.impl.Implicits._ +import docspell.store.impl._ + import bitpeace.FileMeta import doobie._ import doobie.implicits._ -import docspell.common._ -import docspell.store.impl._ -import docspell.store.impl.Implicits._ - object RFileMeta { val table = fr"filemeta" diff --git a/modules/store/src/main/scala/docspell/store/records/RFtsMigration.scala b/modules/store/src/main/scala/docspell/store/records/RFtsMigration.scala index edd47c1c..b02d26f7 100644 --- a/modules/store/src/main/scala/docspell/store/records/RFtsMigration.scala +++ b/modules/store/src/main/scala/docspell/store/records/RFtsMigration.scala @@ -1,12 +1,14 @@ package docspell.store.records -import cats.implicits._ import cats.effect._ +import cats.implicits._ + +import docspell.common._ +import docspell.store.impl.Implicits._ +import docspell.store.impl._ + import doobie._ import doobie.implicits._ -import docspell.common._ -import docspell.store.impl._ -import docspell.store.impl.Implicits._ final case class RFtsMigration( id: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RInvitation.scala b/modules/store/src/main/scala/docspell/store/records/RInvitation.scala index 875efb5a..6a516788 100644 --- a/modules/store/src/main/scala/docspell/store/records/RInvitation.scala +++ b/modules/store/src/main/scala/docspell/store/records/RInvitation.scala @@ -1,12 +1,14 @@ package docspell.store.records -import cats.implicits._ import cats.effect.Sync +import cats.implicits._ + +import docspell.common._ +import docspell.store.impl.Implicits._ +import docspell.store.impl._ + import doobie._ import doobie.implicits._ -import docspell.common._ -import docspell.store.impl._ -import docspell.store.impl.Implicits._ case class RInvitation(id: Ident, created: Timestamp) {} diff --git a/modules/store/src/main/scala/docspell/store/records/RItem.scala b/modules/store/src/main/scala/docspell/store/records/RItem.scala index 6d300e62..987a77c0 100644 --- a/modules/store/src/main/scala/docspell/store/records/RItem.scala +++ b/modules/store/src/main/scala/docspell/store/records/RItem.scala @@ -3,11 +3,13 @@ package docspell.store.records import cats.data.NonEmptyList import cats.effect.Sync import cats.implicits._ + +import docspell.common._ +import docspell.store.impl.Implicits._ +import docspell.store.impl._ + import doobie._ import doobie.implicits._ -import docspell.common._ -import docspell.store.impl._ -import docspell.store.impl.Implicits._ case class RItem( id: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RJob.scala b/modules/store/src/main/scala/docspell/store/records/RJob.scala index 0fbe7e2c..089a6866 100644 --- a/modules/store/src/main/scala/docspell/store/records/RJob.scala +++ b/modules/store/src/main/scala/docspell/store/records/RJob.scala @@ -3,14 +3,15 @@ package docspell.store.records import cats.effect.Sync import cats.implicits._ import fs2.Stream -import doobie._ -import doobie.implicits._ -import io.circe.Encoder import docspell.common._ import docspell.store.impl.Column import docspell.store.impl.Implicits._ +import doobie._ +import doobie.implicits._ +import io.circe.Encoder + case class RJob( id: Ident, task: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RJobGroupUse.scala b/modules/store/src/main/scala/docspell/store/records/RJobGroupUse.scala index 8210da33..1ce0e448 100644 --- a/modules/store/src/main/scala/docspell/store/records/RJobGroupUse.scala +++ b/modules/store/src/main/scala/docspell/store/records/RJobGroupUse.scala @@ -1,12 +1,14 @@ package docspell.store.records import cats.implicits._ -import doobie._ -import doobie.implicits._ + import docspell.common._ import docspell.store.impl.Column import docspell.store.impl.Implicits._ +import doobie._ +import doobie.implicits._ + case class RJobGroupUse(groupId: Ident, workerId: Ident) {} object RJobGroupUse { diff --git a/modules/store/src/main/scala/docspell/store/records/RJobLog.scala b/modules/store/src/main/scala/docspell/store/records/RJobLog.scala index cbc81183..5384df47 100644 --- a/modules/store/src/main/scala/docspell/store/records/RJobLog.scala +++ b/modules/store/src/main/scala/docspell/store/records/RJobLog.scala @@ -1,11 +1,12 @@ package docspell.store.records -import doobie._ -import doobie.implicits._ import docspell.common._ import docspell.store.impl.Column import docspell.store.impl.Implicits._ +import doobie._ +import doobie.implicits._ + case class RJobLog( id: Ident, jobId: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RNode.scala b/modules/store/src/main/scala/docspell/store/records/RNode.scala index ca6f970e..5afa5944 100644 --- a/modules/store/src/main/scala/docspell/store/records/RNode.scala +++ b/modules/store/src/main/scala/docspell/store/records/RNode.scala @@ -2,12 +2,14 @@ package docspell.store.records import cats.effect.Sync import cats.implicits._ -import doobie._ -import doobie.implicits._ + import docspell.common._ import docspell.store.impl.Column import docspell.store.impl.Implicits._ +import doobie._ +import doobie.implicits._ + case class RNode( id: Ident, nodeType: NodeType, diff --git a/modules/store/src/main/scala/docspell/store/records/ROrganization.scala b/modules/store/src/main/scala/docspell/store/records/ROrganization.scala index a3e2db04..17fe4845 100644 --- a/modules/store/src/main/scala/docspell/store/records/ROrganization.scala +++ b/modules/store/src/main/scala/docspell/store/records/ROrganization.scala @@ -2,11 +2,13 @@ package docspell.store.records import cats.Eq import fs2.Stream + +import docspell.common.{IdRef, _} +import docspell.store.impl.Implicits._ +import docspell.store.impl._ + import doobie._ import doobie.implicits._ -import docspell.common.{IdRef, _} -import docspell.store.impl._ -import docspell.store.impl.Implicits._ case class ROrganization( oid: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RPeriodicTask.scala b/modules/store/src/main/scala/docspell/store/records/RPeriodicTask.scala index a510904b..4f7c68a3 100644 --- a/modules/store/src/main/scala/docspell/store/records/RPeriodicTask.scala +++ b/modules/store/src/main/scala/docspell/store/records/RPeriodicTask.scala @@ -2,12 +2,14 @@ package docspell.store.records import cats.effect._ import cats.implicits._ -import doobie._ -import doobie.implicits._ -import com.github.eikek.calev.CalEvent + import docspell.common._ import docspell.store.impl.Column import docspell.store.impl.Implicits._ + +import com.github.eikek.calev.CalEvent +import doobie._ +import doobie.implicits._ import io.circe.Encoder /** A periodic task is a special job description, that shares a few diff --git a/modules/store/src/main/scala/docspell/store/records/RPerson.scala b/modules/store/src/main/scala/docspell/store/records/RPerson.scala index 3e3476eb..eb9a9872 100644 --- a/modules/store/src/main/scala/docspell/store/records/RPerson.scala +++ b/modules/store/src/main/scala/docspell/store/records/RPerson.scala @@ -1,12 +1,14 @@ package docspell.store.records -import fs2.Stream import cats.Eq +import fs2.Stream + +import docspell.common.{IdRef, _} +import docspell.store.impl.Implicits._ +import docspell.store.impl._ + import doobie._ import doobie.implicits._ -import docspell.common.{IdRef, _} -import docspell.store.impl._ -import docspell.store.impl.Implicits._ case class RPerson( pid: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RSentMail.scala b/modules/store/src/main/scala/docspell/store/records/RSentMail.scala index 461fdc23..2a35f92b 100644 --- a/modules/store/src/main/scala/docspell/store/records/RSentMail.scala +++ b/modules/store/src/main/scala/docspell/store/records/RSentMail.scala @@ -1,16 +1,18 @@ package docspell.store.records -import fs2.Stream +import cats.data.NonEmptyList +import cats.data.OptionT import cats.effect._ import cats.implicits._ -import cats.data.NonEmptyList -import doobie._ -import doobie.implicits._ +import fs2.Stream + import docspell.common._ import docspell.store.impl.Column import docspell.store.impl.Implicits._ + +import doobie._ +import doobie.implicits._ import emil.MailAddress -import cats.data.OptionT case class RSentMail( id: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RSentMailItem.scala b/modules/store/src/main/scala/docspell/store/records/RSentMailItem.scala index 41fbcf90..d17e29ec 100644 --- a/modules/store/src/main/scala/docspell/store/records/RSentMailItem.scala +++ b/modules/store/src/main/scala/docspell/store/records/RSentMailItem.scala @@ -2,12 +2,14 @@ package docspell.store.records import cats.effect._ import cats.implicits._ -import doobie._ -import doobie.implicits._ + import docspell.common._ import docspell.store.impl.Column import docspell.store.impl.Implicits._ +import doobie._ +import doobie.implicits._ + case class RSentMailItem( id: Ident, itemId: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RSource.scala b/modules/store/src/main/scala/docspell/store/records/RSource.scala index add1eb53..8e529e95 100644 --- a/modules/store/src/main/scala/docspell/store/records/RSource.scala +++ b/modules/store/src/main/scala/docspell/store/records/RSource.scala @@ -1,10 +1,11 @@ package docspell.store.records +import docspell.common._ +import docspell.store.impl.Implicits._ +import docspell.store.impl._ + import doobie._ import doobie.implicits._ -import docspell.common._ -import docspell.store.impl._ -import docspell.store.impl.Implicits._ case class RSource( sid: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RTag.scala b/modules/store/src/main/scala/docspell/store/records/RTag.scala index 29ce9d96..27a04bf2 100644 --- a/modules/store/src/main/scala/docspell/store/records/RTag.scala +++ b/modules/store/src/main/scala/docspell/store/records/RTag.scala @@ -1,9 +1,11 @@ package docspell.store.records -import doobie._, doobie.implicits._ import docspell.common._ -import docspell.store.impl._ import docspell.store.impl.Implicits._ +import docspell.store.impl._ + +import doobie._ +import doobie.implicits._ case class RTag( tagId: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RTagItem.scala b/modules/store/src/main/scala/docspell/store/records/RTagItem.scala index dd1db7e5..2782731d 100644 --- a/modules/store/src/main/scala/docspell/store/records/RTagItem.scala +++ b/modules/store/src/main/scala/docspell/store/records/RTagItem.scala @@ -1,11 +1,13 @@ package docspell.store.records import cats.implicits._ + +import docspell.common._ +import docspell.store.impl.Implicits._ +import docspell.store.impl._ + import doobie._ import doobie.implicits._ -import docspell.common._ -import docspell.store.impl._ -import docspell.store.impl.Implicits._ case class RTagItem(tagItemId: Ident, itemId: Ident, tagId: Ident) {} diff --git a/modules/store/src/main/scala/docspell/store/records/RUser.scala b/modules/store/src/main/scala/docspell/store/records/RUser.scala index d6a17498..a304cabf 100644 --- a/modules/store/src/main/scala/docspell/store/records/RUser.scala +++ b/modules/store/src/main/scala/docspell/store/records/RUser.scala @@ -1,9 +1,11 @@ package docspell.store.records -import doobie._, doobie.implicits._ import docspell.common._ -import docspell.store.impl._ import docspell.store.impl.Implicits._ +import docspell.store.impl._ + +import doobie._ +import doobie.implicits._ case class RUser( uid: Ident, diff --git a/modules/store/src/main/scala/docspell/store/records/RUserEmail.scala b/modules/store/src/main/scala/docspell/store/records/RUserEmail.scala index 224feee8..34ab5936 100644 --- a/modules/store/src/main/scala/docspell/store/records/RUserEmail.scala +++ b/modules/store/src/main/scala/docspell/store/records/RUserEmail.scala @@ -1,13 +1,15 @@ package docspell.store.records -import doobie._ -import doobie.implicits._ +import cats.data.OptionT import cats.effect._ import cats.implicits._ -import cats.data.OptionT + import docspell.common._ import docspell.store.impl.Column import docspell.store.impl.Implicits._ + +import doobie._ +import doobie.implicits._ import emil.{MailAddress, MailConfig, SSLType} case class RUserEmail( diff --git a/modules/store/src/main/scala/docspell/store/records/RUserImap.scala b/modules/store/src/main/scala/docspell/store/records/RUserImap.scala index 433fdd1a..5b56fe35 100644 --- a/modules/store/src/main/scala/docspell/store/records/RUserImap.scala +++ b/modules/store/src/main/scala/docspell/store/records/RUserImap.scala @@ -1,13 +1,15 @@ package docspell.store.records -import doobie._ -import doobie.implicits._ +import cats.data.OptionT import cats.effect._ import cats.implicits._ -import cats.data.OptionT + import docspell.common._ import docspell.store.impl.Column import docspell.store.impl.Implicits._ + +import doobie._ +import doobie.implicits._ import emil.{MailConfig, SSLType} case class RUserImap( diff --git a/modules/store/src/main/scala/docspell/store/syntax/MimeTypes.scala b/modules/store/src/main/scala/docspell/store/syntax/MimeTypes.scala index 39ff549e..2006a325 100644 --- a/modules/store/src/main/scala/docspell/store/syntax/MimeTypes.scala +++ b/modules/store/src/main/scala/docspell/store/syntax/MimeTypes.scala @@ -1,8 +1,9 @@ package docspell.store.syntax -import bitpeace.Mimetype import docspell.common._ +import bitpeace.Mimetype + object MimeTypes { implicit final class BitpeaceMimeTypeOps(bmt: Mimetype) { diff --git a/modules/store/src/main/scala/docspell/store/usertask/UserTask.scala b/modules/store/src/main/scala/docspell/store/usertask/UserTask.scala index 3bf2dad8..9d038083 100644 --- a/modules/store/src/main/scala/docspell/store/usertask/UserTask.scala +++ b/modules/store/src/main/scala/docspell/store/usertask/UserTask.scala @@ -2,14 +2,15 @@ package docspell.store.usertask import cats.effect._ import cats.implicits._ -import com.github.eikek.calev.CalEvent -import io.circe.Decoder -import io.circe.Encoder import docspell.common._ import docspell.common.syntax.all._ import docspell.store.records.RPeriodicTask +import com.github.eikek.calev.CalEvent +import io.circe.Decoder +import io.circe.Encoder + case class UserTask[A]( id: Ident, name: Ident, diff --git a/modules/store/src/main/scala/docspell/store/usertask/UserTaskStore.scala b/modules/store/src/main/scala/docspell/store/usertask/UserTaskStore.scala index 9f9c430a..bdcd4ad7 100644 --- a/modules/store/src/main/scala/docspell/store/usertask/UserTaskStore.scala +++ b/modules/store/src/main/scala/docspell/store/usertask/UserTaskStore.scala @@ -1,13 +1,15 @@ package docspell.store.usertask -import fs2.Stream -import cats.implicits._ -import cats.effect._ import cats.data.OptionT -import io.circe._ +import cats.effect._ +import cats.implicits._ +import fs2.Stream + import docspell.common._ -import docspell.store.{AddResult, Store} import docspell.store.queries.QUserTask +import docspell.store.{AddResult, Store} + +import io.circe._ /** User tasks are `RPeriodicTask`s that can be managed by the user. * The user can change arguments, enable/disable it or run it just