diff --git a/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/Main.scala b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/Main.scala index 903b4f3c11..f808fcbf7c 100644 --- a/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/Main.scala +++ b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/Main.scala @@ -6,7 +6,7 @@ import akka.http.scaladsl.model.headers.RawHeader import akka.http.scaladsl.server.{ExceptionHandler, RejectionHandler, Route, RouteResult} import cats.effect.{ExitCode, IO, IOApp, Resource} import cats.syntax.all._ -import ch.epfl.bluebrain.nexus.delta.config.{AppConfig, BuildInfo} +import ch.epfl.bluebrain.nexus.delta.config.{AppConfig, BuildInfo, StrictEntity} import ch.epfl.bluebrain.nexus.delta.kernel.Logger import ch.epfl.bluebrain.nexus.delta.kernel.kamon.KamonMonitoring import ch.epfl.bluebrain.nexus.delta.kernel.utils.IOFuture @@ -14,7 +14,6 @@ import ch.epfl.bluebrain.nexus.delta.plugin.PluginsLoader.PluginLoaderConfig import ch.epfl.bluebrain.nexus.delta.plugin.{PluginsLoader, WiringInitializer} import ch.epfl.bluebrain.nexus.delta.sdk.PriorityRoute import ch.epfl.bluebrain.nexus.delta.sdk.error.PluginError.PluginInitializationError -import ch.epfl.bluebrain.nexus.delta.sdk.http.StrictEntity import ch.epfl.bluebrain.nexus.delta.sdk.model.BaseUri import ch.epfl.bluebrain.nexus.delta.sdk.plugin.{Plugin, PluginDef} import ch.epfl.bluebrain.nexus.delta.sourcing.config.DatabaseConfig diff --git a/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/config/HttpConfig.scala b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/config/HttpConfig.scala index 80e6926875..94a1755a26 100644 --- a/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/config/HttpConfig.scala +++ b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/config/HttpConfig.scala @@ -1,6 +1,5 @@ package ch.epfl.bluebrain.nexus.delta.config -import ch.epfl.bluebrain.nexus.delta.sdk.http.StrictEntity import ch.epfl.bluebrain.nexus.delta.sdk.model.BaseUri import pureconfig.ConfigReader import pureconfig.generic.semiauto._ diff --git a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/http/StrictEntity.scala b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/config/StrictEntity.scala similarity index 83% rename from delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/http/StrictEntity.scala rename to delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/config/StrictEntity.scala index 2d6e1f4c3a..081db71829 100644 --- a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/http/StrictEntity.scala +++ b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/config/StrictEntity.scala @@ -1,4 +1,4 @@ -package ch.epfl.bluebrain.nexus.delta.sdk.http +package ch.epfl.bluebrain.nexus.delta.config import akka.http.scaladsl.server.Directive0 import pureconfig.ConfigReader @@ -11,7 +11,7 @@ import scala.concurrent.duration.FiniteDuration * @param timeout * if the stream is not completed by then, the directive will fail */ -case class StrictEntity(timeout: FiniteDuration) extends AnyVal { +final case class StrictEntity(timeout: FiniteDuration) extends AnyVal { def apply(): Directive0 = toStrictEntity(timeout) } diff --git a/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/wiring/DeltaModule.scala b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/wiring/DeltaModule.scala index 62b1654b5b..ced405df0f 100644 --- a/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/wiring/DeltaModule.scala +++ b/delta/app/src/main/scala/ch/epfl/bluebrain/nexus/delta/wiring/DeltaModule.scala @@ -8,7 +8,7 @@ import akka.stream.{Materializer, SystemMaterializer} import cats.data.NonEmptyList import cats.effect.{Clock, IO, Resource, Sync} import ch.epfl.bluebrain.nexus.delta.Main.pluginsMaxPriority -import ch.epfl.bluebrain.nexus.delta.config.AppConfig +import ch.epfl.bluebrain.nexus.delta.config.{AppConfig, StrictEntity} import ch.epfl.bluebrain.nexus.delta.kernel.dependency.ComponentDescription.PluginDescription import ch.epfl.bluebrain.nexus.delta.kernel.utils.{ClasspathResourceLoader, IOFuture, UUIDF} import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.contexts @@ -20,7 +20,6 @@ import ch.epfl.bluebrain.nexus.delta.sdk.IndexingAction.AggregateIndexingAction import ch.epfl.bluebrain.nexus.delta.sdk._ import ch.epfl.bluebrain.nexus.delta.sdk.acls.Acls import ch.epfl.bluebrain.nexus.delta.sdk.fusion.FusionConfig -import ch.epfl.bluebrain.nexus.delta.sdk.http.StrictEntity import ch.epfl.bluebrain.nexus.delta.sdk.identities.model.ServiceAccount import ch.epfl.bluebrain.nexus.delta.sdk.jws.JWSPayloadHelper import ch.epfl.bluebrain.nexus.delta.sdk.marshalling.{RdfExceptionHandler, RdfRejectionHandler} @@ -28,7 +27,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.model._ import ch.epfl.bluebrain.nexus.delta.sdk.plugin.PluginDef import ch.epfl.bluebrain.nexus.delta.sdk.projects.{OwnerPermissionsScopeInitialization, ProjectsConfig, ScopeInitializationErrorStore} import ch.epfl.bluebrain.nexus.delta.sourcing.Transactors -import ch.epfl.bluebrain.nexus.delta.sourcing.config.{DatabaseConfig, ElemQueryConfig, ProjectLastUpdateConfig, ProjectionConfig, QueryConfig} +import ch.epfl.bluebrain.nexus.delta.sourcing.config._ import ch.megard.akka.http.cors.scaladsl.settings.CorsSettings import com.typesafe.config.Config import izumi.distage.model.definition.{Id, ModuleDef} diff --git a/delta/kernel/src/main/scala/ch/epfl/bluebrain/nexus/delta/kernel/package.scala b/delta/kernel/src/main/scala/ch/epfl/bluebrain/nexus/delta/kernel/package.scala new file mode 100644 index 0000000000..835510da52 --- /dev/null +++ b/delta/kernel/src/main/scala/ch/epfl/bluebrain/nexus/delta/kernel/package.scala @@ -0,0 +1,10 @@ +package ch.epfl.bluebrain.nexus.delta + +import akka.stream.scaladsl.Source +import akka.util.ByteString + +package object kernel { + + type AkkaSource = Source[ByteString, Any] + +} diff --git a/delta/plugins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchiveDownload.scala b/delta/plugins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchiveDownload.scala index 3414e1259b..5c9ed7ac3a 100644 --- a/delta/plugins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchiveDownload.scala +++ b/delta/plugins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchiveDownload.scala @@ -4,14 +4,14 @@ import akka.stream.alpakka.file.ArchiveMetadata import akka.stream.scaladsl.Source import akka.util.ByteString import cats.effect.IO -import cats.implicits._ import cats.effect.unsafe.implicits._ -import ch.epfl.bluebrain.nexus.delta.kernel.Logger -import ch.epfl.bluebrain.nexus.delta.plugins.storage.FileSelf.ParsingError +import cats.implicits._ +import ch.epfl.bluebrain.nexus.delta.kernel.{AkkaSource, Logger} import ch.epfl.bluebrain.nexus.delta.plugins.archive.model.ArchiveReference.{FileReference, FileSelfReference, ResourceReference} import ch.epfl.bluebrain.nexus.delta.plugins.archive.model.ArchiveRejection._ import ch.epfl.bluebrain.nexus.delta.plugins.archive.model._ import ch.epfl.bluebrain.nexus.delta.plugins.storage.FileSelf +import ch.epfl.bluebrain.nexus.delta.plugins.storage.FileSelf.ParsingError import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.Files import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.{FileId, FileRejection} import ch.epfl.bluebrain.nexus.delta.rdf.implicits._ @@ -31,10 +31,10 @@ import ch.epfl.bluebrain.nexus.delta.sdk.marshalling.OriginalSource import ch.epfl.bluebrain.nexus.delta.sdk.model.ResourceRepresentation._ import ch.epfl.bluebrain.nexus.delta.sdk.model.{BaseUri, ResourceRepresentation} import ch.epfl.bluebrain.nexus.delta.sdk.permissions.Permissions.resources -import ch.epfl.bluebrain.nexus.delta.sdk.{AkkaSource, JsonLdValue, ResourceShifts} +import ch.epfl.bluebrain.nexus.delta.sdk.{JsonLdValue, ResourceShifts} import ch.epfl.bluebrain.nexus.delta.sourcing.model.{ProjectRef, ResourceRef} -import io.circe.{Json, Printer} import io.circe.syntax.EncoderOps +import io.circe.{Json, Printer} import java.nio.ByteBuffer import java.nio.charset.StandardCharsets diff --git a/delta/plugins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/Archives.scala b/delta/plugins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/Archives.scala index cabbd90c1a..aa59417b0f 100644 --- a/delta/plugins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/Archives.scala +++ b/delta/plugins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/Archives.scala @@ -10,7 +10,7 @@ import ch.epfl.bluebrain.nexus.delta.plugins.archive.model._ import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.Iri import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.JsonLdApi import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.RemoteContextResolution -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.sdk.identities.model.Caller import ch.epfl.bluebrain.nexus.delta.sdk.jsonld.ExpandIri import ch.epfl.bluebrain.nexus.delta.sdk.jsonld.JsonLdSourceProcessor.JsonLdSourceDecoder diff --git a/delta/plugins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/routes/ArchiveRoutes.scala b/delta/plugins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/routes/ArchiveRoutes.scala index cb7d8c0381..7696ee2473 100644 --- a/delta/plugins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/routes/ArchiveRoutes.scala +++ b/delta/plugins/archive/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/routes/ArchiveRoutes.scala @@ -9,7 +9,7 @@ import ch.epfl.bluebrain.nexus.delta.plugins.archive.Archives import ch.epfl.bluebrain.nexus.delta.plugins.archive.model.{permissions, ArchiveRejection, ArchiveResource, Zip} import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.RemoteContextResolution import ch.epfl.bluebrain.nexus.delta.rdf.utils.JsonKeyOrdering -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.sdk.acls.AclCheck import ch.epfl.bluebrain.nexus.delta.kernel.circe.CirceUnmarshalling import ch.epfl.bluebrain.nexus.delta.sdk.directives.DeltaDirectives._ diff --git a/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchiveDownloadSpec.scala b/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchiveDownloadSpec.scala index 381950a9e8..b8a35435ac 100644 --- a/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchiveDownloadSpec.scala +++ b/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchiveDownloadSpec.scala @@ -24,7 +24,7 @@ import ch.epfl.bluebrain.nexus.delta.plugins.storage.{FileSelf, RemoteContextRes import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.Iri import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.nxv import ch.epfl.bluebrain.nexus.delta.rdf.utils.JsonKeyOrdering -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.sdk.acls.AclSimpleCheck import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.AclAddress import ch.epfl.bluebrain.nexus.delta.sdk.directives.FileResponse diff --git a/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesSpec.scala b/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesSpec.scala index 37694110f3..80f5bee0af 100644 --- a/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesSpec.scala +++ b/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesSpec.scala @@ -9,7 +9,7 @@ import ch.epfl.bluebrain.nexus.delta.plugins.archive.model.ArchiveRejection.Arch import ch.epfl.bluebrain.nexus.delta.plugins.archive.model.{Archive, ArchiveValue} import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.{nxv, schema} import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.{JsonLdApi, JsonLdJavaApi} -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.sdk.generators.ProjectGen import ch.epfl.bluebrain.nexus.delta.sdk.identities.model.Caller import ch.epfl.bluebrain.nexus.delta.sdk.implicits._ diff --git a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/Files.scala b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/Files.scala index 93b3bf7fa0..df448a2952 100644 --- a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/Files.scala +++ b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/Files.scala @@ -21,7 +21,7 @@ import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations._ import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.{FetchStorage, Storages} import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.Iri import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.ContextValue -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.sdk.directives.FileResponse import ch.epfl.bluebrain.nexus.delta.sdk.identities.model.Caller import ch.epfl.bluebrain.nexus.delta.sdk.implicits._ diff --git a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/FileOperations.scala b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/FileOperations.scala index efde3f86cb..904d209c24 100644 --- a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/FileOperations.scala +++ b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/FileOperations.scala @@ -11,7 +11,7 @@ import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.Uploadi import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.disk.DiskFileOperations import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.remote.RemoteDiskFileOperations import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.s3.S3FileOperations -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import java.util.UUID diff --git a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/disk/DiskFileOperations.scala b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/disk/DiskFileOperations.scala index f45209c034..4f2b544a25 100644 --- a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/disk/DiskFileOperations.scala +++ b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/disk/DiskFileOperations.scala @@ -9,7 +9,7 @@ import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.FileStorageMeta import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.StorageFileRejection.FetchFileRejection import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.StorageFileRejection.FetchFileRejection.UnexpectedLocationFormat import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.UploadingFile.DiskUploadingFile -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource trait DiskFileOperations { def fetch(path: Uri.Path): IO[AkkaSource] diff --git a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/remote/RemoteDiskFileOperations.scala b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/remote/RemoteDiskFileOperations.scala index c56f4feff2..921ec1f5cf 100644 --- a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/remote/RemoteDiskFileOperations.scala +++ b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/remote/RemoteDiskFileOperations.scala @@ -13,7 +13,7 @@ import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.Storage import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.UploadingFile.RemoteUploadingFile import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.remote.client.RemoteDiskStorageClient import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.remote.client.model.RemoteDiskStorageFileAttributes -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} import java.util.UUID diff --git a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/remote/client/RemoteDiskStorageClient.scala b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/remote/client/RemoteDiskStorageClient.scala index e2b7afea04..05458fcbda 100644 --- a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/remote/client/RemoteDiskStorageClient.scala +++ b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/remote/client/RemoteDiskStorageClient.scala @@ -17,7 +17,7 @@ import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.Storage import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.StorageFileRejection.{FetchFileRejection, MoveFileRejection, SaveFileRejection} import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.remote.client.model.RemoteDiskStorageFileAttributes import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.JsonLdContext.keywords -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.sdk.auth.{AuthTokenProvider, Credentials} import ch.epfl.bluebrain.nexus.delta.kernel.circe.CirceMarshalling._ import ch.epfl.bluebrain.nexus.delta.sdk.error.ServiceError.FeatureDisabled diff --git a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/s3/S3FileOperations.scala b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/s3/S3FileOperations.scala index 50d1921b7b..df4be8811e 100644 --- a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/s3/S3FileOperations.scala +++ b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/s3/S3FileOperations.scala @@ -15,7 +15,7 @@ import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.Storage import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.UploadingFile.S3UploadingFile import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.s3.S3FileOperations.{S3DelegationMetadata, S3FileMetadata} import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.s3.client.S3StorageClient -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ import ch.epfl.bluebrain.nexus.delta.sdk.stream.StreamConverter import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef diff --git a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/mocks/FileOperationsMock.scala b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/mocks/FileOperationsMock.scala index a6e7992f21..db5683bf72 100644 --- a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/mocks/FileOperationsMock.scala +++ b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/mocks/FileOperationsMock.scala @@ -14,7 +14,7 @@ import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.remote. import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.remote.client.RemoteDiskStorageClient.RemoteDiskStorageClientDisabled import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.s3.client.S3StorageClient import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.s3.{S3FileOperations, S3LocationGenerator} -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef object FileOperationsMock { diff --git a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/AkkaSourceHelpers.scala b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/AkkaSourceHelpers.scala index 66e091fa63..a62713b89a 100644 --- a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/AkkaSourceHelpers.scala +++ b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/AkkaSourceHelpers.scala @@ -2,7 +2,7 @@ package ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations import akka.actor.ActorSystem import cats.effect.IO -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import org.scalatest.concurrent.ScalaFutures import scala.concurrent.duration._ diff --git a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/directives/FileResponse.scala b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/directives/FileResponse.scala index ab4da13069..ee68de595c 100644 --- a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/directives/FileResponse.scala +++ b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/directives/FileResponse.scala @@ -3,11 +3,12 @@ package ch.epfl.bluebrain.nexus.delta.sdk.directives import akka.http.scaladsl.model.{ContentType, HttpHeader, StatusCode, StatusCodes} import cats.effect.IO import cats.syntax.all._ +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.encoder.JsonLdEncoder +import ch.epfl.bluebrain.nexus.delta.sdk.JsonLdValue import ch.epfl.bluebrain.nexus.delta.sdk.directives.FileResponse.{Content, Metadata} import ch.epfl.bluebrain.nexus.delta.sdk.directives.Response.Complete import ch.epfl.bluebrain.nexus.delta.sdk.marshalling.HttpResponseFields -import ch.epfl.bluebrain.nexus.delta.sdk.{AkkaSource, JsonLdValue} /** * A file response content diff --git a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/http/HttpClient.scala b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/http/HttpClient.scala index 3dde52a07e..1d5c73b656 100644 --- a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/http/HttpClient.scala +++ b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/http/HttpClient.scala @@ -11,12 +11,12 @@ import akka.stream.StreamTcpException import akka.util.ByteString import cats.effect.IO import cats.implicits._ +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.kernel.utils.IOFuture import ch.epfl.bluebrain.nexus.delta.kernel.utils.IOFuture.defaultCancelable -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource import ch.epfl.bluebrain.nexus.delta.kernel.circe.CirceUnmarshalling._ import ch.epfl.bluebrain.nexus.delta.sdk.http.HttpClientError._ -import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ +import ch.epfl.bluebrain.nexus.delta.kernel.syntax._ import io.circe.{Decoder, Json} import java.net.{ConnectException, UnknownHostException} diff --git a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/package.scala b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/package.scala index 94e33c7af0..6dac2f8e0b 100644 --- a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/package.scala +++ b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/package.scala @@ -1,7 +1,5 @@ package ch.epfl.bluebrain.nexus.delta -import akka.stream.scaladsl.Source -import akka.util.ByteString import cats.effect.IO import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.Acl import ch.epfl.bluebrain.nexus.delta.sdk.identities.model.Caller @@ -14,8 +12,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.resolvers.model.{Resolver, ResourceReso import ch.epfl.bluebrain.nexus.delta.sdk.resources.model.Resource import ch.epfl.bluebrain.nexus.delta.sdk.schemas.model.Schema import ch.epfl.bluebrain.nexus.delta.sdk.typehierarchy.model.TypeHierarchy -import ch.epfl.bluebrain.nexus.delta.sourcing.model.ResourceRef -import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef +import ch.epfl.bluebrain.nexus.delta.sourcing.model.{ProjectRef, ResourceRef} package object sdk { @@ -69,6 +66,4 @@ package object sdk { */ type Resolve[A] = (ResourceRef, ProjectRef, Caller) => IO[Either[ResourceResolutionReport, A]] - type AkkaSource = Source[ByteString, Any] - } diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/directives/ResponseToJsonLdSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/directives/ResponseToJsonLdSpec.scala index 3d9969f082..ea9084769f 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/directives/ResponseToJsonLdSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/directives/ResponseToJsonLdSpec.scala @@ -8,6 +8,7 @@ import akka.http.scaladsl.server.RouteConcatenation import akka.stream.scaladsl.Source import akka.util.ByteString import cats.effect.IO +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.kernel.RdfMediaTypes.`application/ld+json` import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.{contexts, nxv} import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.RemoteContextResolution @@ -19,7 +20,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.marshalling.HttpResponseFields import ch.epfl.bluebrain.nexus.delta.sdk.resources.model.ResourceRejection import ch.epfl.bluebrain.nexus.delta.sdk.resources.model.ResourceRejection.ResourceNotFound import ch.epfl.bluebrain.nexus.delta.sdk.utils.RouteHelpers -import ch.epfl.bluebrain.nexus.delta.sdk.{AkkaSource, SimpleRejection, SimpleResource} +import ch.epfl.bluebrain.nexus.delta.sdk.{SimpleRejection, SimpleResource} import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/http/HttpClientSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/http/HttpClientSpec.scala index 295f75ef14..f4043395ba 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/http/HttpClientSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/http/HttpClientSpec.scala @@ -9,7 +9,7 @@ import akka.testkit.TestKit import akka.util.ByteString import cats.effect.IO import ch.epfl.bluebrain.nexus.delta.kernel.RetryStrategyConfig.OnceStrategyConfig -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.sdk.http.HttpClient.HttpSingleRequest import ch.epfl.bluebrain.nexus.delta.sdk.http.HttpClientError.{HttpClientStatusError, HttpSerializationError, HttpServerStatusError, HttpUnexpectedError} import ch.epfl.bluebrain.nexus.delta.sdk.http.HttpClientSpec.{Count, Value} diff --git a/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/files/FileWiring.scala b/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/files/FileWiring.scala index 7fde0100b2..9638a698ef 100644 --- a/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/files/FileWiring.scala +++ b/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/files/FileWiring.scala @@ -6,7 +6,7 @@ import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.{ComputedFileAt import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.{FormDataExtractor, UploadedFileInformation} import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.Storage import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.FileOperations -import ch.epfl.bluebrain.nexus.delta.sdk.AkkaSource +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource object FileWiring { diff --git a/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/storages/StorageWiring.scala b/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/storages/StorageWiring.scala index d433041840..a0ddec00d0 100644 --- a/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/storages/StorageWiring.scala +++ b/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/storages/StorageWiring.scala @@ -2,6 +2,7 @@ package ch.epfl.bluebrain.nexus.ship.storages import akka.http.scaladsl.model.Uri import cats.effect.IO +import ch.epfl.bluebrain.nexus.delta.kernel.AkkaSource import ch.epfl.bluebrain.nexus.delta.kernel.utils.UUIDF import ch.epfl.bluebrain.nexus.delta.plugins.storage.StorageScopeInitialization import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.FileStorageMetadata @@ -14,9 +15,9 @@ import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.Uploadi import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.s3.S3FileOperations import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.s3.client.S3StorageClient import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.JsonLdApi +import ch.epfl.bluebrain.nexus.delta.sdk.Defaults import ch.epfl.bluebrain.nexus.delta.sdk.projects.FetchContext import ch.epfl.bluebrain.nexus.delta.sdk.resolvers.ResolverContextResolution -import ch.epfl.bluebrain.nexus.delta.sdk.{AkkaSource, Defaults} import ch.epfl.bluebrain.nexus.delta.sourcing.Transactors import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import ch.epfl.bluebrain.nexus.ship.EventClock