aboutsummaryrefslogtreecommitdiff
path: root/oneliners.api-client.lisp
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-02-22 08:43:56 -0600
committerColin Okay <okay@toyful.space>2022-02-22 08:43:56 -0600
commit72d11288e24349b875171db6b116a3661f5bdbac (patch)
treefee71d290df2962e12ab09ecb6193d8491c6ecf7 /oneliners.api-client.lisp
parent81d8b86cad053a3bb1f4563cc4fa3b90e0302e15 (diff)
tweaking oneliner addition functions
Diffstat (limited to 'oneliners.api-client.lisp')
-rw-r--r--oneliners.api-client.lisp67
1 files changed, 20 insertions, 47 deletions
diff --git a/oneliners.api-client.lisp b/oneliners.api-client.lisp
index 19ca89f..b011457 100644
--- a/oneliners.api-client.lisp
+++ b/oneliners.api-client.lisp
@@ -5,9 +5,8 @@
(defpackage #:ONELINERS.API-CLIENT
(:use :cl :lazybones-client.shared)
(:export #:*host* #:*body* #:*headers* #:*cookies* #:request-with
- #:PUT--ONELINER-ENTRY-FLAG
-#:GET--ONELINERS
-#:GET--ONELIERS
+ #:GET--ONELINERS
+#:PUT--ONELINER-ENTRY-FLAG
#:PATCH--ONELINER-ENTRY-EDIT
#:PUT--ONELINER-ONELINER-LOCKED
#:POST--ONELINER
@@ -63,31 +62,6 @@ COOKIES should be an instance of CL-COOKIE:COOKIE-JAR. Defaults to
(dex:response-body ,http-error-var)))))))
-(DEFUN PUT--ONELINER-ENTRY-FLAG (ENTRY &KEY TOKEN VALUE)
- "Flag the oneliner for review."
- (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING
- (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST*
- (FORMAT NIL "/oneliner/~a/flag" ENTRY)
- (WHEN (OR TOKEN VALUE)
- (LIST "?"
- (IF TOKEN
- (CONCATENATE 'STRING (SYMBOL-NAME 'TOKEN) "="
- (FORMAT NIL "~a" TOKEN))
- "")
- (IF VALUE
- (CONCATENATE 'STRING "&" (SYMBOL-NAME 'VALUE) "="
- (FORMAT NIL "~a" VALUE))
- ""))))))
- (IF LAZYBONES-CLIENT.SHARED:*BODY*
- (DEXADOR:PUT LAZYBONES-CLIENT.SHARED::REQ-STRING :CONTENT
- LAZYBONES-CLIENT.SHARED:*BODY* :COOKIE-JAR
- LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS
- LAZYBONES-CLIENT.SHARED:*HEADERS*)
- (DEXADOR:PUT LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR
- LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS
- LAZYBONES-CLIENT.SHARED:*HEADERS*))))
-
-
(DEFUN GET--ONELINERS (&KEY TAGS LIMIT NOTFLAGGED)
"A search endpoint returning a JSON encoded array of Oneliner
Entries. TAGS cannot be empty. Returns a [Search
@@ -114,30 +88,29 @@ Result](#search-result) object."
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."
+(DEFUN PUT--ONELINER-ENTRY-FLAG (ENTRY &KEY TOKEN VALUE)
+ "Flag the oneliner for review."
(LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING
(APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST*
- (FORMAT NIL "/oneliers")
- (WHEN (OR TAGS LIMIT NOTFLAGGED)
+ (FORMAT NIL "/oneliner/~a/flag" ENTRY)
+ (WHEN (OR TOKEN VALUE)
(LIST "?"
- (IF TAGS
- (CONCATENATE 'STRING (SYMBOL-NAME 'TAGS) "="
- (FORMAT NIL "~a" TAGS))
- "")
- (IF LIMIT
- (CONCATENATE 'STRING "&" (SYMBOL-NAME 'LIMIT) "="
- (FORMAT NIL "~a" LIMIT))
+ (IF TOKEN
+ (CONCATENATE 'STRING (SYMBOL-NAME 'TOKEN) "="
+ (FORMAT NIL "~a" TOKEN))
"")
- (IF NOTFLAGGED
- (CONCATENATE 'STRING "&" (SYMBOL-NAME 'NOTFLAGGED)
- "=" (FORMAT NIL "~a" NOTFLAGGED))
+ (IF VALUE
+ (CONCATENATE 'STRING "&" (SYMBOL-NAME 'VALUE) "="
+ (FORMAT NIL "~a" VALUE))
""))))))
- (DEXADOR:GET LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR
- LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS
- LAZYBONES-CLIENT.SHARED:*HEADERS*)))
+ (IF LAZYBONES-CLIENT.SHARED:*BODY*
+ (DEXADOR:PUT LAZYBONES-CLIENT.SHARED::REQ-STRING :CONTENT
+ LAZYBONES-CLIENT.SHARED:*BODY* :COOKIE-JAR
+ LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS
+ LAZYBONES-CLIENT.SHARED:*HEADERS*)
+ (DEXADOR:PUT LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR
+ LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS
+ LAZYBONES-CLIENT.SHARED:*HEADERS*))))
(DEFUN PATCH--ONELINER-ENTRY-EDIT (ENTRY &KEY TOKEN)