diff --git a/src/main/frontend/fs/sync.cljs b/src/main/frontend/fs/sync.cljs index 1c73e87f34..812f893c39 100644 --- a/src/main/frontend/fs/sync.cljs +++ b/src/main/frontend/fs/sync.cljs @@ -165,8 +165,11 @@ (defprotocol IRemoteAPI (get-remote-all-files-meta [this graph-uuid] "get remote all files' metadata") - (get-diff [this graph-uuid from-txid] "get diff from FROM-TXID, - return [txns, latest-txid]")) + (get-remote-files-meta [this graph-uuid filepaths] "get remote files' metadata") + (get-remote-graph [this graph-name-opt graph-uuid-opt] "get graph info by GRAPH-NAME-OPT or GRAPH-UUID-OPT") + (list-remote-graphs [this] "list all remote graphs") + (get-diff [this graph-uuid from-txid] "get diff from FROM-TXID, return [txns, latest-txid]") + (create-graph [this graph-name] "create graph")) (deftype MockRSAPI [] IRSAPI @@ -193,20 +196,42 @@ ;; TODO (set! token "") token) + (request [this api-name body] + (go + (let [resp ( {} + (seq graph-name-opt) + (assoc :GraphName graph-name-opt) + (seq graph-uuid-opt) + (assoc :GraphUUID graph-uuid-opt)))) + (list-remote-graphs [this] + (.request this "list_graphs")) (get-diff [this graph-uuid from-txid] (go (-> - (RemoteAPI nil)) + (defn- update-txn [^FileTxnSet filetxnset txn] (let [{:keys [TXType TXContent]} txn] (case TXType @@ -255,7 +280,9 @@ repo (state/get-current-repo)] (apply-filetxns graph-uuid filetxnset) (.reset_value! graphs-txid [graph-uuid latest-txid] repo) - (persist-var/persist-save graphs-txid))) + (persist-var/persist-save graphs-txid)) + ;; TODO catch + ) (sync-remote-all-files! graph-uuid-expect)))))) (comment