enhance(rtc): update schema :sibling? to :pos

This commit is contained in:
rcmerci
2024-03-01 16:53:37 +08:00
parent 90576661f3
commit d3c1e08516
3 changed files with 13 additions and 7 deletions

View File

@@ -21,6 +21,12 @@
(into #{} (map first) general-attrs-schema-coll))
(def block-type-schema [:enum "property" "class" "whiteboard" "hidden" "closed value"])
(def block-pos-schema
":sibling: sibling of target-block(:target-uuid)
:child: child of target-block(:target-uuid)
:no-order: this block doesn't have :block/left attr"
[:enum :sibling :child :no-order])
(def to-ws-op-schema
[:multi {:dispatch first :decode/string #(update % 0 keyword)}
@@ -29,7 +35,7 @@
[:map
[:block-uuid :uuid]
[:target-uuid :uuid]
[:sibling? :boolean]]]]
[:pos block-pos-schema]]]]
[:remove
[:cat :keyword
[:map
@@ -40,7 +46,7 @@
[:map
[:block-uuid :uuid]
[:target-uuid {:optional true} :uuid]
[:sibling? {:optional true} :boolean]
[:pos {:optional true} block-pos-schema]
[:content {:optional true} :string]
[:updated-at {:optional true} :int]
[:created-at {:optional true} :int]