aboutsummaryrefslogtreecommitdiff
path: root/oneliners.api-client.lisp
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-02-21 15:54:54 -0600
committerColin Okay <okay@toyful.space>2022-02-21 15:54:54 -0600
commit2dd1e60e52cb7871467b1aade5c74c6bdd21b3aa (patch)
tree59988020f5e683ee07a19f92279f6e25c3a47b52 /oneliners.api-client.lisp
parentd7b1a2774dc1b8ab3c166c8dc0332110d653ebe9 (diff)
added flagging and locking commands
Diffstat (limited to 'oneliners.api-client.lisp')
-rw-r--r--oneliners.api-client.lisp50
1 files changed, 27 insertions, 23 deletions
diff --git a/oneliners.api-client.lisp b/oneliners.api-client.lisp
index 563d088..19ca89f 100644
--- a/oneliners.api-client.lisp
+++ b/oneliners.api-client.lisp
@@ -5,9 +5,9 @@
(defpackage #:ONELINERS.API-CLIENT
(:use :cl :lazybones-client.shared)
(:export #:*host* #:*body* #:*headers* #:*cookies* #:request-with
- #:GET--ONELINERS
+ #:PUT--ONELINER-ENTRY-FLAG
+#:GET--ONELINERS
#:GET--ONELIERS
-#:PUT--ONELINER-ENTRY-FLAG
#:PATCH--ONELINER-ENTRY-EDIT
#:PUT--ONELINER-ONELINER-LOCKED
#:POST--ONELINER
@@ -63,6 +63,31 @@ 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
@@ -115,27 +140,6 @@ Result](#search-result) object."
LAZYBONES-CLIENT.SHARED:*HEADERS*)))
-(DEFUN PUT--ONELINER-ENTRY-FLAG (ENTRY &KEY TOKEN)
- "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)
- (LIST "?"
- (IF TOKEN
- (CONCATENATE 'STRING (SYMBOL-NAME 'TOKEN) "="
- (FORMAT NIL "~a" TOKEN))
- ""))))))
- (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)
"Edit the fields of a oneliner."
(LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING