aboutsummaryrefslogtreecommitdiff
path: root/oneliners.api-client.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'oneliners.api-client.lisp')
-rw-r--r--oneliners.api-client.lisp52
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