浏览代码

fix: lint

Tienson Qin 3 周之前
父节点
当前提交
41a020a17e

+ 1 - 0
deps/common/src/logseq/common/authorization.cljs

@@ -1,4 +1,5 @@
 (ns logseq.common.authorization
+  "jwt token authorization"
   (:require [clojure.string :as string]
             [promesa.core :as p]))
 

+ 0 - 69
deps/graph-parser/src/logseq/graph_parser/db.cljs

@@ -1,69 +0,0 @@
-(ns logseq.graph-parser.db
-  "File graph specific db fns"
-  (:require [clojure.set :as set]
-            [clojure.string :as string]
-            [datascript.core :as d]
-            [logseq.common.config :as common-config]
-            [logseq.common.util :as common-util]
-            [logseq.common.uuid :as common-uuid]
-            [logseq.db :as ldb]
-            [logseq.db.file-based.schema :as file-schema]))
-
-(defonce built-in-markers
-  ["NOW" "LATER" "DOING" "DONE" "CANCELED" "CANCELLED" "IN-PROGRESS" "TODO" "WAIT" "WAITING"])
-
-(defonce built-in-priorities
-  ["A" "B" "C"])
-
-(defonce built-in-pages-names
-  (set/union
-   (set built-in-markers)
-   (set built-in-priorities)
-   #{"Favorites" "Contents" "card"}))
-
-(defn- page-title->block
-  [title]
-  {:block/name (string/lower-case title)
-   :block/title title
-   :block/uuid (common-uuid/gen-uuid)
-   :block/type "page"})
-
-(def built-in-pages
-  (mapv page-title->block built-in-pages-names))
-
-(defn- build-pages-tx
-  [pages]
-  (let [time' (common-util/time-ms)]
-    (map
-     (fn [m]
-       (-> m
-           (assoc :block/created-at time')
-           (assoc :block/updated-at time')))
-     pages)))
-
-(defn create-default-pages!
-  "Creates default pages if one of the default pages does not exist. This
-   fn is idempotent"
-  [db-conn]
-  (when-not (ldb/get-page @db-conn "card")
-    (let [built-in-pages' (build-pages-tx built-in-pages)]
-      (ldb/transact! db-conn built-in-pages'))))
-
-(defn start-conn
-  "Create datascript conn with schema and default data"
-  []
-  (let [db-conn (d/create-conn file-schema/schema)]
-    (create-default-pages! db-conn)
-    db-conn))
-
-(defn get-page-file
-  [db page-name]
-  (some-> (ldb/get-page db page-name)
-          :block/file))
-
-(defn get-all-namespace-relation
-  [db]
-  (d/q '[:find ?page ?parent
-         :where
-         [?page :block/namespace ?parent]]
-       db))

+ 2 - 2
src/main/frontend/handler/db_based/db_sync.cljs

@@ -26,7 +26,7 @@
           base (string/replace base #"/sync/%s$" "")]
       base)))
 
-(defn- http-base []
+(defn http-base []
   (or config/db-sync-http-base
       (ws->http-base config/db-sync-ws-url)))
 
@@ -98,7 +98,7 @@
 
 (declare coerce-http-response)
 
-(defn- fetch-json
+(defn fetch-json
   [url opts {:keys [response-schema error-schema] :or {error-schema :error}}]
   (p/let [resp (js/fetch url (clj->js (with-auth-headers opts)))
           text (.text resp)

+ 3 - 3
src/main/frontend/worker/db_sync.cljs

@@ -352,17 +352,17 @@
   (assert (and k @e2ee-store))
   (idb-keyval/set k value @e2ee-store))
 
-(defn- e2ee-base
+(defn e2ee-base
   []
   (http-base-url))
 
-(defn- <fetch-user-rsa-key-pair-raw
+(defn <fetch-user-rsa-key-pair-raw
   [base]
   (fetch-json (str base "/e2ee/user-keys")
               {:method "GET"}
               {:response-schema :e2ee/user-keys}))
 
-(defn- <upload-user-rsa-key-pair!
+(defn <upload-user-rsa-key-pair!
   [base public-key encrypted-private-key]
   (let [body (coerce-http-request :e2ee/user-keys
                                   {:public-key public-key