diff options
-rw-r--r-- | clpmfile | 1 | ||||
-rw-r--r-- | clpmfile.lock | 81 | ||||
-rw-r--r-- | oneliners.api-client.asd | 3 | ||||
-rw-r--r-- | oneliners.api-client.lisp | 243 |
4 files changed, 8 insertions, 320 deletions
@@ -4,7 +4,6 @@ (:source "quicklisp" :url "https://beta.quicklisp.org/dist/quicklisp.txt" :type :quicklisp) (:asd "oneliners.api.asd") -(:asd "oneliners.api-client.asd") (:github "lazybones" :path "cbeo/lazybones" diff --git a/clpmfile.lock b/clpmfile.lock index 2173387..f3d7048 100644 --- a/clpmfile.lock +++ b/clpmfile.lock @@ -9,7 +9,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; :sources -(:implicit-file :type :file-system :system-files ("oneliners.api-client.asd")) (:implicit-file :type :file-system :system-files ("oneliners.api.asd")) (:implicit-vcs :type :vcs :projects (("lazybones-client" :github :path "cbeo/lazybones-client"))) @@ -29,7 +28,6 @@ (:project :name "lazybones-client" :branch "main" :source :implicit-vcs) (:project :name "lambda-riffs" :branch "master" :source :implicit-vcs) (:project :name "lazybones" :branch "master" :source :implicit-vcs) -(:asd-file :name "oneliners.api-client.asd") (:asd-file :name "oneliners.api.asd") @@ -46,14 +44,12 @@ ("bordeaux-threads")) ("cffi" :version "2021-04-11" :source "quicklisp" :systems ("cffi" "cffi-grovel" "cffi-toolchain")) -("chipz" :version "2022-02-20" :source "quicklisp" :systems ("chipz")) ("chunga" :version "2020-04-27" :source "quicklisp" :systems ("chunga")) ("cl+ssl" :version "2022-02-20" :source "quicklisp" :systems ("cl+ssl")) ("cl-annot" :version "2015-06-08" :source "quicklisp" :systems ("cl-annot")) ("cl-base64" :version "2020-10-16" :source "quicklisp" :systems ("cl-base64")) ("cl-change-case" :version "2021-04-11" :source "quicklisp" :systems ("cl-change-case")) -("cl-cookie" :version "2019-10-07" :source "quicklisp" :systems ("cl-cookie")) ("cl-fad" :version "2022-02-20" :source "quicklisp" :systems ("cl-fad")) ("cl-interpol" :version "2020-12-20" :source "quicklisp" :systems ("cl-interpol")) @@ -63,12 +59,8 @@ ("cl-syntax" :version "2015-04-07" :source "quicklisp" :systems ("cl-syntax" "cl-syntax-annot")) ("cl-unicode" :version "2021-02-28" :source "quicklisp" :systems ("cl-unicode")) -("cl-utilities" :version "2010-10-07" :source "quicklisp" :systems - ("cl-utilities")) ("closer-mop" :version "2022-02-20" :source "quicklisp" :systems ("closer-mop")) -("dexador" :version "2022-02-20" :source "quicklisp" :systems ("dexador")) ("dissect" :version "2021-05-31" :source "quicklisp" :systems ("dissect")) -("fast-http" :version "2019-10-07" :source "quicklisp" :systems ("fast-http")) ("fast-io" :version "2020-09-25" :source "quicklisp" :systems ("fast-io")) ("flexi-streams" :version "2022-02-20" :source "quicklisp" :systems ("flexi-streams")) @@ -85,20 +77,14 @@ :systems ("lazybones-client")) ("lisp-namespace" :version "2021-10-21" :source "quicklisp" :systems ("lisp-namespace")) -("local-time" :version "2021-01-24" :source "quicklisp" :systems ("local-time")) ("md5" :version "2021-06-30" :source "quicklisp" :systems ("md5")) ("named-readtables" :version "2022-02-20" :source "quicklisp" :systems ("named-readtables")) -("oneliners.api-client.asd" :version :newest :source :implicit-file :systems - ("oneliners.api-client")) ("oneliners.api.asd" :version :newest :source :implicit-file :systems ("oneliners.api" "oneliners.api/tests")) ("proc-parse" :version "2019-08-13" :source "quicklisp" :systems ("proc-parse")) -("quri" :version "2021-06-30" :source "quicklisp" :systems ("quri")) ("rfc2388" :version "2018-08-31" :source "quicklisp" :systems ("rfc2388")) ("rove" :version "2022-02-20" :source "quicklisp" :systems ("rove")) -("smart-buffer" :version "2021-10-21" :source "quicklisp" :systems - ("smart-buffer")) ("split-sequence" :version "2021-05-31" :source "quicklisp" :systems ("split-sequence")) ("static-vectors" :version "2021-06-30" :source "quicklisp" :systems @@ -113,8 +99,6 @@ ("trivial-garbage")) ("trivial-gray-streams" :version "2021-01-24" :source "quicklisp" :systems ("trivial-gray-streams")) -("trivial-mimes" :version "2020-07-15" :source "quicklisp" :systems - ("trivial-mimes")) ("trivial-types" :version "2012-04-07" :source "quicklisp" :systems ("trivial-types")) ("trivial-utf-8" :version "2022-02-20" :source "quicklisp" :systems @@ -122,7 +106,6 @@ ("unit-test" :version "2012-05-20" :source "quicklisp" :systems ("unit-test")) ("usocket" :version "2019-12-27" :source "quicklisp" :systems ("usocket")) ("uuid" :version "2020-07-15" :source "quicklisp" :systems ("uuid")) -("xsubseq" :version "2017-08-30" :source "quicklisp" :systems ("xsubseq")) ("yason" :version "2022-02-20" :source "quicklisp" :systems ("yason")) @@ -133,16 +116,12 @@ :reverse-dependencies ("alexandria" ((:system :name "yason") (:system :name "alexandria")) ((:system :name "static-vectors") (:system :name "alexandria")) - ((:system :name "quri") (:system :name "alexandria")) ((:system :name "proc-parse") (:system :name "alexandria")) ((:system :name "lisp-namespace") (:system :name "alexandria")) ((:system :name "lazybones") (:system :name "alexandria")) ((:system :name "hunchentoot") (:system :name "alexandria")) ((:system :name "fast-io") (:system :name "alexandria")) - ((:system :name "fast-http") (:system :name "alexandria")) - ((:system :name "dexador") (:system :name "alexandria")) ((:system :name "cl-fad") (:system :name "alexandria")) - ((:system :name "cl-cookie") (:system :name "alexandria")) ((:system :name "cl-annot") (:system :name "alexandria")) ((:system :name "cl+ssl") (:system :name "alexandria")) ((:system :name "cffi-grovel") (:system :name "alexandria")) @@ -152,11 +131,8 @@ ((:system :name "bknr.datastore") (:system :name "alexandria")) ((:system :name "babel") (:system :name "alexandria"))) -("babel" ((:system :name "quri") (:system :name "babel")) - ((:system :name "proc-parse") (:system :name "babel")) +("babel" ((:system :name "proc-parse") (:system :name "babel")) ((:system :name "jonathan") (:system :name "babel")) - ((:system :name "fast-http") (:system :name "babel")) - ((:system :name "dexador") (:system :name "babel")) ((:system :name "cffi") (:system :name "babel"))) ("bknr-datastore" @@ -169,7 +145,6 @@ ("bordeaux-threads" ((:system :name "rove") (:system :name "bordeaux-threads")) ((:system :name "ironclad") (:system :name "bordeaux-threads")) ((:system :name "hunchentoot") (:system :name "bordeaux-threads")) - ((:system :name "dexador") (:system :name "bordeaux-threads")) ((:system :name "cl-fad") (:system :name "bordeaux-threads")) ((:system :name "cl+ssl") (:system :name "bordeaux-threads")) ((:system :name "bknr.utils") (:system :name "bordeaux-threads"))) @@ -181,24 +156,17 @@ ((:system :name "cffi-grovel") (:system :name "cffi")) ((:system :name "cffi-grovel") (:system :name "cffi-toolchain"))) -("chipz" ((:system :name "dexador") (:system :name "chipz"))) +("chunga" ((:system :name "hunchentoot") (:system :name "chunga"))) -("chunga" ((:system :name "hunchentoot") (:system :name "chunga")) - ((:system :name "dexador") (:system :name "chunga"))) - -("cl+ssl" ((:system :name "hunchentoot") (:system :name "cl+ssl")) - ((:system :name "dexador") (:system :name "cl+ssl"))) +("cl+ssl" ((:system :name "hunchentoot") (:system :name "cl+ssl"))) ("cl-annot" ((:system :name "jonathan") (:system :name "cl-annot")) ((:system :name "cl-syntax-annot") (:system :name "cl-annot"))) -("cl-base64" ((:system :name "hunchentoot") (:system :name "cl-base64")) - ((:system :name "dexador") (:system :name "cl-base64"))) +("cl-base64" ((:system :name "hunchentoot") (:system :name "cl-base64"))) ("cl-change-case" ((:system :name "str") (:system :name "cl-change-case"))) -("cl-cookie" ((:system :name "dexador") (:system :name "cl-cookie"))) - ("cl-fad" ((:system :name "hunchentoot") (:system :name "cl-fad"))) ("cl-interpol" ((:system :name "bknr.utils") (:system :name "cl-interpol")) @@ -210,10 +178,8 @@ ((:system :name "lazybones") (:system :name "cl-ppcre")) ((:system :name "jonathan") (:system :name "cl-ppcre")) ((:system :name "hunchentoot") (:system :name "cl-ppcre")) - ((:system :name "dexador") (:system :name "cl-ppcre")) ((:system :name "cl-unicode") (:system :name "cl-ppcre")) ((:system :name "cl-ppcre-unicode") (:system :name "cl-ppcre")) - ((:system :name "cl-cookie") (:system :name "cl-ppcre")) ((:system :name "cl-change-case") (:system :name "cl-ppcre")) ((:system :name "cl-change-case") (:system :name "cl-ppcre-unicode")) ((:system :name "bknr.utils") (:system :name "cl-ppcre"))) @@ -227,25 +193,16 @@ ("cl-unicode" ((:system :name "cl-ppcre-unicode") (:system :name "cl-unicode")) ((:system :name "cl-interpol") (:system :name "cl-unicode"))) -("cl-utilities" ((:system :name "quri") (:system :name "cl-utilities")) - ((:system :name "fast-http") (:system :name "cl-utilities"))) - ("closer-mop" ((:system :name "trivial-documentation") (:system :name "closer-mop")) ((:system :name "bknr.indices") (:system :name "closer-mop")) ((:system :name "bknr.datastore") (:system :name "closer-mop"))) -("dexador" ((:system :name "oneliners.api-client") (:system :name "dexador"))) - ("dissect" ((:system :name "rove") (:system :name "dissect"))) -("fast-http" ((:system :name "dexador") (:system :name "fast-http"))) - -("fast-io" ((:system :name "jonathan") (:system :name "fast-io")) - ((:system :name "dexador") (:system :name "fast-io"))) +("fast-io" ((:system :name "jonathan") (:system :name "fast-io"))) ("flexi-streams" - ((:system :name "smart-buffer") (:system :name "flexi-streams")) ((:system :name "hunchentoot") (:system :name "flexi-streams")) ((:system :name "cl+ssl") (:system :name "flexi-streams")) ((:system :name "bknr.utils") (:system :name "flexi-streams"))) @@ -276,8 +233,6 @@ ("lisp-namespace" ((:system :name "lazybones") (:system :name "lisp-namespace"))) -("local-time" ((:system :name "cl-cookie") (:system :name "local-time"))) - ("md5" ((:system :name "hunchentoot") (:system :name "md5")) ((:system :name "bknr.utils") (:system :name "md5"))) @@ -285,27 +240,17 @@ ((:system :name "cl-syntax") (:system :name "named-readtables")) ((:system :name "cl-interpol") (:system :name "named-readtables"))) -("oneliners.api-client.asd" (t (:asd-file :name "oneliners.api-client.asd"))) - ("oneliners.api.asd" ((:system :name "oneliners.api/tests") (:system :name "oneliners.api")) (t (:asd-file :name "oneliners.api.asd"))) -("proc-parse" ((:system :name "jonathan") (:system :name "proc-parse")) - ((:system :name "fast-http") (:system :name "proc-parse")) - ((:system :name "cl-cookie") (:system :name "proc-parse"))) - -("quri" ((:system :name "dexador") (:system :name "quri")) - ((:system :name "cl-cookie") (:system :name "quri"))) +("proc-parse" ((:system :name "jonathan") (:system :name "proc-parse"))) ("rfc2388" ((:system :name "hunchentoot") (:system :name "rfc2388"))) ("rove" ((:system :name "oneliners.api/tests") (:system :name "rove"))) -("smart-buffer" ((:system :name "fast-http") (:system :name "smart-buffer"))) - -("split-sequence" ((:system :name "usocket") (:system :name "split-sequence")) - ((:system :name "quri") (:system :name "split-sequence"))) +("split-sequence" ((:system :name "usocket") (:system :name "split-sequence"))) ("static-vectors" ((:system :name "fast-io") (:system :name "static-vectors"))) @@ -316,26 +261,20 @@ ((:system :name "lazybones") (:system :name "trivial-documentation"))) ("trivial-features" - ((:system :name "dexador") (:system :name "trivial-features")) ((:system :name "cl+ssl") (:system :name "trivial-features")) ((:system :name "cffi") (:system :name "trivial-features")) ((:system :name "babel") (:system :name "trivial-features"))) -("trivial-garbage" - ((:system :name "dexador") (:system :name "trivial-garbage")) - ((:system :name "cl+ssl") (:system :name "trivial-garbage"))) +("trivial-garbage" ((:system :name "cl+ssl") (:system :name "trivial-garbage"))) ("trivial-gray-streams" ((:system :name "yason") (:system :name "trivial-gray-streams")) ((:system :name "rove") (:system :name "trivial-gray-streams")) ((:system :name "flexi-streams") (:system :name "trivial-gray-streams")) ((:system :name "fast-io") (:system :name "trivial-gray-streams")) - ((:system :name "dexador") (:system :name "trivial-gray-streams")) ((:system :name "cl+ssl") (:system :name "trivial-gray-streams")) ((:system :name "chunga") (:system :name "trivial-gray-streams"))) -("trivial-mimes" ((:system :name "dexador") (:system :name "trivial-mimes"))) - ("trivial-types" ((:system :name "jonathan") (:system :name "trivial-types")) ((:system :name "cl-syntax") (:system :name "trivial-types"))) @@ -345,13 +284,9 @@ ("unit-test" ((:system :name "bknr.datastore") (:system :name "unit-test"))) ("usocket" ((:system :name "hunchentoot") (:system :name "usocket")) - ((:system :name "dexador") (:system :name "usocket")) ((:system :name "cl+ssl") (:system :name "usocket"))) ("uuid" ((:system :name "oneliners.api") (:system :name "uuid"))) -("xsubseq" ((:system :name "smart-buffer") (:system :name "xsubseq")) - ((:system :name "fast-http") (:system :name "xsubseq"))) - ("yason" ((:system :name "bknr.datastore") (:system :name "yason"))) diff --git a/oneliners.api-client.asd b/oneliners.api-client.asd deleted file mode 100644 index 3b75288..0000000 --- a/oneliners.api-client.asd +++ /dev/null @@ -1,3 +0,0 @@ -(asdf:defsystem #:ONELINERS.API-CLIENT - :depends-on (#:dexador) - :components ((:file "oneliners.api-client")))
\ No newline at end of file diff --git a/oneliners.api-client.lisp b/oneliners.api-client.lisp deleted file mode 100644 index 1e1422e..0000000 --- a/oneliners.api-client.lisp +++ /dev/null @@ -1,243 +0,0 @@ - -(defpackage #:lazybones-client.shared - (:intern #:req-string) - (:export #:*host* #:*body* #:*headers* #:*cookies*)) -(defpackage #:ONELINERS.API-CLIENT - (:use :cl :lazybones-client.shared) - (:export #:*host* #:*body* #:*headers* #:*cookies* #:request-with - #:GET--FOOBAR-NUMBER -#:GET--SEARCH -#:PATCH--FLAG-ONELINER -#:PATCH--EDIT-ONELINER -#:PATCH--UNLOCK-ONELINER -#:PATCH--LOCK-ONELINER -#:POST--ADD-ONELINER -#:POST--MAKE-INVITE -#:POST--TOKEN-CONTRIBUTOR -#:POST--REDEEM-INVITE)) -(in-package :ONELINERS.API-CLIENT) - - -(defvar *host* nil - "The host to which the client will send its requests.") - - (defvar *body* nil - "Body passed to client post, put, and patch requests") - - (defvar *cookies* nil - "An instance of CL-COOKIE:COOKIE-JAR.") - - (defvar *headers* nil - "A liist of (header-name . header-value) pairs.") - - (defmacro request-with ((&key host body headers content-type cookies) &body forms) - "Make a request in a specific context. - -HOST is a string, the hostname where the request will be sent. Defaults -to *HOST*. - -BODY should be a string, an alist, or a pathname. Default to *BODY* - -HEADERS should be an ALIST of (header-name . header-value) string -pairs. Defaults to *HEADERS*. - -CONTENT-TYPE is a convenience for supplying just the Content-Type -header. - -COOKIES should be an instance of CL-COOKIE:COOKIE-JAR. Defaults to -*COOKIES*. -" - (let ((content-type-var (gensym))) - `(let ((*host* (or ,host *host*)) - (*body* (or ,body *body*)) - (*headers* (or ,headers *headers*)) - (*cookies* (or ,cookies *cookies*)) - (,content-type-var ,content-type)) - (when ,content-type-var - (push (cons "Content-Type" ,content-type-var) *headers*)) - ,@forms))) - - -(DEFUN GET--FOOBAR-NUMBER (NUMBER &KEY NAME AGE) - "Doesn't do anything really" - (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING - (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* - (FORMAT NIL "/foobar/~a" NUMBER) - (WHEN (OR NAME AGE) - (LIST "?" - (IF NAME - (CONCATENATE 'STRING (SYMBOL-NAME 'NAME) "=" - (FORMAT NIL "~a" NAME)) - "") - (IF AGE - (CONCATENATE 'STRING "&" (SYMBOL-NAME 'AGE) "=" - (FORMAT NIL "~a" AGE)) - "")))))) - (DEXADOR:GET LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*))) - - -(DEFUN GET--SEARCH (&KEY TAGS LIMIT NOTFLAGGED) - "A search endpoint returning a JSON encoded array of Oneliner Entries. TAGS cannot be empty." - (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING - (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* - (FORMAT NIL "/search") - (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 PATCH--FLAG-ONELINER (ONELINER) - "Flag the oneliner for review. Open to anyone." - (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING - (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* - (FORMAT NIL "/flag/~a" ONELINER) NIL))) - (IF LAZYBONES-CLIENT.SHARED:*BODY* - (DEXADOR:PATCH LAZYBONES-CLIENT.SHARED::REQ-STRING :CONTENT - LAZYBONES-CLIENT.SHARED:*BODY* :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*) - (DEXADOR:PATCH LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*)))) - - -(DEFUN PATCH--EDIT-ONELINER (ONELINER) - "Edit the fields of a oneliner." - (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING - (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* - (FORMAT NIL "/edit/~a" ONELINER) NIL))) - (IF LAZYBONES-CLIENT.SHARED:*BODY* - (DEXADOR:PATCH LAZYBONES-CLIENT.SHARED::REQ-STRING :CONTENT - LAZYBONES-CLIENT.SHARED:*BODY* :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*) - (DEXADOR:PATCH LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*)))) - - -(DEFUN PATCH--UNLOCK-ONELINER (ONELINER) - "Unlocks a oneliner." - (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING - (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* - (FORMAT NIL "/unlock/~a" ONELINER) NIL))) - (IF LAZYBONES-CLIENT.SHARED:*BODY* - (DEXADOR:PATCH LAZYBONES-CLIENT.SHARED::REQ-STRING :CONTENT - LAZYBONES-CLIENT.SHARED:*BODY* :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*) - (DEXADOR:PATCH LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*)))) - - -(DEFUN PATCH--LOCK-ONELINER (ONELINER) - "Locks a oneliner. Locked oneliners cannot be edited or flagged." - (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING - (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* - (FORMAT NIL "/lock/~a" ONELINER) NIL))) - (IF LAZYBONES-CLIENT.SHARED:*BODY* - (DEXADOR:PATCH LAZYBONES-CLIENT.SHARED::REQ-STRING :CONTENT - LAZYBONES-CLIENT.SHARED:*BODY* :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*) - (DEXADOR:PATCH LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*)))) - - -(DEFUN POST--ADD-ONELINER () - "Make a new [oneliner](#oneliner-post-body)." - (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING - (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* - (FORMAT NIL "/add-oneliner") NIL))) - (IF LAZYBONES-CLIENT.SHARED:*BODY* - (DEXADOR:POST LAZYBONES-CLIENT.SHARED::REQ-STRING :CONTENT - LAZYBONES-CLIENT.SHARED:*BODY* :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*) - (DEXADOR:POST LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*)))) - - -(DEFUN POST--MAKE-INVITE () - "On success, return an object containing a new [invite token](#invite-token)." - (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING - (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* - (FORMAT NIL "/make-invite") NIL))) - (IF LAZYBONES-CLIENT.SHARED:*BODY* - (DEXADOR:POST LAZYBONES-CLIENT.SHARED::REQ-STRING :CONTENT - LAZYBONES-CLIENT.SHARED:*BODY* :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*) - (DEXADOR:POST LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*)))) - - -(DEFUN POST--TOKEN-CONTRIBUTOR (CONTRIBUTOR &KEY PASSWORD) - "Authenticate a contributor and reply with an [api token](#access-token)" - (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING - (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* - (FORMAT NIL "/token/~a" CONTRIBUTOR) - (WHEN (OR PASSWORD) - (LIST "?" - (IF PASSWORD - (CONCATENATE 'STRING (SYMBOL-NAME 'PASSWORD) "=" - (FORMAT NIL "~a" PASSWORD)) - "")))))) - (IF LAZYBONES-CLIENT.SHARED:*BODY* - (DEXADOR:POST LAZYBONES-CLIENT.SHARED::REQ-STRING :CONTENT - LAZYBONES-CLIENT.SHARED:*BODY* :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*) - (DEXADOR:POST LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*)))) - - -(DEFUN POST--REDEEM-INVITE (INVITE &KEY USERNAME PASSWORD1 PASSWORD2) - "Redeem an [invite code](#invite-code) and create a new [contributor](#new-contributor-post-body)" - (LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING - (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* - (FORMAT NIL "/redeem/~a" INVITE) - (WHEN (OR USERNAME PASSWORD1 PASSWORD2) - (LIST "?" - (IF USERNAME - (CONCATENATE 'STRING (SYMBOL-NAME 'USERNAME) "=" - (FORMAT NIL "~a" USERNAME)) - "") - (IF PASSWORD1 - (CONCATENATE 'STRING "&" (SYMBOL-NAME 'PASSWORD1) - "=" (FORMAT NIL "~a" PASSWORD1)) - "") - (IF PASSWORD2 - (CONCATENATE 'STRING "&" (SYMBOL-NAME 'PASSWORD2) - "=" (FORMAT NIL "~a" PASSWORD2)) - "")))))) - (IF LAZYBONES-CLIENT.SHARED:*BODY* - (DEXADOR:POST LAZYBONES-CLIENT.SHARED::REQ-STRING :CONTENT - LAZYBONES-CLIENT.SHARED:*BODY* :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*) - (DEXADOR:POST LAZYBONES-CLIENT.SHARED::REQ-STRING :COOKIE-JAR - LAZYBONES-CLIENT.SHARED:*COOKIES* :HEADERS - LAZYBONES-CLIENT.SHARED:*HEADERS*)))) - |