Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Patch dependency updates #318

Merged
merged 11 commits into from
Jan 20, 2025
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ c09b8dba648055f0ee47a48ccd5bc203ddf8d424

# Scala Steward: Reformat with scalafmt 3.8.3
64daf9d365128e01beb81c3e578e0c998fc10165

# Scala Steward: Reformat with scalafmt 3.8.4
d62360db7af14a923a04f70bc44a175d2a560832
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.3"
version = "3.8.4"
runner.dialect = scala3
maxColumn = 120
align.preset = most
Expand Down
10 changes: 5 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ addCommandAlias("fmtCheck", "scalafmtCheck; Test / scalafmtCheck; integration/Te
addCommandAlias("headerCreateAll", "; all root/headerCreate Test/headerCreate; integration/Test/headerCreate")
addCommandAlias("headerCheckAll", "; all root/headerCheck Test/headerCheck; integration/Test/headerCheck")

val flywayVersion = "11.1.0"
val flywayVersion = "11.1.1"
val hikariVersion = "6.2.1"
val quillVersion = "4.8.6"
val sipiVersion = "v31.0.0"
val sqliteVersion = "3.47.2.0"
val tapirVersion = "1.11.10"
val tapirVersion = "1.11.12"
val testContainersVersion = "1.20.4"
val zioConfigVersion = "4.0.2"
val zioConfigVersion = "4.0.3"
val zioJsonVersion = "0.7.4"
val zioLoggingVersion = "2.4.0"
val zioMetricsConnectorsVersion = "2.3.1"
val zioMockVersion = "1.0.0-RC12"
val zioNioVersion = "2.0.2"
val zioPreludeVersion = "1.0.0-RC36"
val zioSchemaVersion = "1.5.0"
val zioVersion = "2.1.13"
val zioVersion = "2.1.14"

val gitCommit = ("git rev-parse HEAD" !!).trim
val gitVersion = ("git describe --tag --dirty --abbrev=7 --always " !!).trim
Expand Down Expand Up @@ -120,7 +120,7 @@ lazy val root = (project in file("."))
"dev.zio" %% "zio-metrics-connectors" % zioMetricsConnectorsVersion,
"dev.zio" %% "zio-metrics-connectors-prometheus" % zioMetricsConnectorsVersion,
"eu.timepit" %% "refined" % "0.11.3",
"com.softwaremill.sttp.client3" %% "zio" % "3.10.1",
"com.softwaremill.sttp.client3" %% "zio" % "3.10.2",

// csv for reports
"com.github.tototoshi" %% "scala-csv" % "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.10.6
sbt.version=1.10.7
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.11.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.2")
addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.3")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.3.0")
31 changes: 14 additions & 17 deletions src/main/scala/swiss/dasch/api/ProjectsEndpointsHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,23 @@ final case class ProjectsEndpointsHandler(
},
)

private val getProjectsAssetsInfoEndpoint: ZServerEndpoint[Any, Any] = projectEndpoints.getProjectsAssetsInfo
.serverLogic(userSession =>
(shortcode, assetId) => {
val ref = AssetRef(assetId, shortcode)
authorizationHandler.ensureProjectReadable(userSession, shortcode) *>
assetInfoService
.findByAssetRef(ref)
.some
.mapBoth(
assetRefNotFoundOrServerError(_, ref),
AssetInfoResponse.from,
)
},
)
private val getProjectsAssetsInfoEndpoint: ZServerEndpoint[Any, Any] =
projectEndpoints.getProjectsAssetsInfo.serverLogic { userSession => (shortcode, assetId) =>
val ref = AssetRef(assetId, shortcode)
authorizationHandler.ensureProjectReadable(userSession, shortcode) *>
assetInfoService
.findByAssetRef(ref)
.some
.mapBoth(
assetRefNotFoundOrServerError(_, ref),
AssetInfoResponse.from,
)
}

private val getProjectsAssetsOriginalEndpoint: ZServerEndpoint[Any, ZioStreams] =
projectEndpoints.getProjectsAssetsOriginal
.serverLogic(userSession =>
(shortcode, assetId) => {
(shortcode, assetId) =>
for {
ref <- ZIO.succeed(AssetRef(assetId, shortcode))
assetInfo <- assetInfoService.findByAssetRef(ref).some.mapError(assetRefNotFoundOrServerError(_, ref))
Expand All @@ -129,8 +127,7 @@ final case class ProjectsEndpointsHandler(
s"attachment; filename*=UTF-8''${filenameEncoded}", // Content-Disposition
assetInfo.metadata.originalMimeType.map(m => m.stringValue).getOrElse("application/octet-stream"),
ZStream.fromFile(assetInfo.original.file.toFile),
)
},
),
)

private val postProjectAssetEndpoint: ZServerEndpoint[Any, ZioStreams] = projectEndpoints.postProjectAsset
Expand Down
Loading