Skip to content

Commit 46a1701

Browse files
committed
bump endpoints to 0.10.0; bump library version to 0.10.0 too
1 parent 11856dd commit 46a1701

File tree

26 files changed

+58
-38
lines changed

26 files changed

+58
-38
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Request/HttpModule3.elm
4343
To get started, first add project dependency to your `build.sbt`:
4444

4545
```scala
46-
libraryDependencies += "io.scalaland" %% "endpoints-elm" % "0.9.2"
46+
libraryDependencies += "io.scalaland" %% "endpoints-elm" % "0.10.0"
4747
```
4848

4949
##### Endpoints definition
@@ -179,7 +179,7 @@ Module with urls contains one function that constructs url string for each endpo
179179

180180
```elm
181181
{-
182-
This file was generated by endpoints-elm 0.9.2 interpreter.
182+
This file was generated by endpoints-elm 0.10.0 interpreter.
183183
Do not edit this file manually.
184184
185185
See https://github.com/scalalandio/endpoints-elm for more information.
@@ -214,7 +214,7 @@ a function that returns `HttpBuilder.Task.RequestBuilder`.
214214

215215
```elm
216216
{-
217-
This file was generated by endpoints-elm 0.9.2 interpreter.
217+
This file was generated by endpoints-elm 0.10.0 interpreter.
218218
Do not edit this file manually.
219219
220220
See https://github.com/scalalandio/endpoints-elm for more information.

build.sbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "endpoints-elm"
22

3-
version := "0.9.2"
3+
version := "0.10.0"
44

55
organization := "io.scalaland"
66

@@ -13,15 +13,15 @@ buildInfoKeys := Seq[BuildInfoKey](version)
1313
buildInfoPackage := "io.scalaland.endpoints.elm"
1414

1515
val versions = new {
16-
val endpoints = "0.9.0"
17-
val utest = "0.6.7"
16+
val endpoints = "0.10.0"
17+
val utest = "0.7.1"
1818
}
1919

2020
libraryDependencies ++= Seq(
2121
"org.julienrf" %% "endpoints-algebra" % versions.endpoints % "provided",
2222
"org.julienrf" %% "endpoints-algebra-json-schema" % versions.endpoints % "provided",
2323
"com.lihaoyi" %% "utest" % versions.utest % "test",
24-
"io.scalaland" %% "endpoints-json-schema-macros" % "0.9.0" % "test"
24+
"io.scalaland" %% "endpoints-json-schema-macros" % "0.10.0" % "test"
2525
)
2626

2727
testFrameworks += new TestFramework("utest.runner.Framework")

src/main/scala/io/scalaland/endpoints/elm/JsonSchemas.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ trait JsonSchemas extends algebra.JsonSchemas {
6666

6767
implicit def booleanJsonSchema: ElmType = BasicType.Bool
6868

69+
implicit def byteJsonSchema: ElmType = BasicType.Int
70+
6971
implicit def arrayJsonSchema[C[X] <: scala.Seq[X], A](implicit jsonSchema: JsonSchema[A],
7072
factory: Factory[A, C[A]]): JsonSchema[C[A]] =
7173
AppliedType.List(jsonSchema)

src/main/scala/io/scalaland/endpoints/elm/Responses.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import endpoints.algebra
44
import endpoints.algebra.Documentation
55
import io.scalaland.endpoints.elm.model._
66

7-
trait Responses extends algebra.Responses {
7+
trait Responses extends algebra.Responses with StatusCodes {
88

99
type Response[A] = EncodedType
1010

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package io.scalaland.endpoints.elm
2+
3+
import endpoints.algebra
4+
5+
trait StatusCodes extends algebra.StatusCodes {
6+
7+
type StatusCode = Unit
8+
9+
def OK: Unit = ()
10+
def BadRequest: Unit = ()
11+
def Unauthorized: Unit = ()
12+
def NotFound: Unit = ()
13+
}

src/main/scala/io/scalaland/endpoints/elm/Urls.scala

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package io.scalaland.endpoints.elm
22

33
import endpoints.algebra.Documentation
4-
import endpoints.{InvariantFunctor, Tupler, algebra}
4+
import endpoints.{InvariantFunctor, PartialInvariantFunctor, Tupler, algebra}
55
import io.scalaland.endpoints.elm.model._
6-
import scala.collection.compat.Factory
76

7+
import scala.collection.compat.Factory
88
import language.higherKinds
99

1010
trait Urls extends algebra.Urls {
@@ -25,12 +25,6 @@ trait Urls extends algebra.Urls {
2525
factory: Factory[A, CC[A]]): QueryStringParam[CC[A]] =
2626
AppliedType.List(tpe)
2727

28-
def refineQueryStringParam[A, B](pa: QueryStringParam[A])(f: A => Option[B])(g: B => A): QueryStringParam[B] =
29-
pa
30-
31-
def refineSegment[A, B](sa: Segment[A])(f: A => Option[B])(g: B => A): Segment[B] =
32-
sa
33-
3428
type QueryStringParam[A] = ElmType
3529

3630
override implicit def uuidQueryString: QueryStringParam[String] = BasicType.Uuid
@@ -51,9 +45,9 @@ trait Urls extends algebra.Urls {
5145

5246
implicit def stringSegment: Segment[String] = BasicType.String
5347

54-
implicit def intSegment: Segment[Int] = BasicType.Int
48+
override implicit def intSegment: Segment[Int] = BasicType.Int
5549

56-
implicit def longSegment: Segment[Long] = BasicType.Int
50+
override implicit def longSegment: Segment[Long] = BasicType.Int
5751

5852
type Path[A] = ElmUrl
5953
type Url[A] = ElmUrl
@@ -74,4 +68,15 @@ trait Urls extends algebra.Urls {
7468
def urlWithQueryString[A, B](path: Path[A], qs: QueryString[B])(implicit tupler: Tupler[A, B]): Url[tupler.Out] =
7569
path.copy(queryParams = qs)
7670

71+
implicit def queryStringPartialInvFunctor: PartialInvariantFunctor[QueryString] = null
72+
73+
implicit def queryStringParamPartialInvFunctor: PartialInvariantFunctor[QueryStringParam] = null
74+
75+
implicit def segmentPartialInvFunctor: PartialInvariantFunctor[Segment] = null
76+
77+
implicit def pathPartialInvariantFunctor: PartialInvariantFunctor[Path] = null
78+
79+
def remainingSegments(name: String, docs: Documentation): ElmUrl = null
80+
81+
implicit def urlPartialInvFunctor: PartialInvariantFunctor[Url] = null
7782
}

src/test/resources/counter-test/Data/Counter.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{-
2-
This file was generated by endpoints-elm 0.9.2 interpreter.
2+
This file was generated by endpoints-elm 0.10.0 interpreter.
33
Do not edit this file manually.
44
55
See https://github.com/scalalandio/endpoints-elm for more information.

src/test/resources/counter-test/Data/Increment.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{-
2-
This file was generated by endpoints-elm 0.9.2 interpreter.
2+
This file was generated by endpoints-elm 0.10.0 interpreter.
33
Do not edit this file manually.
44
55
See https://github.com/scalalandio/endpoints-elm for more information.

src/test/resources/counter-test/Request/Counter.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{-
2-
This file was generated by endpoints-elm 0.9.2 interpreter.
2+
This file was generated by endpoints-elm 0.10.0 interpreter.
33
Do not edit this file manually.
44
55
See https://github.com/scalalandio/endpoints-elm for more information.

src/test/resources/counter-test/Request/Url/Counter.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{-
2-
This file was generated by endpoints-elm 0.9.2 interpreter.
2+
This file was generated by endpoints-elm 0.10.0 interpreter.
33
Do not edit this file manually.
44
55
See https://github.com/scalalandio/endpoints-elm for more information.

0 commit comments

Comments
 (0)