From e9a28b034f6702810faa11406ffd5f6cfcffef46 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 5 Jun 2024 14:51:29 +0200 Subject: [PATCH] :fire: Replace spec with schema on file RPC methods --- backend/src/app/rpc/commands/files.clj | 24 +++++-------------- .../app/main/data/workspace/libraries.cljs | 3 +++ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/backend/src/app/rpc/commands/files.clj b/backend/src/app/rpc/commands/files.clj index b0c74feb1..b4d0e8b32 100644 --- a/backend/src/app/rpc/commands/files.clj +++ b/backend/src/app/rpc/commands/files.clj @@ -15,7 +15,6 @@ [app.common.logging :as l] [app.common.schema :as sm] [app.common.schema.desc-js-like :as-alias smdj] - [app.common.spec :as us] [app.common.types.components-list :as ctkl] [app.common.types.file :as ctf] [app.config :as cf] @@ -36,7 +35,6 @@ [app.util.services :as sv] [app.util.time :as dt] [app.worker :as wrk] - [clojure.spec.alpha :as s] [cuerdas.core :as str])) ;; --- FEATURES @@ -46,18 +44,6 @@ (when media-id (str (cf/get :public-uri) "/assets/by-id/" media-id))) -;; --- SPECS - -(s/def ::features ::us/set-of-strings) -(s/def ::file-id ::us/uuid) -(s/def ::frame-id ::us/uuid) -(s/def ::id ::us/uuid) -(s/def ::is-shared ::us/boolean) -(s/def ::name ::us/string) -(s/def ::project-id ::us/uuid) -(s/def ::search-term ::us/string) -(s/def ::team-id ::us/uuid) - ;; --- HELPERS (def long-cache-duration @@ -1047,14 +1033,16 @@ {:id file-id} {::db/return-keys true})) -(s/def ::ignore-file-library-sync-status - (s/keys :req [::rpc/profile-id] - :req-un [::file-id ::date])) +(def ^:private schema:ignore-file-library-sync-status + [:map {:title "ignore-file-library-sync-status"} + [:file-id ::sm/uuid] + [:date ::dt/duration]]) ;; TODO: improve naming (sv/defmethod ::ignore-file-library-sync-status "Ignore updates in linked files" - {::doc/added "1.17"} + {::doc/added "1.17" + ::sm/params schema:ignore-file-library-sync-status} [{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id file-id] :as params}] (db/with-atomic [conn pool] (check-edition-permissions! conn profile-id file-id) diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index 5f0498e94..6d7aafc56 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -1042,6 +1042,9 @@ {:file-id file-id :library-id library-id})))))))))) + +;; FIXME: the data should be set on the backend for clock consistency + (def ignore-sync "Mark the file as ignore syncs. All library changes before this moment will not ber notified to sync."