mirror of
https://github.com/penpot/penpot.git
synced 2025-05-25 11:46:10 +02:00
✨ Add missing sm/define on some file and file-thumbnails rpc methods
This commit is contained in:
parent
f1d8abf160
commit
ad0378270f
2 changed files with 40 additions and 31 deletions
|
@ -232,33 +232,38 @@
|
||||||
;; --- COMMAND QUERY: get-file (by id)
|
;; --- COMMAND QUERY: get-file (by id)
|
||||||
|
|
||||||
(def schema:file
|
(def schema:file
|
||||||
[:map {:title "File"}
|
(sm/define
|
||||||
[:id ::sm/uuid]
|
[:map {:title "File"}
|
||||||
[:features ::cfeat/features]
|
[:id ::sm/uuid]
|
||||||
[:has-media-trimmed :boolean]
|
[:features ::cfeat/features]
|
||||||
[:comment-thread-seqn {:min 0} :int]
|
[:has-media-trimmed :boolean]
|
||||||
[:name :string]
|
[:comment-thread-seqn {:min 0} :int]
|
||||||
[:revn {:min 0} :int]
|
[:name :string]
|
||||||
[:modified-at ::dt/instant]
|
[:revn {:min 0} :int]
|
||||||
[:is-shared :boolean]
|
[:modified-at ::dt/instant]
|
||||||
[:project-id ::sm/uuid]
|
[:is-shared :boolean]
|
||||||
[:created-at ::dt/instant]
|
[:project-id ::sm/uuid]
|
||||||
[:data {:optional true} :any]])
|
[:created-at ::dt/instant]
|
||||||
|
[:data {:optional true} :any]]))
|
||||||
|
|
||||||
(def schema:permissions-mixin
|
(def schema:permissions-mixin
|
||||||
[:map {:title "PermissionsMixin"}
|
(sm/define
|
||||||
[:permissions ::perms/permissions]])
|
[:map {:title "PermissionsMixin"}
|
||||||
|
[:permissions ::perms/permissions]]))
|
||||||
|
|
||||||
(def schema:file-with-permissions
|
(def schema:file-with-permissions
|
||||||
[:merge {:title "FileWithPermissions"}
|
(sm/define
|
||||||
schema:file
|
[:merge {:title "FileWithPermissions"}
|
||||||
schema:permissions-mixin])
|
schema:file
|
||||||
|
schema:permissions-mixin]))
|
||||||
|
|
||||||
(def schema:get-file
|
(def ^:private
|
||||||
[:map {:title "get-file"}
|
schema:get-file
|
||||||
[:features {:optional true} ::cfeat/features]
|
(sm/define
|
||||||
[:id ::sm/uuid]
|
[:map {:title "get-file"}
|
||||||
[:project-id {:optional true} ::sm/uuid]])
|
[:features {:optional true} ::cfeat/features]
|
||||||
|
[:id ::sm/uuid]
|
||||||
|
[:project-id {:optional true} ::sm/uuid]]))
|
||||||
|
|
||||||
(defn get-file
|
(defn get-file
|
||||||
([conn id] (get-file conn id nil))
|
([conn id] (get-file conn id nil))
|
||||||
|
|
|
@ -190,16 +190,20 @@
|
||||||
:always
|
:always
|
||||||
(update :objects assoc-thumbnails page-id thumbs))))))
|
(update :objects assoc-thumbnails page-id thumbs))))))
|
||||||
|
|
||||||
(def ^:private schema:get-file-data-for-thumbnail
|
(def ^:private
|
||||||
[:map {:title "get-file-data-for-thumbnail"}
|
schema:get-file-data-for-thumbnail
|
||||||
[:file-id ::sm/uuid]
|
(sm/define
|
||||||
[:features {:optional true} ::cfeat/features]])
|
[:map {:title "get-file-data-for-thumbnail"}
|
||||||
|
[:file-id ::sm/uuid]
|
||||||
|
[:features {:optional true} ::cfeat/features]]))
|
||||||
|
|
||||||
(def ^:private schema:partial-file
|
(def ^:private
|
||||||
[:map {:title "PartialFile"}
|
schema:partial-file
|
||||||
[:id ::sm/uuid]
|
(sm/define
|
||||||
[:revn {:min 0} :int]
|
[:map {:title "PartialFile"}
|
||||||
[:page :any]])
|
[:id ::sm/uuid]
|
||||||
|
[:revn {:min 0} :int]
|
||||||
|
[:page :any]]))
|
||||||
|
|
||||||
(sv/defmethod ::get-file-data-for-thumbnail
|
(sv/defmethod ::get-file-data-for-thumbnail
|
||||||
"Retrieves the data for generate the thumbnail of the file. Used
|
"Retrieves the data for generate the thumbnail of the file. Used
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue