packages feed

relay-pagination-servant-0.2.0.0: relay-pagination-servant.cabal

cabal-version: 3.0
name: relay-pagination-servant
version: 0.2.0.0
synopsis:
  RelayPage servant combinator for Relay-style cursor pagination

description:
  The RelayPage servant combinator: declares the four Relay pagination query
  parameters (first, after, last, before) on a route, validates them before
  the handler runs, and hands the handler one already-validated PageRequest.
  Ships HasServer, HasClient, and HasLink instances plus OpenAPI 3.1
  documentation support via openapi-hs and servant-openapi-hs.

license: BSD-3-Clause
license-file: LICENSE
author: Nadeem Bitar
maintainer: Nadeem Bitar
category: Web, Servant
build-type: Simple
extra-doc-files: CHANGELOG.md
extra-source-files: test/golden/*.json

source-repository head
  type: git
  location: https://github.com/shinzui/relay-pagination

common warnings
  ghc-options:
    -Wall
    -Wcompat
    -Widentities
    -Wincomplete-record-updates
    -Wincomplete-uni-patterns
    -Wredundant-constraints
    -Wunused-packages

common lang
  import: warnings
  default-language: GHC2024
  default-extensions:
    DeriveAnyClass
    DuplicateRecordFields
    OverloadedLabels
    OverloadedStrings

library
  import: lang
  hs-source-dirs: src
  exposed-modules:
    Relay.Pagination.Servant
    Relay.Pagination.Servant.OpenApi

  build-depends:
    aeson >=2.2 && <2.3,
    base >=4.21 && <5,
    http-api-data >=0.6 && <0.8,
    http-types >=0.12 && <0.13,
    lens >=5.3.3 && <5.4,
    openapi-hs >=5.0 && <5.1,
    relay-pagination ^>=0.2.0.0,
    servant >=0.20.3 && <0.21,
    servant-client-core >=0.20.3 && <0.21,
    servant-openapi-hs >=5.1 && <5.2,
    servant-server >=0.20.3 && <0.21,
    text >=2.0 && <2.2,
    wai >=3.2 && <3.3,

test-suite relay-pagination-servant-test
  import: lang
  type: exitcode-stdio-1.0
  hs-source-dirs:
    test
    demo

  main-is: Main.hs
  other-modules:
    CountedToyApi
    ToyApi
    ToyOpenApi

  -- warp requires the threaded RTS (its TimerManager will not start without it)
  ghc-options: -threaded
  build-depends:
    aeson,
    aeson-pretty >=0.8 && <0.9,
    base,
    bytestring >=0.11 && <0.13,
    http-api-data,
    http-client >=0.7 && <0.8,
    http-types,
    lens,
    openapi-hs,
    relay-pagination ^>=0.2.0.0,
    relay-pagination-servant,
    servant,
    servant-client >=0.20.3 && <0.21,
    servant-client-core,
    servant-openapi-hs,
    servant-server,
    sop-core >=0.5 && <0.6,
    tasty >=1.4 && <1.6,
    tasty-hunit >=0.10 && <0.11,
    text,
    wai,
    warp >=3.3 && <3.5,

executable relay-demo
  import: lang
  hs-source-dirs: demo
  main-is: Main.hs
  other-modules: ToyApi
  -- warp requires the threaded RTS (its TimerManager will not start without it)
  ghc-options: -threaded
  build-depends:
    aeson,
    base,
    openapi-hs,
    relay-pagination ^>=0.2.0.0,
    relay-pagination-servant,
    servant,
    servant-server,
    sop-core >=0.5 && <0.6,
    text,
    wai,
    warp >=3.3 && <3.5,

executable relay-demo-openapi
  import: lang
  hs-source-dirs: demo
  main-is: OpenApiMain.hs
  other-modules:
    CountedToyApi
    ToyApi
    ToyOpenApi

  build-depends:
    aeson,
    aeson-pretty >=0.8 && <0.9,
    base,
    bytestring >=0.11 && <0.13,
    lens,
    openapi-hs,
    relay-pagination ^>=0.2.0.0,
    relay-pagination-servant,
    servant,
    servant-openapi-hs,
    servant-server,
    sop-core >=0.5 && <0.6,
    text,
    wai,