const.cljs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. (ns frontend.worker.rtc.const
  2. "RTC constants"
  3. (:require [logseq.common.defkeywords :as common-def :refer [defkeywords]]
  4. [logseq.db.frontend.kv-entity :as kv-entity]
  5. [logseq.db.frontend.property :as db-property]))
  6. (goog-define RTC-E2E-TEST* false)
  7. (def RTC-E2E-TEST RTC-E2E-TEST*)
  8. (defkeywords
  9. :rtc/ignore-attr-when-init-upload
  10. {:doc "keyword option for RTC. ignore this *attr* when initial uploading graph. Default false"}
  11. :rtc/ignore-attr-when-init-download
  12. {:doc "keyword option for RTC. ignore this *attr* when initial downloading graph. Default false"}
  13. :rtc/ignore-attr-when-syncing
  14. {:doc "keyword option for RTC. ignore this *attr* when syncing graph. Default false"}
  15. :rtc/ignore-entity-when-init-upload
  16. {:doc "keyword option for RTC. ignore this *entity* when initial uploading graph. Default false"}
  17. :rtc/ignore-entity-when-init-download
  18. {:doc "keyword option for RTC. ignore this *entity* when initial downloading graph. Default false"}
  19. ;; only blocks(:block/uuid) will be synced, this option is meaningless for now
  20. ;; :rtc/ignore-entity-when-syncing
  21. ;; {:doc "keyword option for RTC. ignore this *entity* when syncing graph. Default false"}
  22. )
  23. (def ignore-attrs-when-init-upload
  24. (into #{}
  25. (keep (fn [[kw config]] (when (get-in config [:rtc :rtc/ignore-attr-when-init-upload]) kw)))
  26. db-property/built-in-properties))
  27. (def ignore-attrs-when-init-download
  28. (into #{}
  29. (keep (fn [[kw config]] (when (get-in config [:rtc :rtc/ignore-attr-when-init-download]) kw)))
  30. db-property/built-in-properties))
  31. (def ignore-attrs-when-syncing
  32. (into #{}
  33. (keep (fn [[kw config]] (when (get-in config [:rtc :rtc/ignore-attr-when-syncing]) kw)))
  34. db-property/built-in-properties))
  35. (def ignore-entities-when-init-upload
  36. (into #{}
  37. (keep (fn [[kw config]] (when (get-in config [:rtc :rtc/ignore-entity-when-init-upload]) kw)))
  38. kv-entity/kv-entities))
  39. (def ignore-entities-when-init-download
  40. (into #{}
  41. (keep (fn [[kw config]] (when (get-in config [:rtc :rtc/ignore-entity-when-init-download]) kw)))
  42. kv-entity/kv-entities))