From e1febfb24a95dcab9d0e270fc539e81553f5236f Mon Sep 17 00:00:00 2001 From: Eric Meisel Date: Fri, 1 Dec 2023 15:08:57 -0600 Subject: [PATCH 1/4] Deprecate KinesisStreamEvent --- .../main/scala/feral/lambda/events/KinesisStreamEvent.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lambda/shared/src/main/scala/feral/lambda/events/KinesisStreamEvent.scala b/lambda/shared/src/main/scala/feral/lambda/events/KinesisStreamEvent.scala index cca402a4..b80b8063 100644 --- a/lambda/shared/src/main/scala/feral/lambda/events/KinesisStreamEvent.scala +++ b/lambda/shared/src/main/scala/feral/lambda/events/KinesisStreamEvent.scala @@ -133,6 +133,9 @@ sealed abstract class KinesisStreamEvent { def records: List[KinesisStreamRecord] } +@deprecated( + "Moved to kinesis4cats. See https://etspaceman.github.io/kinesis4cats/feral/getting-started.html.", + since = "0.3.0") object KinesisStreamEvent { def apply(records: List[KinesisStreamRecord]): KinesisStreamEvent = new Impl(records) From 79ae80414d57fdd94d216c7f570e237f456392a1 Mon Sep 17 00:00:00 2001 From: Eric Meisel Date: Fri, 1 Dec 2023 15:19:23 -0600 Subject: [PATCH 2/4] Deprecate more --- examples/src/main/scala/feral/examples/KinesisLambda.scala | 6 +++--- lambda/shared/src/main/scala-2/feral/lambda/package.scala | 3 +++ .../main/scala/feral/lambda/events/KinesisStreamEvent.scala | 3 +++ .../scala/feral/lambda/events/KinesisStreamEventSuite.scala | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/src/main/scala/feral/examples/KinesisLambda.scala b/examples/src/main/scala/feral/examples/KinesisLambda.scala index 00abe7d7..c3e707c5 100644 --- a/examples/src/main/scala/feral/examples/KinesisLambda.scala +++ b/examples/src/main/scala/feral/examples/KinesisLambda.scala @@ -19,10 +19,10 @@ package feral.examples import cats.effect._ import cats.effect.std.Random import feral.lambda._ -import feral.lambda.events.KinesisStreamEvent import natchez.Trace import natchez.xray.XRay import skunk.Session +import feral.lambda.events.SqsEvent /** * On Scala.js, implement your Lambda as an `object`. This will be the name your JavaScript @@ -38,7 +38,7 @@ import skunk.Session * * For a more advanced example, see the `Http4sLambda` next. */ -object kinesisHandler extends IOLambda.Simple[KinesisStreamEvent, INothing] { +object sqsHandler extends IOLambda.Simple[SqsEvent, INothing] { /** * Optional initialization section. This is a resource that will be acquired exactly once when @@ -66,7 +66,7 @@ object kinesisHandler extends IOLambda.Simple[KinesisStreamEvent, INothing] { * @param init * in this example, the skunk session we setup above */ - def apply(event: KinesisStreamEvent, context: Context[IO], init: Init) = + def apply(event: SqsEvent, context: Context[IO], init: Init) = IO.println(s"Received event with ${event.records.size} records").as(None) } diff --git a/lambda/shared/src/main/scala-2/feral/lambda/package.scala b/lambda/shared/src/main/scala-2/feral/lambda/package.scala index 0d1274bf..ab3e0849 100644 --- a/lambda/shared/src/main/scala-2/feral/lambda/package.scala +++ b/lambda/shared/src/main/scala-2/feral/lambda/package.scala @@ -45,6 +45,9 @@ package object lambda { type ApiGatewayProxyInvocation[F[_]] = Invocation[F, ApiGatewayProxyEventV2] type DynamoDbStreamInvocation[F[_]] = Invocation[F, DynamoDbStreamEvent] + @deprecated( + "Moved to kinesis4cats. See https://etspaceman.github.io/kinesis4cats/feral/getting-started.html.", + since = "0.3.0") type KinesisStreamInvocation[F[_]] = Invocation[F, KinesisStreamEvent] type S3BatchInvocation[F[_]] = Invocation[F, S3BatchEvent] type SnsInvocation[F[_]] = Invocation[F, SnsEvent] diff --git a/lambda/shared/src/main/scala/feral/lambda/events/KinesisStreamEvent.scala b/lambda/shared/src/main/scala/feral/lambda/events/KinesisStreamEvent.scala index b80b8063..bbd23757 100644 --- a/lambda/shared/src/main/scala/feral/lambda/events/KinesisStreamEvent.scala +++ b/lambda/shared/src/main/scala/feral/lambda/events/KinesisStreamEvent.scala @@ -129,6 +129,9 @@ object KinesisStreamRecord { } } +@deprecated( + "Moved to kinesis4cats. See https://etspaceman.github.io/kinesis4cats/feral/getting-started.html.", + since = "0.3.0") sealed abstract class KinesisStreamEvent { def records: List[KinesisStreamRecord] } diff --git a/lambda/shared/src/test/scala/feral/lambda/events/KinesisStreamEventSuite.scala b/lambda/shared/src/test/scala/feral/lambda/events/KinesisStreamEventSuite.scala index 37186a5a..a57ba1d4 100644 --- a/lambda/shared/src/test/scala/feral/lambda/events/KinesisStreamEventSuite.scala +++ b/lambda/shared/src/test/scala/feral/lambda/events/KinesisStreamEventSuite.scala @@ -19,6 +19,9 @@ package feral.lambda.events import io.circe.literal._ import munit.FunSuite +@deprecated( + "Moved to kinesis4cats. See https://etspaceman.github.io/kinesis4cats/feral/getting-started.html.", + since = "0.3.0") class KinesisStreamEventSuite extends FunSuite { test("decoder") { From bc17b11d76161f47dad6ea6c404069981dc8762c Mon Sep 17 00:00:00 2001 From: Eric Meisel Date: Fri, 1 Dec 2023 15:42:25 -0600 Subject: [PATCH 3/4] scalafix --- examples/src/main/scala/feral/examples/KinesisLambda.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/src/main/scala/feral/examples/KinesisLambda.scala b/examples/src/main/scala/feral/examples/KinesisLambda.scala index c3e707c5..5b9decac 100644 --- a/examples/src/main/scala/feral/examples/KinesisLambda.scala +++ b/examples/src/main/scala/feral/examples/KinesisLambda.scala @@ -19,10 +19,10 @@ package feral.examples import cats.effect._ import cats.effect.std.Random import feral.lambda._ +import feral.lambda.events.SqsEvent import natchez.Trace import natchez.xray.XRay import skunk.Session -import feral.lambda.events.SqsEvent /** * On Scala.js, implement your Lambda as an `object`. This will be the name your JavaScript From 6554db5789353c233bb6cf39e17967f1acda3cad Mon Sep 17 00:00:00 2001 From: Eric Meisel Date: Fri, 1 Dec 2023 15:46:52 -0600 Subject: [PATCH 4/4] 1 more deprecation --- lambda/shared/src/main/scala-3/feral/lambda/invocations.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lambda/shared/src/main/scala-3/feral/lambda/invocations.scala b/lambda/shared/src/main/scala-3/feral/lambda/invocations.scala index 6dc97ce7..ecaf6602 100644 --- a/lambda/shared/src/main/scala-3/feral/lambda/invocations.scala +++ b/lambda/shared/src/main/scala-3/feral/lambda/invocations.scala @@ -25,6 +25,9 @@ val LambdaEnv = Invocation type ApiGatewayProxyInvocation[F[_]] = Invocation[F, ApiGatewayProxyEventV2] type DynamoDbStreamInvocation[F[_]] = Invocation[F, DynamoDbStreamEvent] +@deprecated( + "Moved to kinesis4cats. See https://etspaceman.github.io/kinesis4cats/feral/getting-started.html.", + since = "0.3.0") type KinesisStreamInvocation[F[_]] = Invocation[F, KinesisStreamEvent] type S3BatchInvocation[F[_]] = Invocation[F, S3BatchEvent] type SnsInvocation[F[_]] = Invocation[F, SnsEvent]