Did you know ... | Search Documentation: |
![]() | Pack sourcehut -- README.md |

SWI-Prolog pack
implementing a SourceHut GraphQL API client.
Clone this repository and cd
into the root directory:
$ git clone https://git.sr.ht/~eshel/sourcehut.pl $ cd sourcehut.pl
Run pack_install/1 from the root of the repository:
?- pack_install(.).
If you don't already have one, you can generate a new OAuth2 token here https://meta.sr.ht/oauth2
The token can be passed to predicates of this library via the
token(+Token)
option on a per call basis, otherwise define the
multifile predicate sourcehut_token/2 to relate the token by default
to a certain SourceHut instance.
?- sourcehut_git_repository("eshel", "sourcehut.pl", _Repo, []), print_term(_Repo, []). _{ 'HEAD':_{ name:"refs/heads/main", target:"4f482c45d418fc5b2dbef84279b7bebfc5726dd7" }, created:"2022-06-04T13:40:01.424243Z", description:"SWI-Prolog package implementing a SourceHut GraphQL API client.", id:130804, name:"sourcehut.pl", updated:"2022-06-05T09:27:23.376706Z", visibility:"PUBLIC" } true.
?- sourcehut_git_upload_artifact(Repo.id, "v0.1.2", "/tmp/foo/baz.txt", Artifact, []). Artifact = _{checksum:"...", created:"2022-06-06T08:16:08.044836Z", filename:"baz.txt", id:2644, size:7}. ?- sourcehut_git_delete_artifact(2644, []). true.
For questions, requests, patches, please write to ~eshel/dev@lists.sr.ht specifying the name of this repository in mail subject, e.g. `[PATCH sourcehut.pl] fix it`.