aka_dude 6 months ago
parent 77b39ee5a0
commit 4e814a03fe
No known key found for this signature in database

@ -11,11 +11,12 @@ import Servant.Misskey.ActivityPub qualified as Misskey (ApShowResponse)
import Servant.Misskey.Common (
Authenticated (Authenticated),
Note,
Notification,
Notification (isRead),
UriRequest,
UserLite,
)
import Servant.Misskey.Notes qualified as Misskey (NotesTimelineRequest, defaultNotesTimelineRequest)
import Servant.Misskey.Notes (defaultNotesCreateRequest, renoteId, replyId, text)
import Servant.Misskey.Notes qualified as Misskey (NotesCreateRequest, NotesCreateResponse, NotesTimelineRequest, defaultNotesTimelineRequest)
import Servant.Misskey.Notes qualified as Notes (NotesTimelineRequest (limit))
import Servant.Misskey.Self qualified as Misskey (SelfNotificationsRequest, defaultSelfNotificationsRequest)
import Servant.Misskey.Self qualified as Self (SelfNotificationsRequest (limit))
@ -29,14 +30,14 @@ apShow :: Authenticated UriRequest -> ClientM Misskey.ApShowResponse
self :: Authenticated () -> ClientM UserLite
notifications :: Authenticated Misskey.SelfNotificationsRequest -> ClientM [Notification]
timeline :: Authenticated Misskey.NotesTimelineRequest -> ClientM [Note]
noteCreate :: Authenticated Misskey.NotesCreateRequest -> ClientM Misskey.NotesCreateResponse
usersShow :: Misskey.UsersShowRequest -> ClientM UserLite
(apGet :<|> apShow) :<|> (self :<|> notifications) :<|> timeline :<|> usersShow = client (Proxy @Misskey.Api)
(apGet :<|> apShow) :<|> (self :<|> notifications) :<|> (timeline :<|> noteCreate) :<|> usersShow = client (Proxy @Misskey.Api)
queries :: Text -> ClientM ()
queries token = do
print =<< self (a ())
print =<< notifications (a Misskey.defaultSelfNotificationsRequest {Self.limit = Just 10})
print =<< timeline (a Misskey.defaultNotesTimelineRequest {Notes.limit = Just 10})
print . filter (not . (.isRead)) =<< notifications (a Misskey.defaultSelfNotificationsRequest {Self.limit = Just 10})
where
a :: a -> Authenticated a
a = Authenticated token

@ -191,11 +191,11 @@
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"lastModified": 1678901627,
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
"type": "github"
},
"original": {
@ -206,15 +206,16 @@
},
"flake-utils_2": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"lastModified": 1679360468,
"narHash": "sha256-LGnza3cfXF10Biw3ZTg0u9o9t7s680Ww200t5KkHTh8=",
"owner": "hamishmack",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"rev": "e1ea268ff47ad475443dbabcd54744b4e5b9d4f5",
"type": "github"
},
"original": {
"owner": "numtide",
"owner": "hamishmack",
"ref": "hkm/nested-hydraJobs",
"repo": "flake-utils",
"type": "github"
}
@ -288,11 +289,11 @@
"hackage": {
"flake": false,
"locked": {
"lastModified": 1677284793,
"narHash": "sha256-4/W80Cv1uXvi9qM18CKi5OKumiw+p9FV04uKvW8gqXk=",
"lastModified": 1680222266,
"narHash": "sha256-jPHZPqFOSQATecOOCI4GZyHXofeHrTnno3ciV2mxqxE=",
"owner": "input-output-hk",
"repo": "hackage.nix",
"rev": "b82ebaa0234ec2176748e87044750758c4ac4cfb",
"rev": "b07cd4ef4e99bf7711aa9aef06fc6abe79b0126f",
"type": "github"
},
"original": {
@ -330,11 +331,11 @@
"tullia": "tullia"
},
"locked": {
"lastModified": 1677286287,
"narHash": "sha256-DUoduM2v8P+JcuPvAxnqvmHUk+I9r6rsEPUmtLyoE7w=",
"lastModified": 1680223850,
"narHash": "sha256-m6X3rEN33K02Lbt8cjlXZcoLgQGhmY5tb0I01DDvqzE=",
"owner": "input-output-hk",
"repo": "haskell.nix",
"rev": "fc8852afce751eaab557f218124546e7f2e53374",
"rev": "af82dc3e464f58f5cc90400200f703e197d52e84",
"type": "github"
},
"original": {
@ -797,11 +798,11 @@
"stackage": {
"flake": false,
"locked": {
"lastModified": 1677197430,
"narHash": "sha256-6B7i8OHDXhNAugIgyCR86xpvik8rY5yVEbZ1/lUq7tI=",
"lastModified": 1680221394,
"narHash": "sha256-NgDfE4E9ivTtUd8cwS+qwusbbGiqvm/esAg+u6TUXG4=",
"owner": "input-output-hk",
"repo": "stackage.nix",
"rev": "edbf9a66650560899643547ac7465aac0073395a",
"rev": "d4a0ed4f4d88f4e9eccb99aa71e7ec37c7587aa7",
"type": "github"
},
"original": {

@ -1,6 +1,6 @@
{pkgs, ...}: {
# name = "project-name";
compiler-nix-name = "ghc926"; # Version of GHC to use
compiler-nix-name = "ghc927"; # Version of GHC to use
# Cross compilation support:
# crossPlatforms = p: pkgs.lib.optionals pkgs.stdenv.hostPlatform.isx86_64 ([

@ -11,6 +11,7 @@ common c
BlockArguments
ConstraintKinds
DataKinds
DeriveAnyClass
DeriveFunctor
DeriveGeneric
DeriveTraversable
@ -31,6 +32,7 @@ common c
NoFieldSelectors
NumericUnderscores
OverloadedLists
OverloadedRecordDot
OverloadedStrings
ScopedTypeVariables
StandaloneDeriving

Loading…
Cancel
Save