cljs / src / ird / domains.cljs
321 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
(ns ird.domains
  "Domain availability search, utilities, and the classified .ro web
  directory. `check` and `example` work anonymously (higher rate limits with
  an API key). Every function returns a channel (see ird.async)."
  (:require [ird.transport :as transport]))

(defn check
  "GET /domains/check — Check domain availability. Anonymous allowed."
  [client domain]
  (transport/request client :get "/domains/check" {:query {:domain domain}}))

(defn info
  "GET /domains/info — Domain information utilities.
  Optional QUERY keys include :fields."
  ([client domain] (info client domain nil))
  ([client domain query]
   (transport/request client :get "/domains/info" {:query (assoc query :domain domain)})))

(defn preflight
  "GET /domains/preflight — Route a domain to the right inbound operation."
  [client domain]
  (transport/request client :get "/domains/preflight" {:query {:domain domain}}))

(defn dns-snapshot
  "GET /domains/dns-snapshot — Faithful copy of a domain's live DNS.
  Optional QUERY keys include :subdomains, :names. The snapshot's :id is
  what ird.dns/seed-claim attaches to a pending claim."
  ([client domain] (dns-snapshot client domain nil))
  ([client domain query]
   (transport/request client :get "/domains/dns-snapshot" {:query (assoc query :domain domain)})))

(defn search
  "GET /domains/search — Suggest available domain names.
  Optional QUERY keys include :count."
  ([client q] (search client q nil))
  ([client q query]
   (transport/request client :get "/domains/search" {:query (assoc query :q q)})))

(defn search-descriptions
  "POST /domains/search — Suggest available domain names (long descriptions).
  BODY is a plain map with :q and optional :count."
  [client body]
  (transport/request client :post "/domains/search" {:body body}))

(defn example
  "GET /domains/example — Example .ro domain. Anonymous allowed."
  [client]
  (transport/request client :get "/domains/example"))

(defn directory
  "GET /domains/directory — Browse the .ro web directory.
  Optional QUERY keys include :category, :tag, :bias, :sentiment, :language,
  :ad_network, :tracker, :tag_manager, :cookie_consent, :q, :limit, :cursor,
  :offset, :include_total."
  ([client] (directory client nil))
  ([client query]
   (transport/request client :get "/domains/directory" {:query query})))

(defn directory-all
  "Every directory entry under :entries, following cursor pagination. QUERY
  may include filters; :cursor is managed automatically. Delivers a vector."
  ([client] (directory-all client nil))
  ([client query]
   (transport/paginate client :get "/domains/directory" :entries query)))

(defn directory-entry
  "GET /domains/directory/{domain} — Directory entry for a domain."
  [client domain]
  (transport/request client :get ["domains" "directory" domain]))

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