0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-25 00:06:09 -05:00

Merge pull request #3509 from penpot/niwinz-staging-bugfixes-7

 Add improvements to api doc
This commit is contained in:
Alejandro 2023-08-09 08:00:02 +02:00 committed by GitHub
commit fbcc2494b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 19 additions and 10 deletions

View file

@ -22,11 +22,7 @@
{% endif %} {% endif %}
{% if item.params-schema-js %} {% if item.params-schema-js %}
<span class="tag"> <span class="tag">
<span>SC</span> <span>SCHEMA</span>
</span>
{% else %}
<span class="tag">
<span>SP</span>
</span> </span>
{% endif %} {% endif %}
</div> </div>

View file

@ -38,7 +38,7 @@
<h2>GENERAL NOTES</h2> <h2>GENERAL NOTES</h2>
<h3>Authentication</h3> <h3>Authentication</h3>
<p>The penpot backend right now offerts two way for authenticate the request: <p>The penpot backend right now offers two way for authenticate the request:
<b>cookies</b> (the same mechanism that we use ourselves on accessing the API from the <b>cookies</b> (the same mechanism that we use ourselves on accessing the API from the
web application) and <b>access tokens</b>.</p> web application) and <b>access tokens</b>.</p>

View file

@ -56,7 +56,7 @@
:trace (ex/format-throwable cause :data? false :explain? false :header? false :summary? false)} :trace (ex/format-throwable cause :data? false :explain? false :header? false :summary? false)}
(when-let [params (or (:request/params context) (:params context))] (when-let [params (or (:request/params context) (:params context))]
{:params (pp/pprint-str params :width 200)}) {:params (pp/pprint-str params :width 200 :length 50 :level 10)})
(when-let [value (:value context)] (when-let [value (:value context)]
{:value (pp/pprint-str value :width 200 :length 50 :level 10)}) {:value (pp/pprint-str value :width 200 :length 50 :level 10)})

View file

@ -68,6 +68,7 @@
::climit/key-fn ::rpc/profile-id ::climit/key-fn ::rpc/profile-id
::sm/params schema:push-audit-events ::sm/params schema:push-audit-events
::audit/skip true ::audit/skip true
::doc/skip true
::doc/added "1.17"} ::doc/added "1.17"}
[{:keys [::db/pool] :as cfg} params] [{:keys [::db/pool] :as cfg} params]
(if (or (db/read-only? pool) (if (or (db/read-only? pool)

View file

@ -67,6 +67,7 @@
(sv/defmethod ::get-file-object-thumbnails (sv/defmethod ::get-file-object-thumbnails
"Retrieve a file object thumbnails." "Retrieve a file object thumbnails."
{::doc/added "1.17" {::doc/added "1.17"
::doc/module :files
::sm/params [:map {:title "get-file-object-thumbnails"} ::sm/params [:map {:title "get-file-object-thumbnails"}
[:file-id ::sm/uuid]] [:file-id ::sm/uuid]]
::sm/result [:map-of :string :string] ::sm/result [:map-of :string :string]
@ -112,6 +113,7 @@
(sv/defmethod ::get-file-thumbnail (sv/defmethod ::get-file-thumbnail
{::doc/added "1.17" {::doc/added "1.17"
::doc/module :files
::doc/deprecated "1.19"} ::doc/deprecated "1.19"}
[{:keys [::db/pool]} {:keys [::rpc/profile-id file-id revn]}] [{:keys [::db/pool]} {:keys [::rpc/profile-id file-id revn]}]
(dm/with-open [conn (db/open pool)] (dm/with-open [conn (db/open pool)]
@ -220,6 +222,7 @@
mainly for render thumbnails on dashboard." mainly for render thumbnails on dashboard."
{::doc/added "1.17" {::doc/added "1.17"
::doc/module :files
::sm/params [:map {:title "get-file-data-for-thumbnail"} ::sm/params [:map {:title "get-file-data-for-thumbnail"}
[:file-id ::sm/uuid] [:file-id ::sm/uuid]
[:features {:optional true} ::files/features]] [:features {:optional true} ::files/features]]
@ -267,6 +270,7 @@
(sv/defmethod ::upsert-file-object-thumbnail (sv/defmethod ::upsert-file-object-thumbnail
{::doc/added "1.17" {::doc/added "1.17"
::doc/module :files
::doc/deprecated "1.19" ::doc/deprecated "1.19"
::audit/skip true} ::audit/skip true}
[{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id file-id] :as params}] [{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id file-id] :as params}]
@ -312,6 +316,7 @@
(sv/defmethod ::create-file-object-thumbnail (sv/defmethod ::create-file-object-thumbnail
{:doc/added "1.19" {:doc/added "1.19"
::doc/module :files
::audit/skip true ::audit/skip true
::sm/params schema:create-file-object-thumbnail} ::sm/params schema:create-file-object-thumbnail}
@ -350,6 +355,7 @@
(sv/defmethod ::delete-file-object-thumbnail (sv/defmethod ::delete-file-object-thumbnail
{:doc/added "1.19" {:doc/added "1.19"
::doc/module :files
::audit/skip true} ::audit/skip true}
[{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id file-id object-id]}] [{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id file-id object-id]}]
@ -388,6 +394,7 @@
"Creates or updates the file thumbnail. Mainly used for paint the "Creates or updates the file thumbnail. Mainly used for paint the
grid thumbnails." grid thumbnails."
{::doc/added "1.17" {::doc/added "1.17"
::doc/module :files
::doc/deprecated "1.19" ::doc/deprecated "1.19"
::audit/skip true} ::audit/skip true}
[{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id file-id] :as params}] [{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id file-id] :as params}]
@ -430,6 +437,7 @@
"Creates or updates the file thumbnail. Mainly used for paint the "Creates or updates the file thumbnail. Mainly used for paint the
grid thumbnails." grid thumbnails."
{::doc/added "1.19" {::doc/added "1.19"
::doc/module :files
::audit/skip true ::audit/skip true
::sm/params [:map {:title "create-file-thumbnail"} ::sm/params [:map {:title "create-file-thumbnail"}
[:file-id ::sm/uuid] [:file-id ::sm/uuid]

View file

@ -38,7 +38,8 @@
"Performs the authentication using LDAP backend. Only works if LDAP "Performs the authentication using LDAP backend. Only works if LDAP
is properly configured and enabled with `login-with-ldap` flag." is properly configured and enabled with `login-with-ldap` flag."
{::rpc/auth false {::rpc/auth false
::doc/added "1.15"} ::doc/added "1.15"
::doc/module :auth}
[{:keys [::main/props ::ldap/provider] :as cfg} params] [{:keys [::main/props ::ldap/provider] :as cfg} params]
(when-not provider (when-not provider
(ex/raise :type :restriction (ex/raise :type :restriction

View file

@ -64,6 +64,7 @@
:opt-un [::search-term])) :opt-un [::search-term]))
(sv/defmethod ::search-files (sv/defmethod ::search-files
{::doc/added "1.17"} {::doc/added "1.17"
::doc/module :files}
[{:keys [::db/pool]} {:keys [::rpc/profile-id team-id search-term]}] [{:keys [::db/pool]} {:keys [::rpc/profile-id team-id search-term]}]
(some->> search-term (search-files pool profile-id team-id))) (some->> search-term (search-files pool profile-id team-id)))

View file

@ -34,7 +34,8 @@
(sv/defmethod ::verify-token (sv/defmethod ::verify-token
{::rpc/auth false {::rpc/auth false
::doc/added "1.15"} ::doc/added "1.15"
::doc/module :auth}
[{:keys [::db/pool] :as cfg} {:keys [token] :as params}] [{:keys [::db/pool] :as cfg} {:keys [token] :as params}]
(db/with-atomic [conn pool] (db/with-atomic [conn pool]
(let [claims (tokens/verify (::main/props cfg) {:token token}) (let [claims (tokens/verify (::main/props cfg) {:token token})

View file

@ -75,6 +75,7 @@
(->> methods (->> methods
(map val) (map val)
(map first) (map first)
(remove ::skip)
(map get-context) (map get-context)
(sort-by (juxt :module :name)))})) (sort-by (juxt :module :name)))}))