Use sm/define on management rpc comnand schemas

This commit is contained in:
Andrey Antukh 2023-11-29 15:40:31 +01:00 committed by Andrés Moya
parent daec51bb7d
commit f5ec818fc7

View file

@ -34,10 +34,12 @@
(declare duplicate-file) (declare duplicate-file)
(def ^:private schema:duplicate-file (def ^:private
schema:duplicate-file
(sm/define
[:map {:title "duplicate-file"} [:map {:title "duplicate-file"}
[:file-id ::sm/uuid] [:file-id ::sm/uuid]
[:name {:optional true} :string]]) [:name {:optional true} :string]]))
(sv/defmethod ::duplicate-file (sv/defmethod ::duplicate-file
"Duplicate a single file in the same team." "Duplicate a single file in the same team."
@ -210,10 +212,12 @@
(declare duplicate-project) (declare duplicate-project)
(def ^:private schema:duplicate-project (def ^:private
schema:duplicate-project
(sm/define
[:map {:title "duplicate-project"} [:map {:title "duplicate-project"}
[:project-id ::sm/uuid] [:project-id ::sm/uuid]
[:name {:optional true} :string]]) [:name {:optional true} :string]]))
(sv/defmethod ::duplicate-project (sv/defmethod ::duplicate-project
"Duplicate an entire project with all the files" "Duplicate an entire project with all the files"
@ -337,10 +341,12 @@
nil)) nil))
(def ^:private schema:move-files (def ^:private
schema:move-files
(sm/define
[:map {:title "move-files"} [:map {:title "move-files"}
[:ids ::sm/set-of-uuid] [:ids ::sm/set-of-uuid]
[:project-id ::sm/uuid]]) [:project-id ::sm/uuid]]))
(sv/defmethod ::move-files (sv/defmethod ::move-files
"Move a set of files from one project to other." "Move a set of files from one project to other."
@ -382,10 +388,12 @@
nil)) nil))
(def ^:private schema:move-project (def ^:private
schema:move-project
(sm/define
[:map {:title "move-project"} [:map {:title "move-project"}
[:team-id ::sm/uuid] [:team-id ::sm/uuid]
[:project-id ::sm/uuid]]) [:project-id ::sm/uuid]]))
(sv/defmethod ::move-project (sv/defmethod ::move-project
"Move projects between teams" "Move projects between teams"
@ -420,10 +428,12 @@
(assoc ::binfile/migrate? true) (assoc ::binfile/migrate? true)
(binfile/import!)))) (binfile/import!))))
(def schema:clone-template (def ^:private
schema:clone-template
(sm/define
[:map {:title "clone-template"} [:map {:title "clone-template"}
[:project-id ::sm/uuid] [:project-id ::sm/uuid]
[:template-id ::sm/word-string]]) [:template-id ::sm/word-string]]))
(sv/defmethod ::clone-template (sv/defmethod ::clone-template
"Clone into the specified project the template by its id." "Clone into the specified project the template by its id."