;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310DD\311\312\313\314\315&\207" [require request json libbcel-oauth custom-declare-variable libbcel-client-account-id funcall function #[0 "\300\207" [nil] 1] "The account id to connect to.\nThis is the first number appearing after basecamp.com in the URL\nwhen you are on the basecamp website." :type string :group libbcel] 8) #@42 Remembers the OAuth authentication data. (defvar libbcel-client--oauth-store nil (#$ . 484)) #@39 Return the OAuth authentication data. (defalias 'libbcel-client--oauth-store #[0 "\206\301 \211\207" [libbcel-client--oauth-store libbcel-oauth-get-store] 2 (#$ . 583)]) #@54 Temporary directory where to put communication logs. (defvar libbcel-client--log-directory (expand-file-name "libbcel-client-logs" temporary-file-directory) (#$ . 763)) #@104 Create a subdirectory in `libbcel-client--log-directory' to store logs for a request on URL. (fn URL) (defalias 'libbcel-client--make-log-subdir #[257 "\301\302\303\304!\305\306\307##\310\"\311\312\"\210\207" [libbcel-client--log-directory format "%s_%s" format-time-string "%F_%H:%M:%S" replace-regexp-in-string "/" "_" expand-file-name make-directory t] 8 (#$ . 939)]) #@152 Write CONTENT to FILENAME in a temporary directory based on URL. CONTENT can be anything that can be printed with `princ'. (fn CONTENT FILENAME URL) (defalias 'libbcel-client--write-log #[771 "\205:\300\301!\"\302\303\304\"\305\306\"\216r\211q\210\307\310\"c\210\3111(\312 0\202*\210\313)rq\210\314\313\211\313\315%\210*\266\202\207" [expand-file-name libbcel-client--make-log-subdir generate-new-buffer " *temp file*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] format "%s" (error) pp-buffer nil write-region 0] 12 (#$ . 1323)]) #@220 Call `request'. URL, SUCCESS, ERROR are passed to `request'. ACCESS-TOKEN is found in the result of the OAUTH2 authentication. See `libbcel-oauth-get-access-token'. (fn ACCESS-TOKEN URL &rest REST &allow-other-keys) (defalias 'libbcel-client-request #[642 "\302\303\304\305\"!\211\306\307\310!\"\311\312\313\314\315\316\317\304\320\"BD\321\322\323\324\325$ & *\207" [request-log-level request-log-buffer-name trace generate-new-buffer-name format " *libbcel-client-%s*" expand-file-name "request-logs" libbcel-client--make-log-subdir apply request :timeout 5 :headers ("User-Agent" . "bcel (damien@cassou.me)") "Authorization" "Bearer %s" :parser json-read :complete make-closure #[128 "\304\305\"A@\304\306\"A@\304\307\"A@\304\310\"A@\311r\301q\210\312\302!\210)\313\314\300#\210\313A\315\316@\"\300#\210\313\315\317\"\300#\210\313\320\300#)\207" [V0 V1 V2 save-silently plist-member :data :error-thrown :symbol-status :response t write-file libbcel-client--write-log "data" format "error:%s" "status:%s" "response"] 10 "\n\n(fn &key DATA ERROR-THROWN SYMBOL-STATUS RESPONSE &allow-other-keys)"]] 20 (#$ . 1911)]) #@332 Do a GET query to Basecamp 3 API at URL. If PARAMS is non-nil it should be an alist that is passed to the GET request. ACCESS-TOKEN is found in the result of the OAUTH2 authentication. See `libbcel-oauth-get-access-token'. When CALLBACK is non-nil, evaluate it with the response. (fn ACCESS-TOKEN URL &optional CALLBACK PARAMS) (defalias 'libbcel-client--get-url-from-token #[1026 "\300\301\302\303\304\305\306\307\310 \"&\n\207" [libbcel-client-request :type "GET" :params :parser json-read :success make-closure #[128 "\301\302\"A@\300\205 \300!\207" [V0 plist-member :data] 4 "\n\n(fn &key DATA &allow-other-keys)"]] 17 (#$ . 3062)]) #@250 Do a DELETE query to Basecamp 3 API at URL. ACCESS-TOKEN is found in the result of the OAUTH2 authentication. See `libbcel-oauth-get-access-token'. When CALLBACK is non-nil, evaluate it with the response. (fn ACCESS-TOKEN URL &optional CALLBACK) (defalias 'libbcel-client--delete-url-from-token #[770 "\300\301\302\303\304\305\306\307\n\"&\207" [libbcel-client-request :type "DELETE" :parser json-read :success make-closure #[128 "\301\302\"A@\300\205 \300!\207" [V0 plist-member :data] 4 "\n\n(fn &key DATA &allow-other-keys)"]] 14 (#$ . 3717)]) #@248 Do a POST query to Basecamp 3 API at URL. ACCESS-TOKEN is found in the result of the OAUTH2 authentication. See `libbcel-oauth-get-access-token'. When CALLBACK is non-nil, evaluate it with the response. (fn ACCESS-TOKEN URL &optional CALLBACK) (defalias 'libbcel-client--post-url-from-token #[770 "\300\301\302\303\304\305\306\307\n\"&\207" [libbcel-client-request :type "POST" :parser json-read :success make-closure #[128 "\301\302\"A@\300\205 \300!\207" [V0 plist-member :data] 4 "\n\n(fn &key DATA &allow-other-keys)"]] 14 (#$ . 4281)]) #@293 Execute CALLBACK with the result of the GET call to PATH. ACCESS-TOKEN can be retrieved with `libbcel-oauth-get-access-token'. ACCOUNT-ID is the first number appearing after basecamp.com in the URL when you are on the basecamp website. (fn ACCESS-TOKEN ACCOUNT-ID PATH &optional CALLBACK) (defalias 'libbcel-client--get-path-from-token #[1027 "\300\301\302##\207" [libbcel-client--get-url-from-token format "https://3.basecampapi.com/%s/%s"] 10 (#$ . 4839)]) #@87 Execute CALLBACK with the result of a GET call to PATH. (fn PATH &optional CALLBACK) (defalias 'libbcel-client-get-path #[513 "\300\301 \302\303#\"\207" [libbcel-oauth-get-access-token libbcel-client--oauth-store make-closure #[257 "\303\n\300\301$\207" [V0 V1 libbcel-client-account-id libbcel-client--get-path-from-token] 6 "\n\n(fn ACCESS-TOKEN)"]] 8 (#$ . 5313)]) #@178 Do a GET request on URL and evaluate CALLBACK with the result. If PARAMS is non-nil it should be an alist that is passed to the GET request. (fn URL &optional CALLBACK PARAMS) (defalias 'libbcel-client-get-url #[769 "\300\301 \302\303$\"\207" [libbcel-oauth-get-access-token libbcel-client--oauth-store make-closure #[257 "\303\300\301\302$\207" [V0 V1 V2 libbcel-client--get-url-from-token] 6 "\n\n(fn ACCESS-TOKEN)"]] 10 (#$ . 5692)]) #@96 Do a DELETE request on URL and evaluate CALLBACK with the result. (fn URL &optional CALLBACK) (defalias 'libbcel-client-delete-url #[513 "\300\301 \302\303#\"\207" [libbcel-oauth-get-access-token libbcel-client--oauth-store make-closure #[257 "\302\300\301#\207" [V0 V1 libbcel-client--delete-url-from-token] 5 "\n\n(fn ACCESS-TOKEN)"]] 8 (#$ . 6143)]) #@94 Do a POST request on URL and evaluate CALLBACK with the result. (fn URL &optional CALLBACK) (defalias 'libbcel-client-post-url #[513 "\300\301 \302\303#\"\207" [libbcel-oauth-get-access-token libbcel-client--oauth-store make-closure #[257 "\302\300\301#\207" [V0 V1 libbcel-client--post-url-from-token] 5 "\n\n(fn ACCESS-TOKEN)"]] 8 (#$ . 6506)]) (provide 'libbcel-client)