cljs / src / ird / support.cljs
164 words
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(ns ird.support
  "Support conversations with the ird team. Every function returns a channel
  (see ird.async)."
  (:require [ird.transport :as transport]))

(defn list-threads
  "GET /contact/threads — List your support threads.
  Optional QUERY keys include :limit, :cursor."
  ([client] (list-threads client nil))
  ([client query]
   (transport/request client :get "/contact/threads" {:query query})))

(defn list-all-threads
  "Every support thread under :threads, following cursor pagination. QUERY
  may include filters; :cursor is managed automatically. Delivers a vector."
  ([client] (list-all-threads client nil))
  ([client query]
   (transport/paginate client :get "/contact/threads" :threads query)))

(defn create-thread
  "POST /contact/threads — Open a support thread.
  BODY is a plain map with :title, :service and :message (all required;
  :service is one of the service enum values, e.g. \"domains\")."
  [client body]
  (transport/request client :post "/contact/threads" {:body body}))

(defn get-thread
  "GET /contact/threads/{id} — Read a support thread."
  [client id]
  (transport/request client :get ["contact" "threads" id]))

(defn reply
  "POST /contact/threads/{id}/messages — Reply on a support thread.
  BODY is a plain map with :message."
  [client id body]
  (transport/request client :post ["contact" "threads" id "messages"] {:body body}))

static mirror of HEAD · about · clone: git clone https://ird.cod-sursa.ro/cljs.git