0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 07:29:08 -05:00

🎉 Add webhooks to the API doc

This commit is contained in:
Andrey Antukh 2022-12-15 08:18:29 +01:00
parent 6ea0279c9e
commit 02f29ed4d0
2 changed files with 16 additions and 6 deletions

View file

@ -6,14 +6,21 @@
<div class="tags"> <div class="tags">
{% if item.deprecated %} {% if item.deprecated %}
<span class="tag"> <span class="tag">
<span>Deprecated:</span> <span>DEPRECATED</span>
<span>since v{{item.deprecated}}</span>, </span>
{% endif %}
{% if item.auth %}
<span class="tag">
<span>AUTH</span>
</span>
{% endif %}
{% if item.webhook %}
<span class="tag">
<span>WEBHOOK</span>
</span> </span>
{% endif %} {% endif %}
<span class="tag">
<span>Auth:</span>
<span>{% if item.auth %}YES{% else %}NO{% endif %}</span>
</span>
</div> </div>
</div> </div>
<div class="rpc-row-detail hidden"> <div class="rpc-row-detail hidden">

View file

@ -9,6 +9,7 @@
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[app.config :as cf] [app.config :as cf]
[app.loggers.webhooks :as-alias webhooks]
[app.rpc :as-alias rpc] [app.rpc :as-alias rpc]
[app.util.services :as sv] [app.util.services :as sv]
[app.util.template :as tmpl] [app.util.template :as tmpl]
@ -35,6 +36,7 @@
:name (d/name name) :name (d/name name)
:module (-> (:ns mdata) (str/split ".") last) :module (-> (:ns mdata) (str/split ".") last)
:auth (:auth mdata true) :auth (:auth mdata true)
:webhook (::webhooks/event? mdata false)
:docs (::sv/docstring mdata) :docs (::sv/docstring mdata)
:deprecated (::deprecated mdata) :deprecated (::deprecated mdata)
:added (::added mdata) :added (::added mdata)
@ -51,6 +53,7 @@
(->> (:queries methods) (->> (:queries methods)
(map (partial gen-doc :query)) (map (partial gen-doc :query))
(sort-by (juxt :module :name))) (sort-by (juxt :module :name)))
:mutation-methods :mutation-methods
(->> (:mutations methods) (->> (:mutations methods)
(map (partial gen-doc :query)) (map (partial gen-doc :query))