diff options
author | Colin Okay <okay@toyful.space> | 2022-02-21 15:20:22 -0600 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2022-02-21 15:20:22 -0600 |
commit | d7b1a2774dc1b8ab3c166c8dc0332110d653ebe9 (patch) | |
tree | 85b13478f4ff3477bd9693202268c86cf1d5288c /oneliners.api-client.lisp | |
parent | 14d7f7c425a04091e6982104f5c48d79bb528e89 (diff) |
tweaking cli menu.
Diffstat (limited to 'oneliners.api-client.lisp')
-rw-r--r-- | oneliners.api-client.lisp | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/oneliners.api-client.lisp b/oneliners.api-client.lisp index 2ae2c65..563d088 100644 --- a/oneliners.api-client.lisp +++ b/oneliners.api-client.lisp @@ -5,16 +5,16 @@ (defpackage #:ONELINERS.API-CLIENT (:use :cl :lazybones-client.shared) (:export #:*host* #:*body* #:*headers* #:*cookies* #:request-with - #:GET--ONELINERS - #:GET--ONELIERS - #:PUT--ONELINER-ENTRY-FLAG - #:PATCH--ONELINER-ENTRY-EDIT - #:PUT--ONELINER-ONELINER-LOCKED - #:POST--ONELINER - #:POST--INVITE - #:DELETE--ACCESS-CONTRIBUTOR - #:POST--ACCESS - #:POST--INVITE-REDEEM-CODE)) + #:GET--ONELINERS +#:GET--ONELIERS +#:PUT--ONELINER-ENTRY-FLAG +#:PATCH--ONELINER-ENTRY-EDIT +#:PUT--ONELINER-ONELINER-LOCKED +#:POST--ONELINER +#:POST--INVITE +#:DELETE--ACCESS-ACCESS +#:POST--ACCESS +#:POST--INVITE-REDEEM-CODE)) (in-package :ONELINERS.API-CLIENT) @@ -69,6 +69,32 @@ Entries. TAGS cannot be empty. Returns a [Search Result](#search-result) object." (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* + (FORMAT NIL "/oneliners") + (WHEN (OR TAGS LIMIT NOTFLAGGED) + (LIST "?" + (IF TAGS + (CONCATENATE 'STRING (SYMBOL-NAME 'TAGS) "=" + (FORMAT NIL "~a" TAGS)) + "") + (IF LIMIT + (CONCATENATE 'STRING "&" (SYMBOL-NAME 'LIMIT) "=" + (FORMAT NIL "~a" LIMIT)) + "") + (IF NOTFLAGGED + (CONCATENATE 'STRING "&" (SYMBOL-NAME 'NOTFLAGGED) + "=" (FORMAT NIL "~a" NOTFLAGGED)) + "")))))) + (DEXADOR:GET LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR + LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS + LAZYBONES-CLIENT.SHARED:*HEADERS*))) + + +(DEFUN GET--ONELIERS (&KEY TAGS LIMIT NOTFLAGGED) + "A search endpoint returning a JSON encoded array of Oneliner +Entries. TAGS cannot be empty. Returns a [Search +Result](#search-result) object." + (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING + (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* (FORMAT NIL "/oneliers") (WHEN (OR TAGS LIMIT NOTFLAGGED) (LIST "?" @@ -198,11 +224,11 @@ Result](#search-result) object." LAZYBONES-CLIENT.SHARED:*HEADERS*)))) -(DEFUN DELETE--ACCESS-CONTRIBUTOR (CONTRIBUTOR &KEY TOKEN) - NIL +(DEFUN DELETE--ACCESS-ACCESS (ACCESS &KEY TOKEN) + "Revoke access of CONTRIBUTOR" (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* - (FORMAT NIL "/access/~a" CONTRIBUTOR) + (FORMAT NIL "/access/~a" ACCESS) (WHEN (OR TOKEN) (LIST "?" (IF TOKEN |