cabal-version:       3.0
name:                postgres-websockets
version:             0.11.2.3
synopsis:            Middleware to map LISTEN/NOTIFY messages to Websockets
description:         WAI middleware that adds websockets capabilites on top of PostgreSQL's asynchronous notifications using LISTEN and NOTIFY commands. Fully functioning server included.
homepage:            https://github.com/diogob/postgres-websockets#readme
license:             BSD-3-Clause
license-file:        LICENSE
author:              Diogo Biazus
maintainer:          diogo@biazus.ca
copyright:           2016 Diogo Biazus
category:            Web, Database, PostgreSQL
build-type:          Simple
-- extra-source-files:

common warnings
    ghc-options: -Wall

common language
    default-language: Haskell2010
    default-extensions: OverloadedStrings, NoImplicitPrelude, LambdaCase, RecordWildCards, QuasiQuotes

library
  import:              warnings
  import:              language
  hs-source-dirs:      src
  exposed-modules:     PostgresWebsockets
                     , PostgresWebsockets.Broadcast
                     , PostgresWebsockets.HasqlBroadcast
                     , PostgresWebsockets.Claims
                     , PostgresWebsockets.Config

  autogen-modules:     Paths_postgres_websockets
  other-modules:       Paths_postgres_websockets
                     , PostgresWebsockets.Server
                     , PostgresWebsockets.Middleware
                     , PostgresWebsockets.Context
  build-depends:       base >= 4.7 && < 5
                     , aeson >= 2.0 && < 2.3
                     , alarmclock >= 0.7.0.2 && < 0.8
                     , auto-update >= 0.1.6 && < 0.3
                     , base64-bytestring >= 1.0.0.3 && < 1.3
                     , bytestring >= 0.11.5 && < 0.13
                     , either >= 5.0.1.1 && < 5.1
                     , envparse >= 0.5.0 && < 0.7
                     , hasql >= 1.7 && < 1.9
                     , hasql-notifications >= 0.2.3.0 && < 0.3
                     , hasql-pool ^>= 1.2
                     , http-types >= 0.12.3 && < 0.13
                     , jose >= 0.11 && < 0.12
                     , lens >= 5.2.3 && < 5.4
                     , postgresql-libpq >= 0.10.0 && < 0.12
                     , protolude >= 0.2.3 && < 0.4
                     , retry >= 0.8.1.0 && < 0.10
                     , stm >= 2.5.0.0 && < 2.6
                     , stm-containers >= 1.1.0.2 && < 1.3
                     , text >= 1.2 && < 2.2
                     , time >= 1.8.0.2 && < 1.13
                     , unordered-containers >= 0.2.19 && < 0.3
                     , wai >= 3.2 && < 4
                     , wai-app-static >= 3.1.7.1 && < 3.2
                     , wai-extra >= 3.0.29 && < 3.2
                     , wai-websockets >= 3.0 && < 4
                     , warp >= 3.2 && < 4
                     , warp-tls >= 3.2 && < 4
                     , websockets >= 0.9 && < 0.14

  default-language:    Haskell2010

executable postgres-websockets
  import:              warnings
  import:              language
  hs-source-dirs:      app
  main-is:             Main.hs
  other-modules:
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base >= 4.7 && < 5
                     , postgres-websockets
                     , protolude >= 0.2.3 && < 0.4
  default-language:    Haskell2010

test-suite postgres-websockets-test
  import:              warnings
  import:              language
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             Spec.hs
  other-modules:       BroadcastSpec
                     , ClaimsSpec
                     , HasqlBroadcastSpec
                     , ServerSpec
  build-depends:       base
                     , protolude >= 0.2.3 && < 0.4
                     , postgres-websockets
                     , hspec >= 2.7.1 && < 2.12
                     , aeson >= 2.0 && < 2.3
                     , hasql >= 1.7 && < 1.9
                     , hasql-pool ^>= 1.2
                     , hasql-notifications >= 0.2.3.0 && < 0.3
                     , http-types >= 0.9
                     , time >= 1.8.0.2 && < 1.13
                     , unordered-containers >= 0.2
                     , wai-extra >= 3.0.29 && < 3.2
                     , stm >= 2.5.0.0 && < 2.6
                     , websockets >= 0.12.7.0 && < 0.14
                     , network >= 2.8.0.1 && < 3.3
                     , lens >= 4.17.1 && < 5.4
                     , lens-aeson >= 1.0.0 && < 1.3
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  default-language:    Haskell2010

source-repository head
  type:     git
  location: https://github.com/diogob/postgres-websockets