diff --git a/build.sbt b/build.sbt index 53f52902..98813ba6 100755 --- a/build.sbt +++ b/build.sbt @@ -36,7 +36,7 @@ val zioHttpVersion = "1.0.0.0-RC17" val zioJson = "0.1.5" val zioMagicVersion = "0.3.8" val zioPreludeVersion = "1.0.0-RC7" -val sttpVersion = "2.2.9" +val sttpVersion = "3.3.15" lazy val root = project @@ -49,13 +49,13 @@ lazy val zioWebhooks = module("zio-webhooks", "webhooks") .settings(buildInfoSettings("zio.webhooks")) .settings( libraryDependencies ++= Seq( - "dev.zio" %% "zio" % zioVersion, - "dev.zio" %% "zio-json" % zioJson, - "dev.zio" %% "zio-prelude" % zioPreludeVersion, - "dev.zio" %% "zio-streams" % zioVersion, - "dev.zio" %% "zio-test" % zioVersion, - "com.softwaremill.sttp.client" %% "core" % sttpVersion, - "com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % sttpVersion + "dev.zio" %% "zio" % zioVersion, + "dev.zio" %% "zio-json" % zioJson, + "dev.zio" %% "zio-prelude" % zioPreludeVersion, + "dev.zio" %% "zio-streams" % zioVersion, + "dev.zio" %% "zio-test" % zioVersion, + "com.softwaremill.sttp.client3" %% "core" % sttpVersion, + "com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % sttpVersion ) ) .settings( diff --git a/webhooks/src/main/scala/zio/webhooks/backends/sttp/WebhookSttpClient.scala b/webhooks/src/main/scala/zio/webhooks/backends/sttp/WebhookSttpClient.scala index d27c21fd..48f104cc 100644 --- a/webhooks/src/main/scala/zio/webhooks/backends/sttp/WebhookSttpClient.scala +++ b/webhooks/src/main/scala/zio/webhooks/backends/sttp/WebhookSttpClient.scala @@ -1,7 +1,7 @@ package zio.webhooks.backends.sttp -import _root_.sttp.client.asynchttpclient.zio.AsyncHttpClientZioBackend -import _root_.sttp.client._ +import _root_.sttp.client3.asynchttpclient.zio.{ AsyncHttpClientZioBackend, SttpClient } +import _root_.sttp.client3._ import sttp.model.Uri import zio._ import zio.webhooks.WebhookError.BadWebhookUrlError @@ -14,7 +14,7 @@ import java.io.IOException * A [[WebhookSttpClient]] provides a [[WebhookHttpClient]] using sttp's ZIO backend, i.e. * `AsyncHttpClientZioBackend`. */ -final case class WebhookSttpClient(sttpClient: SttpClient, permits: Semaphore) extends WebhookHttpClient { +final case class WebhookSttpClient(sttpClient: SttpClient.Service, permits: Semaphore) extends WebhookHttpClient { def post(webhookRequest: WebhookHttpRequest): IO[HttpPostError, WebhookHttpResponse] = permits.withPermit { diff --git a/webhooks/src/main/scala/zio/webhooks/backends/sttp/package.scala b/webhooks/src/main/scala/zio/webhooks/backends/sttp/package.scala deleted file mode 100644 index e649fd80..00000000 --- a/webhooks/src/main/scala/zio/webhooks/backends/sttp/package.scala +++ /dev/null @@ -1,16 +0,0 @@ -package zio.webhooks.backends - -import _root_.sttp.client.SttpBackend -import _root_.sttp.client.asynchttpclient.WebSocketHandler -import zio._ -import zio.stream.Stream - -package object sttp { - - /** - * An [[SttpClient]] is an `SttpBackend` for ZIO. - * - * Taken from https://sttp.softwaremill.com/en/v2/backends/zio.html - */ - type SttpClient = SttpBackend[Task, Stream[Throwable, Byte], WebSocketHandler] -}