mirror of
https://github.com/penpot/penpot.git
synced 2025-03-21 12:11:37 -05:00
♻️ Make the namespacing independent of the branding.
This commit is contained in:
parent
aaf8b71837
commit
6c67c3c71b
305 changed files with 2399 additions and 2580 deletions
backend
deps.edndata_readers.clj
resources
scripts
src
app
cli
config.cljdb.cljemails.cljhttp.cljhttp
main.cljmedia.cljmedia_storage.cljmetrics.cljmigrations.cljredis.cljservices
tasks.cljtasks
util
async.cljblob.cljcli.cljcloseable.cljdata.cljdispatcher.cljemails.cljhttp.cljmigrations.cljredis.cljsql.cljstorage.cljsvg.cljtemplate.cljtime.cljtransit.cljworkers.clj
worker.cljworker_impl.cljuxbox/services
tests
common/app/common
|
@ -80,11 +80,11 @@
|
|||
:args {}}
|
||||
|
||||
:fn-media-loader
|
||||
{:fn uxbox.cli.media-loader/run
|
||||
{:fn app.cli.media-loader/run
|
||||
:args {}}
|
||||
|
||||
:fn-fixtures
|
||||
{:fn uxbox.cli.fixtures/run
|
||||
{:fn app.cli.fixtures/run
|
||||
:args {}}
|
||||
|
||||
:lint
|
||||
|
|
|
@ -30,11 +30,11 @@
|
|||
<Logger name="io.lettuce" level="error" additivity="false" />
|
||||
|
||||
|
||||
<Logger name="uxbox.cli" level="debug" additivity="false">
|
||||
<Logger name="app.cli" level="debug" additivity="false">
|
||||
<AppenderRef ref="console"/>
|
||||
</Logger>
|
||||
|
||||
<Logger name="uxbox" level="debug" additivity="false">
|
||||
<Logger name="app" level="debug" additivity="false">
|
||||
<AppenderRef ref="file-debug" level="debug" />
|
||||
<AppenderRef ref="file" level="info" />
|
||||
</Logger>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
clojure -Adev -m uxbox.cli.collimp $@
|
||||
clojure -Adev -m app.cli.collimp $@
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
PGPASSWORD=$UXBOX_DATABASE_PASSWORD psql $UXBOX_DATABASE_URI -U $UXBOX_DATABASE_USERNAME
|
||||
PGPASSWORD=$app_DATABASE_PASSWORD psql $app_DATABASE_URI -U $app_DATABASE_USERNAME
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -xe
|
||||
clojure -Adev -m uxbox.tests.main;
|
||||
clojure -Adev -m app.tests.main;
|
||||
|
|
|
@ -4,10 +4,10 @@ set -e
|
|||
|
||||
if [ ! -e ~/local/.fixtures-loaded ]; then
|
||||
echo "Loading fixtures..."
|
||||
clojure -Adev -m uxbox.fixtures
|
||||
clojure -Adev -m app.fixtures
|
||||
touch ~/local/.fixtures-loaded
|
||||
fi
|
||||
|
||||
clojure -m uxbox.main
|
||||
clojure -m app.main
|
||||
|
||||
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
set -e
|
||||
|
||||
clojure -O:jmx-remote -A:dev -J-Xms100m -J-Xmx100m -J-XX:+AlwaysPreTouch -J-XX:+UseBiasedLocking -J-Duxbox.enable-asserts=false -J-Dclojure.compiler.direct-linking=true -J-Dclojure.server.repl='{:port 5555 :accept clojure.core.server/repl}' -m uxbox.main
|
||||
clojure -O:jmx-remote -A:dev -J-Xms100m -J-Xmx100m -J-XX:+AlwaysPreTouch -J-XX:+UseBiasedLocking -J-Dapp.enable-asserts=false -J-Dclojure.compiler.direct-linking=true -J-Dclojure.server.repl='{:port 5555 :accept clojure.core.server/repl}' -m app.main
|
||||
|
|
|
@ -7,20 +7,20 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.cli.fixtures
|
||||
(ns app.cli.fixtures
|
||||
"A initial fixtures."
|
||||
(:require
|
||||
[clojure.tools.logging :as log]
|
||||
[mount.core :as mount]
|
||||
[sodi.pwhash :as pwhash]
|
||||
[uxbox.common.data :as d]
|
||||
[uxbox.common.pages :as cp]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.migrations]
|
||||
[uxbox.services.mutations.profile :as profile]
|
||||
[uxbox.util.blob :as blob]))
|
||||
[app.common.data :as d]
|
||||
[app.common.pages :as cp]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.migrations]
|
||||
[app.services.mutations.profile :as profile]
|
||||
[app.util.blob :as blob]))
|
||||
|
||||
(defn- mk-uuid
|
||||
[prefix & args]
|
||||
|
@ -86,7 +86,7 @@
|
|||
:fullname (str "Profile " index)
|
||||
:password "123123"
|
||||
:demo? true
|
||||
:email (str "profile" index ".test@uxbox.io")})))
|
||||
:email (str "profile" index ".test@app.io")})))
|
||||
|
||||
create-profiles
|
||||
(fn [conn]
|
||||
|
@ -264,9 +264,9 @@
|
|||
[{:keys [preset]
|
||||
:or {preset :small}}]
|
||||
(try
|
||||
(-> (mount/only #{#'uxbox.config/config
|
||||
#'uxbox.db/pool
|
||||
#'uxbox.migrations/migrations})
|
||||
(-> (mount/only #{#'app.config/config
|
||||
#'app.db/pool
|
||||
#'app.migrations/migrations})
|
||||
(mount/start))
|
||||
(run* preset)
|
||||
(catch Exception e
|
|
@ -7,7 +7,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2016-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.cli.media-loader
|
||||
(ns app.cli.media-loader
|
||||
"Media libraries importer (command line helper)."
|
||||
(:require
|
||||
[clojure.tools.logging :as log]
|
||||
|
@ -15,17 +15,17 @@
|
|||
[clojure.java.io :as io]
|
||||
[mount.core :as mount]
|
||||
[datoteka.core :as fs]
|
||||
[uxbox.config]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.media]
|
||||
[uxbox.media-storage]
|
||||
[uxbox.migrations]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.services.mutations.projects :as projects]
|
||||
[uxbox.services.mutations.files :as files]
|
||||
[uxbox.services.mutations.colors :as colors]
|
||||
[uxbox.services.mutations.media :as media])
|
||||
[app.config]
|
||||
[app.common.spec :as us]
|
||||
[app.db :as db]
|
||||
[app.media]
|
||||
[app.media-storage]
|
||||
[app.migrations]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.services.mutations.projects :as projects]
|
||||
[app.services.mutations.files :as files]
|
||||
[app.services.mutations.colors :as colors]
|
||||
[app.services.mutations.media :as media])
|
||||
(:import
|
||||
java.io.PushbackReader))
|
||||
|
||||
|
@ -219,11 +219,11 @@
|
|||
(let [path (validate-path path)]
|
||||
|
||||
(try
|
||||
(-> (mount/only #{#'uxbox.config/config
|
||||
#'uxbox.db/pool
|
||||
#'uxbox.migrations/migrations
|
||||
#'uxbox.media/semaphore
|
||||
#'uxbox.media-storage/media-storage})
|
||||
(-> (mount/only #{#'app.config/config
|
||||
#'app.db/pool
|
||||
#'app.migrations/migrations
|
||||
#'app.media/semaphore
|
||||
#'app.media-storage/media-storage})
|
||||
(mount/start))
|
||||
(run* path)
|
||||
(catch Exception e
|
|
@ -7,7 +7,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.config
|
||||
(ns app.config
|
||||
"A configuration management."
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
|
@ -15,16 +15,16 @@
|
|||
[cuerdas.core :as str]
|
||||
[environ.core :refer [env]]
|
||||
[mount.core :refer [defstate]]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.util.time :as dt]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.util.time :as dt]))
|
||||
|
||||
(def defaults
|
||||
{:http-server-port 6060
|
||||
:http-server-cors "http://localhost:3449"
|
||||
:database-uri "postgresql://127.0.0.1/uxbox"
|
||||
:database-username "uxbox"
|
||||
:database-password "uxbox"
|
||||
:database-uri "postgresql://127.0.0.1/app"
|
||||
:database-username "app"
|
||||
:database-password "app"
|
||||
|
||||
:media-directory "resources/public/media"
|
||||
:assets-directory "resources/public/static"
|
||||
|
@ -161,7 +161,10 @@
|
|||
(fn [acc k v]
|
||||
(cond-> acc
|
||||
(str/starts-with? (name k) "uxbox-")
|
||||
(assoc (keyword (subs (name k) 6)) v)))
|
||||
(assoc (keyword (subs (name k) 6)) v)
|
||||
|
||||
(str/starts-with? (name k) "app-")
|
||||
(assoc (keyword (subs (name k) 4)) v)))
|
||||
{}
|
||||
env))
|
||||
|
||||
|
@ -175,9 +178,9 @@
|
|||
[env]
|
||||
(assoc (read-config env)
|
||||
:redis-uri "redis://redis/1"
|
||||
:database-uri "postgresql://postgres/uxbox_test"
|
||||
:media-directory "/tmp/uxbox/media"
|
||||
:assets-directory "/tmp/uxbox/static"
|
||||
:database-uri "postgresql://postgres/app_test"
|
||||
:media-directory "/tmp/app/media"
|
||||
:assets-directory "/tmp/app/static"
|
||||
:migrations-verbose false))
|
||||
|
||||
(defstate config
|
|
@ -4,7 +4,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.db
|
||||
(ns app.db
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.data.json :as json]
|
||||
|
@ -18,12 +18,12 @@
|
|||
[next.jdbc.result-set :as jdbc-rs]
|
||||
[next.jdbc.sql :as jdbc-sql]
|
||||
[next.jdbc.sql.builder :as jdbc-bld]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.metrics :as mtx]
|
||||
[uxbox.util.time :as dt]
|
||||
[uxbox.util.transit :as t]
|
||||
[uxbox.util.data :as data])
|
||||
[app.common.exceptions :as ex]
|
||||
[app.config :as cfg]
|
||||
[app.metrics :as mtx]
|
||||
[app.util.time :as dt]
|
||||
[app.util.transit :as t]
|
||||
[app.util.data :as data])
|
||||
(:import
|
||||
org.postgresql.util.PGobject
|
||||
org.postgresql.util.PGInterval
|
|
@ -7,17 +7,17 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.emails
|
||||
(ns app.emails
|
||||
"Main api for send emails."
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[promesa.core :as p]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.tasks :as tasks]
|
||||
[uxbox.util.emails :as emails]))
|
||||
[app.config :as cfg]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.db :as db]
|
||||
[app.tasks :as tasks]
|
||||
[app.util.emails :as emails]))
|
||||
|
||||
;; --- Defaults
|
||||
|
|
@ -7,24 +7,24 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.http
|
||||
(ns app.http
|
||||
(:require
|
||||
[clojure.tools.logging :as log]
|
||||
[mount.core :as mount :refer [defstate]]
|
||||
[reitit.ring :as rring]
|
||||
[ring.adapter.jetty9 :as jetty]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.http.auth :as auth]
|
||||
[uxbox.http.auth.google :as google]
|
||||
[uxbox.http.auth.ldap :as ldap]
|
||||
[uxbox.http.debug :as debug]
|
||||
[uxbox.http.errors :as errors]
|
||||
[uxbox.http.handlers :as handlers]
|
||||
[uxbox.http.middleware :as middleware]
|
||||
[uxbox.http.session :as session]
|
||||
[uxbox.http.ws :as ws]
|
||||
[uxbox.metrics :as mtx]
|
||||
[uxbox.services.notifications :as usn]))
|
||||
[app.config :as cfg]
|
||||
[app.http.auth :as auth]
|
||||
[app.http.auth.google :as google]
|
||||
[app.http.auth.ldap :as ldap]
|
||||
[app.http.debug :as debug]
|
||||
[app.http.errors :as errors]
|
||||
[app.http.handlers :as handlers]
|
||||
[app.http.middleware :as middleware]
|
||||
[app.http.session :as session]
|
||||
[app.http.ws :as ws]
|
||||
[app.metrics :as mtx]
|
||||
[app.services.notifications :as usn]))
|
||||
|
||||
(defn- create-router
|
||||
[]
|
|
@ -7,12 +7,12 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.http.auth
|
||||
(ns app.http.auth
|
||||
(:require
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.http.session :as session]
|
||||
[uxbox.services.mutations :as sm]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.http.session :as session]
|
||||
[app.services.mutations :as sm]))
|
||||
|
||||
(defn login-handler
|
||||
[req]
|
|
@ -7,18 +7,18 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.http.auth.google
|
||||
(ns app.http.auth.google
|
||||
(:require
|
||||
[clojure.data.json :as json]
|
||||
[clojure.tools.logging :as log]
|
||||
[lambdaisland.uri :as uri]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.tokens :as tokens]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.http.session :as session]
|
||||
[uxbox.util.http :as http]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.services.tokens :as tokens]
|
||||
[app.services.mutations :as sm]
|
||||
[app.http.session :as session]
|
||||
[app.util.http :as http]))
|
||||
|
||||
(def base-goauth-uri "https://accounts.google.com/o/oauth2/v2/auth")
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
(ns uxbox.http.auth.ldap
|
||||
(ns app.http.auth.ldap
|
||||
(:require
|
||||
[clj-ldap.client :as client]
|
||||
[clojure.set :as set]
|
||||
[mount.core :refer [defstate]]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.http.session :as session]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.config :as cfg]
|
||||
[app.services.mutations :as sm]
|
||||
[app.http.session :as session]
|
||||
[clojure.tools.logging :as log]))
|
||||
|
||||
|
|
@ -4,14 +4,14 @@
|
|||
;;
|
||||
;; Copyright (c) 2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.http.debug
|
||||
(ns app.http.debug
|
||||
"Debug related handlers."
|
||||
(:require
|
||||
[clojure.tools.logging :as log]
|
||||
[promesa.core :as p]
|
||||
[uxbox.http.errors :as errors]
|
||||
[uxbox.http.session :as session]
|
||||
[uxbox.common.uuid :as uuid]))
|
||||
[app.http.errors :as errors]
|
||||
[app.http.session :as session]
|
||||
[app.common.uuid :as uuid]))
|
||||
|
||||
(defn emails-list
|
||||
[req]
|
|
@ -4,12 +4,12 @@
|
|||
;;
|
||||
;; Copyright (c) 2016-2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.http.errors
|
||||
(ns app.http.errors
|
||||
"A errors handling for the http server."
|
||||
(:require
|
||||
[clojure.tools.logging :as log]
|
||||
[cuerdas.core :as str]
|
||||
[uxbox.metrics :as mtx]
|
||||
[app.metrics :as mtx]
|
||||
[io.aviso.exception :as e]))
|
||||
|
||||
(defmulti handle-exception
|
|
@ -7,14 +7,14 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.http.handlers
|
||||
(ns app.http.handlers
|
||||
(:require
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.emails :as emails]
|
||||
[uxbox.http.session :as session]
|
||||
[uxbox.services.init]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries :as sq]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.emails :as emails]
|
||||
[app.http.session :as session]
|
||||
[app.services.init]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.queries :as sq]))
|
||||
|
||||
(def unauthorized-services
|
||||
#{:create-demo-profile
|
|
@ -7,7 +7,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2019-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.http.middleware
|
||||
(ns app.http.middleware
|
||||
(:require
|
||||
[clojure.tools.logging :as log]
|
||||
[ring.middleware.cookies :refer [wrap-cookies]]
|
||||
|
@ -15,10 +15,10 @@
|
|||
[ring.middleware.multipart-params :refer [wrap-multipart-params]]
|
||||
[ring.middleware.params :refer [wrap-params]]
|
||||
[ring.middleware.resource :refer [wrap-resource]]
|
||||
[uxbox.metrics :as mtx]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.util.transit :as t]))
|
||||
[app.metrics :as mtx]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.config :as cfg]
|
||||
[app.util.transit :as t]))
|
||||
|
||||
(defn- wrap-parse-request-body
|
||||
[handler]
|
|
@ -7,10 +7,10 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.http.session
|
||||
(ns app.http.session
|
||||
(:require
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.tokens :as tokens]))
|
||||
[app.db :as db]
|
||||
[app.services.tokens :as tokens]))
|
||||
|
||||
(defn extract-auth-token
|
||||
[request]
|
|
@ -7,7 +7,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.http.ws
|
||||
(ns app.http.ws
|
||||
"Web Socket handlers"
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
|
@ -16,10 +16,10 @@
|
|||
[ring.middleware.cookies :refer [wrap-cookies]]
|
||||
[ring.middleware.keyword-params :refer [wrap-keyword-params]]
|
||||
[ring.middleware.params :refer [wrap-params]]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.http.session :refer [wrap-session]]
|
||||
[uxbox.services.notifications :as nf]))
|
||||
[app.common.spec :as us]
|
||||
[app.db :as db]
|
||||
[app.http.session :refer [wrap-session]]
|
||||
[app.services.notifications :as nf]))
|
||||
|
||||
(s/def ::file-id ::us/uuid)
|
||||
(s/def ::session-id ::us/uuid)
|
|
@ -7,13 +7,13 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.main
|
||||
(ns app.main
|
||||
(:require
|
||||
[mount.core :as mount]))
|
||||
|
||||
(defn- enable-asserts
|
||||
[_]
|
||||
(let [m (System/getProperty "uxbox.enable-asserts")]
|
||||
(let [m (System/getProperty "app.enable-asserts")]
|
||||
(or (nil? m) (= "true" m))))
|
||||
|
||||
;; Set value for all new threads bindings.
|
||||
|
@ -26,11 +26,11 @@
|
|||
|
||||
(defn run
|
||||
[params]
|
||||
(require 'uxbox.config
|
||||
'uxbox.migrations
|
||||
'uxbox.worker
|
||||
'uxbox.media
|
||||
'uxbox.http)
|
||||
(require 'app.config
|
||||
'app.migrations
|
||||
'app.worker
|
||||
'app.media
|
||||
'app.http)
|
||||
(mount/start))
|
||||
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.media
|
||||
(ns app.media
|
||||
"Media postprocessing."
|
||||
(:require
|
||||
[clojure.core.async :as a]
|
||||
|
@ -15,14 +15,14 @@
|
|||
[clojure.spec.alpha :as s]
|
||||
[datoteka.core :as fs]
|
||||
[mount.core :refer [defstate]]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.common.data :as d]
|
||||
[uxbox.common.media :as cm]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.media-storage :as mst]
|
||||
[uxbox.util.storage :as ust]
|
||||
[uxbox.util.http :as http])
|
||||
[app.config :as cfg]
|
||||
[app.common.data :as d]
|
||||
[app.common.media :as cm]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.media-storage :as mst]
|
||||
[app.util.storage :as ust]
|
||||
[app.util.http :as http])
|
||||
(:import
|
||||
java.io.ByteArrayInputStream
|
||||
java.io.InputStream
|
|
@ -7,15 +7,15 @@
|
|||
;;
|
||||
;; Copyright (c) 2017-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.media-storage
|
||||
"A media storage impl for uxbox."
|
||||
(ns app.media-storage
|
||||
"A media storage impl for app."
|
||||
(:require
|
||||
[mount.core :refer [defstate]]
|
||||
[clojure.java.io :as io]
|
||||
[cuerdas.core :as str]
|
||||
[datoteka.core :as fs]
|
||||
[uxbox.util.storage :as ust]
|
||||
[uxbox.config :refer [config]]))
|
||||
[app.util.storage :as ust]
|
||||
[app.config :refer [config]]))
|
||||
|
||||
;; --- State
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.metrics
|
||||
(ns app.metrics
|
||||
(:require
|
||||
[clojure.tools.logging :as log]
|
||||
[cuerdas.core :as str])
|
|
@ -7,12 +7,12 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.migrations
|
||||
(ns app.migrations
|
||||
(:require
|
||||
[mount.core :as mount :refer [defstate]]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.util.migrations :as mg]))
|
||||
[app.db :as db]
|
||||
[app.config :as cfg]
|
||||
[app.util.migrations :as mg]))
|
||||
|
||||
(def +migrations+
|
||||
{:name "uxbox-main"
|
|
@ -4,16 +4,16 @@
|
|||
;;
|
||||
;; Copyright (c) 2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.redis
|
||||
(ns app.redis
|
||||
(:refer-clojure :exclude [run!])
|
||||
(:require
|
||||
[clojure.tools.logging :as log]
|
||||
[lambdaisland.uri :refer [uri]]
|
||||
[mount.core :as mount :refer [defstate]]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.util.data :as data]
|
||||
[uxbox.util.redis :as redis])
|
||||
[app.common.exceptions :as ex]
|
||||
[app.config :as cfg]
|
||||
[app.util.data :as data]
|
||||
[app.util.redis :as redis])
|
||||
(:import
|
||||
java.lang.AutoCloseable))
|
||||
|
40
backend/src/app/services/init.clj
Normal file
40
backend/src/app/services/init.clj
Normal file
|
@ -0,0 +1,40 @@
|
|||
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
;;
|
||||
;; This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
;; defined by the Mozilla Public License, v. 2.0.
|
||||
;;
|
||||
;; Copyright (c) 2019-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns app.services.init
|
||||
"A initialization of services."
|
||||
(:require
|
||||
[mount.core :as mount :refer [defstate]]))
|
||||
|
||||
(defn- load-query-services
|
||||
[]
|
||||
(require 'app.services.queries.media)
|
||||
(require 'app.services.queries.colors)
|
||||
(require 'app.services.queries.projects)
|
||||
(require 'app.services.queries.files)
|
||||
(require 'app.services.queries.pages)
|
||||
(require 'app.services.queries.profile)
|
||||
(require 'app.services.queries.recent-files)
|
||||
(require 'app.services.queries.viewer))
|
||||
|
||||
(defn- load-mutation-services
|
||||
[]
|
||||
(require 'app.services.mutations.demo)
|
||||
(require 'app.services.mutations.media)
|
||||
(require 'app.services.mutations.colors)
|
||||
(require 'app.services.mutations.projects)
|
||||
(require 'app.services.mutations.files)
|
||||
(require 'app.services.mutations.pages)
|
||||
(require 'app.services.mutations.profile))
|
||||
|
||||
(defstate query-services
|
||||
:start (load-query-services))
|
||||
|
||||
(defstate mutation-services
|
||||
:start (load-mutation-services))
|
|
@ -7,16 +7,16 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.services.middleware
|
||||
(ns app.services.middleware
|
||||
"Common middleware for services."
|
||||
(:require
|
||||
[clojure.tools.logging :as log]
|
||||
[clojure.spec.alpha :as s]
|
||||
[cuerdas.core :as str]
|
||||
[expound.alpha :as expound]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.metrics :as mtx]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.metrics :as mtx]))
|
||||
|
||||
(defn wrap-spec
|
||||
[handler]
|
|
@ -7,10 +7,10 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.services.mutations
|
||||
(ns app.services.mutations
|
||||
(:require
|
||||
[uxbox.services.middleware :as middleware]
|
||||
[uxbox.util.dispatcher :as uds]))
|
||||
[app.services.middleware :as middleware]
|
||||
[app.util.dispatcher :as uds]))
|
||||
|
||||
(uds/defservice handle
|
||||
:dispatch-by ::type
|
|
@ -7,18 +7,18 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.mutations.colors
|
||||
(ns app.services.mutations.colors
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries.teams :as teams]
|
||||
[uxbox.tasks :as tasks]
|
||||
[uxbox.util.time :as dt]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.queries.teams :as teams]
|
||||
[app.tasks :as tasks]
|
||||
[app.util.time :as dt]))
|
||||
|
||||
;; --- Helpers & Specs
|
||||
|
|
@ -7,20 +7,20 @@
|
|||
;;
|
||||
;; Copyright (c) 2016-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.mutations.demo
|
||||
(ns app.services.mutations.demo
|
||||
"A demo specific mutations."
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[sodi.prng]
|
||||
[sodi.util]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.mutations.profile :as profile]
|
||||
[uxbox.tasks :as tasks]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.util.time :as tm]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.mutations.profile :as profile]
|
||||
[app.tasks :as tasks]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.util.time :as tm]))
|
||||
|
||||
(sm/defmutation ::create-demo-profile
|
||||
[_]
|
|
@ -7,24 +7,24 @@
|
|||
;;
|
||||
;; Copyright (c) 2019-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.mutations.files
|
||||
(ns app.services.mutations.files
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[datoteka.core :as fs]
|
||||
[promesa.core :as p]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.pages :as cp]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.mutations.projects :as proj]
|
||||
[uxbox.services.queries.files :as files]
|
||||
[uxbox.tasks :as tasks]
|
||||
[uxbox.util.blob :as blob]
|
||||
[uxbox.util.storage :as ust]
|
||||
[uxbox.util.time :as dt]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.pages :as cp]
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.mutations.projects :as proj]
|
||||
[app.services.queries.files :as files]
|
||||
[app.tasks :as tasks]
|
||||
[app.util.blob :as blob]
|
||||
[app.util.storage :as ust]
|
||||
[app.util.time :as dt]))
|
||||
|
||||
;; --- Helpers & Specs
|
||||
|
|
@ -7,23 +7,23 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.services.mutations.media
|
||||
(ns app.services.mutations.media
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[datoteka.core :as fs]
|
||||
[uxbox.common.media :as cm]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.media :as media]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries.teams :as teams]
|
||||
[uxbox.tasks :as tasks]
|
||||
[uxbox.media-storage :as mst]
|
||||
[uxbox.util.storage :as ust]
|
||||
[uxbox.util.time :as dt]))
|
||||
[app.common.media :as cm]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.media :as media]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.queries.teams :as teams]
|
||||
[app.tasks :as tasks]
|
||||
[app.media-storage :as mst]
|
||||
[app.util.storage :as ust]
|
||||
[app.util.time :as dt]))
|
||||
|
||||
(def thumbnail-options
|
||||
{:width 100
|
||||
|
@ -46,16 +46,16 @@
|
|||
(declare persist-media-object-on-fs)
|
||||
(declare persist-media-thumbnail-on-fs)
|
||||
|
||||
(s/def :uxbox$upload/filename ::us/string)
|
||||
(s/def :uxbox$upload/size ::us/integer)
|
||||
(s/def :uxbox$upload/content-type cm/valid-media-types)
|
||||
(s/def :uxbox$upload/tempfile any?)
|
||||
(s/def :app$upload/filename ::us/string)
|
||||
(s/def :app$upload/size ::us/integer)
|
||||
(s/def :app$upload/content-type cm/valid-media-types)
|
||||
(s/def :app$upload/tempfile any?)
|
||||
|
||||
(s/def ::upload
|
||||
(s/keys :req-un [:uxbox$upload/filename
|
||||
:uxbox$upload/size
|
||||
:uxbox$upload/tempfile
|
||||
:uxbox$upload/content-type]))
|
||||
(s/keys :req-un [:app$upload/filename
|
||||
:app$upload/size
|
||||
:app$upload/tempfile
|
||||
:app$upload/content-type]))
|
||||
|
||||
(s/def ::content ::upload)
|
||||
|
|
@ -7,25 +7,25 @@
|
|||
;;
|
||||
;; Copyright (c) 2019-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.mutations.pages
|
||||
(ns app.services.mutations.pages
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[uxbox.common.data :as d]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.pages :as cp]
|
||||
[uxbox.common.pages-migrations :as pmg]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries.files :as files]
|
||||
[uxbox.services.queries.pages :refer [decode-row]]
|
||||
[uxbox.tasks :as tasks]
|
||||
[uxbox.redis :as redis]
|
||||
[uxbox.util.blob :as blob]
|
||||
[uxbox.util.time :as dt]
|
||||
[uxbox.util.transit :as t]))
|
||||
[app.common.data :as d]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.pages :as cp]
|
||||
[app.common.pages-migrations :as pmg]
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.queries.files :as files]
|
||||
[app.services.queries.pages :refer [decode-row]]
|
||||
[app.tasks :as tasks]
|
||||
[app.redis :as redis]
|
||||
[app.util.blob :as blob]
|
||||
[app.util.time :as dt]
|
||||
[app.util.transit :as t]))
|
||||
|
||||
;; --- Helpers & Specs
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2016-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.mutations.profile
|
||||
(ns app.services.mutations.profile
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[cuerdas.core :as str]
|
||||
|
@ -17,25 +17,25 @@
|
|||
[sodi.prng]
|
||||
[sodi.pwhash]
|
||||
[sodi.util]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.common.media :as cm]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.emails :as emails]
|
||||
[uxbox.media :as media]
|
||||
[uxbox.media-storage :as mst]
|
||||
[uxbox.services.tokens :as tokens]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.mutations.media :as media-mutations]
|
||||
[uxbox.services.mutations.projects :as projects]
|
||||
[uxbox.services.mutations.teams :as teams]
|
||||
[uxbox.services.queries.profile :as profile]
|
||||
[uxbox.tasks :as tasks]
|
||||
[uxbox.util.blob :as blob]
|
||||
[uxbox.util.storage :as ust]
|
||||
[uxbox.util.time :as dt]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.common.media :as cm]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.emails :as emails]
|
||||
[app.media :as media]
|
||||
[app.media-storage :as mst]
|
||||
[app.services.tokens :as tokens]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.mutations.media :as media-mutations]
|
||||
[app.services.mutations.projects :as projects]
|
||||
[app.services.mutations.teams :as teams]
|
||||
[app.services.queries.profile :as profile]
|
||||
[app.tasks :as tasks]
|
||||
[app.util.blob :as blob]
|
||||
[app.util.storage :as ust]
|
||||
[app.util.time :as dt]))
|
||||
|
||||
;; --- Helpers & Specs
|
||||
|
|
@ -7,17 +7,17 @@
|
|||
;;
|
||||
;; Copyright (c) 2019-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.mutations.projects
|
||||
(ns app.services.mutations.projects
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.tasks :as tasks]
|
||||
[uxbox.util.blob :as blob]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.services.mutations :as sm]
|
||||
[app.tasks :as tasks]
|
||||
[app.util.blob :as blob]))
|
||||
|
||||
;; --- Helpers & Specs
|
||||
|
|
@ -7,15 +7,15 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.mutations.teams
|
||||
(ns app.services.mutations.teams
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.util.blob :as blob]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.db :as db]
|
||||
[app.services.mutations :as sm]
|
||||
[app.util.blob :as blob]))
|
||||
|
||||
;; --- Helpers & Specs
|
||||
|
|
@ -7,20 +7,20 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.services.notifications
|
||||
(ns app.services.notifications
|
||||
"A websocket based notifications mechanism."
|
||||
(:require
|
||||
[clojure.core.async :as a :refer [>! <!]]
|
||||
[clojure.tools.logging :as log]
|
||||
[promesa.core :as p]
|
||||
[ring.adapter.jetty9 :as jetty]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.redis :as redis]
|
||||
[uxbox.metrics :as mtx]
|
||||
[uxbox.util.time :as dt]
|
||||
[uxbox.util.transit :as t]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.db :as db]
|
||||
[app.redis :as redis]
|
||||
[app.metrics :as mtx]
|
||||
[app.util.time :as dt]
|
||||
[app.util.transit :as t]))
|
||||
|
||||
(defmacro go-try
|
||||
[& body]
|
|
@ -7,10 +7,10 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.services.queries
|
||||
(ns app.services.queries
|
||||
(:require
|
||||
[uxbox.services.middleware :as middleware]
|
||||
[uxbox.util.dispatcher :as uds]))
|
||||
[app.services.middleware :as middleware]
|
||||
[app.util.dispatcher :as uds]))
|
||||
|
||||
(uds/defservice handle
|
||||
:dispatch-by ::type
|
|
@ -7,19 +7,19 @@
|
|||
;;
|
||||
;; Copyright (c) 2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.queries.colors
|
||||
(ns app.services.queries.colors
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[promesa.core :as p]
|
||||
[promesa.exec :as px]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.services.queries.teams :as teams]
|
||||
[uxbox.util.blob :as blob]
|
||||
[uxbox.util.data :as data]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.db :as db]
|
||||
[app.services.queries :as sq]
|
||||
[app.services.queries.teams :as teams]
|
||||
[app.util.blob :as blob]
|
||||
[app.util.data :as data]))
|
||||
|
||||
;; --- Helpers & Specs
|
||||
|
|
@ -7,16 +7,16 @@
|
|||
;;
|
||||
;; Copyright (c) 2019-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.queries.files
|
||||
(ns app.services.queries.files
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[promesa.core :as p]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.media :as media]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.util.blob :as blob]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.db :as db]
|
||||
[app.media :as media]
|
||||
[app.services.queries :as sq]
|
||||
[app.util.blob :as blob]))
|
||||
|
||||
(declare decode-row)
|
||||
|
|
@ -7,15 +7,15 @@
|
|||
;;
|
||||
;; Copyright (c) 2019-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.queries.media
|
||||
(ns app.services.queries.media
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.media :as media]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.services.queries.teams :as teams]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.db :as db]
|
||||
[app.media :as media]
|
||||
[app.services.queries :as sq]
|
||||
[app.services.queries.teams :as teams]))
|
||||
|
||||
(s/def ::id ::us/uuid)
|
||||
(s/def ::name ::us/string)
|
|
@ -7,17 +7,17 @@
|
|||
;;
|
||||
;; Copyright (c) 2019-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.queries.pages
|
||||
(ns app.services.queries.pages
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[promesa.core :as p]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.pages-migrations :as pmg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.services.queries.files :as files]
|
||||
[uxbox.util.blob :as blob]))
|
||||
[app.common.spec :as us]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.pages-migrations :as pmg]
|
||||
[app.db :as db]
|
||||
[app.services.queries :as sq]
|
||||
[app.services.queries.files :as files]
|
||||
[app.util.blob :as blob]))
|
||||
|
||||
;; --- Helpers & Specs
|
||||
|
|
@ -4,16 +4,16 @@
|
|||
;;
|
||||
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.queries.profile
|
||||
(ns app.services.queries.profile
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.media :as media]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.util.blob :as blob]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.db :as db]
|
||||
[app.media :as media]
|
||||
[app.services.queries :as sq]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.util.blob :as blob]))
|
||||
|
||||
;; --- Helpers & Specs
|
||||
|
|
@ -4,14 +4,14 @@
|
|||
;;
|
||||
;; Copyright (c) 2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.queries.projects
|
||||
(ns app.services.queries.projects
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[promesa.core :as p]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.util.blob :as blob]))
|
||||
[app.common.spec :as us]
|
||||
[app.db :as db]
|
||||
[app.services.queries :as sq]
|
||||
[app.util.blob :as blob]))
|
||||
|
||||
(declare decode-row)
|
||||
|
|
@ -7,15 +7,15 @@
|
|||
;;
|
||||
;; Copyright (c) 2019-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.queries.recent-files
|
||||
(ns app.services.queries.recent-files
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[promesa.core :as p]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.services.queries.projects :refer [retrieve-projects]]
|
||||
[uxbox.services.queries.files :refer [decode-row]]))
|
||||
[app.db :as db]
|
||||
[app.common.spec :as us]
|
||||
[app.services.queries :as sq]
|
||||
[app.services.queries.projects :refer [retrieve-projects]]
|
||||
[app.services.queries.files :refer [decode-row]]))
|
||||
|
||||
(def ^:private sql:project-files-recent
|
||||
"select distinct
|
|
@ -7,15 +7,15 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.queries.teams
|
||||
(ns app.services.queries.teams
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.util.blob :as blob]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.db :as db]
|
||||
[app.services.queries :as sq]
|
||||
[app.util.blob :as blob]))
|
||||
|
||||
;; --- Team Edition Permissions
|
||||
|
|
@ -7,21 +7,21 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.services.queries.viewer
|
||||
(ns app.services.queries.viewer
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[promesa.core :as p]
|
||||
[promesa.exec :as px]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.services.queries.files :as files]
|
||||
[uxbox.services.queries.media :as media-queries]
|
||||
[uxbox.services.queries.pages :as pages]
|
||||
[uxbox.util.blob :as blob]
|
||||
[uxbox.util.data :as data]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.db :as db]
|
||||
[app.services.queries :as sq]
|
||||
[app.services.queries.files :as files]
|
||||
[app.services.queries.media :as media-queries]
|
||||
[app.services.queries.pages :as pages]
|
||||
[app.util.blob :as blob]
|
||||
[app.util.data :as data]))
|
||||
|
||||
;; --- Helpers & Specs
|
||||
|
|
@ -7,16 +7,16 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.services.tokens
|
||||
(ns app.services.tokens
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[cuerdas.core :as str]
|
||||
[sodi.prng]
|
||||
[sodi.util]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.util.time :as dt]
|
||||
[uxbox.db :as db]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.util.time :as dt]
|
||||
[app.db :as db]))
|
||||
|
||||
(defn next-token
|
||||
([] (next-token 96))
|
|
@ -7,16 +7,16 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.tasks
|
||||
(ns app.tasks
|
||||
(:require
|
||||
[cuerdas.core :as str]
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.tools.logging :as log]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.util.time :as dt]
|
||||
[uxbox.metrics :as mtx]))
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.db :as db]
|
||||
[app.util.time :as dt]
|
||||
[app.metrics :as mtx]))
|
||||
|
||||
(s/def ::name ::us/string)
|
||||
(s/def ::delay
|
|
@ -7,16 +7,16 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.tasks.delete-object
|
||||
(ns app.tasks.delete-object
|
||||
"Generic task for permanent deletion of objects."
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.tools.logging :as log]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.metrics :as mtx]
|
||||
[uxbox.util.storage :as ust]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.db :as db]
|
||||
[app.metrics :as mtx]
|
||||
[app.util.storage :as ust]))
|
||||
|
||||
(s/def ::type keyword?)
|
||||
(s/def ::id ::us/uuid)
|
|
@ -7,16 +7,16 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.tasks.delete-profile
|
||||
(ns app.tasks.delete-profile
|
||||
"Task for permanent deletion of profiles."
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.tools.logging :as log]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.metrics :as mtx]
|
||||
[uxbox.util.storage :as ust]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.db :as db]
|
||||
[app.metrics :as mtx]
|
||||
[app.util.storage :as ust]))
|
||||
|
||||
(declare delete-profile-data)
|
||||
(declare delete-teams)
|
|
@ -7,21 +7,21 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.tasks.gc
|
||||
(ns app.tasks.gc
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.tools.logging :as log]
|
||||
[cuerdas.core :as str]
|
||||
[postal.core :as postal]
|
||||
[promesa.core :as p]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.tasks :as tasks]
|
||||
[uxbox.media-storage :as mst]
|
||||
[uxbox.util.blob :as blob]
|
||||
[uxbox.util.storage :as ust]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.tasks :as tasks]
|
||||
[app.media-storage :as mst]
|
||||
[app.util.blob :as blob]
|
||||
[app.util.storage :as ust]))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Task: Remove deleted media
|
|
@ -7,7 +7,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.tasks.impl
|
||||
(ns app.tasks.impl
|
||||
"Async tasks implementation."
|
||||
(:require
|
||||
[cuerdas.core :as str]
|
||||
|
@ -15,13 +15,13 @@
|
|||
[clojure.spec.alpha :as s]
|
||||
[clojure.tools.logging :as log]
|
||||
[promesa.exec :as px]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.util.async :as aa]
|
||||
[uxbox.util.blob :as blob]
|
||||
[uxbox.util.time :as dt])
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.util.async :as aa]
|
||||
[app.util.blob :as blob]
|
||||
[app.util.time :as dt])
|
||||
(:import
|
||||
java.util.concurrent.ScheduledExecutorService
|
||||
java.util.concurrent.Executors
|
|
@ -7,16 +7,16 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.tasks.remove-media
|
||||
(ns app.tasks.remove-media
|
||||
"Demo accounts garbage collector."
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.tools.logging :as log]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.media-storage :as mst]
|
||||
[uxbox.metrics :as mtx]
|
||||
[uxbox.util.storage :as ust]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.media-storage :as mst]
|
||||
[app.metrics :as mtx]
|
||||
[app.util.storage :as ust]))
|
||||
|
||||
(s/def ::path ::us/not-empty-string)
|
||||
(s/def ::props
|
|
@ -7,16 +7,16 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.tasks.sendmail
|
||||
(ns app.tasks.sendmail
|
||||
(:require
|
||||
[clojure.data.json :as json]
|
||||
[clojure.tools.logging :as log]
|
||||
[postal.core :as postal]
|
||||
[uxbox.common.data :as d]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.metrics :as mtx]
|
||||
[uxbox.util.http :as http]))
|
||||
[app.common.data :as d]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.config :as cfg]
|
||||
[app.metrics :as mtx]
|
||||
[app.util.http :as http]))
|
||||
|
||||
(defmulti sendmail (fn [config email] (:sendmail-backend config)))
|
||||
|
||||
|
@ -91,7 +91,7 @@
|
|||
:context result))))
|
||||
|
||||
(defn handler
|
||||
{:uxbox.tasks/name "sendmail"}
|
||||
{:app.tasks/name "sendmail"}
|
||||
[{:keys [props] :as task}]
|
||||
(sendmail cfg/config props))
|
||||
|
|
@ -7,17 +7,17 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.tasks.trim-file
|
||||
(ns app.tasks.trim-file
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.tools.logging :as log]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.tasks :as tasks]
|
||||
[uxbox.util.blob :as blob]
|
||||
[uxbox.util.time :as dt]))
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.tasks :as tasks]
|
||||
[app.util.blob :as blob]
|
||||
[app.util.time :as dt]))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Task: Trim File
|
|
@ -4,7 +4,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.async
|
||||
(ns app.util.async
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.tools.logging :as log]
|
|
@ -7,10 +7,10 @@
|
|||
;;
|
||||
;; Copyright (c) 2016-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.blob
|
||||
(ns app.util.blob
|
||||
"A generic blob storage encoding. Mainly used for
|
||||
page data, page options and txlog payload storage."
|
||||
(:require [uxbox.util.transit :as t])
|
||||
(:require [app.util.transit :as t])
|
||||
(:import
|
||||
java.io.ByteArrayInputStream
|
||||
java.io.ByteArrayOutputStream
|
|
@ -1,4 +1,4 @@
|
|||
(ns uxbox.util.cli
|
||||
(ns app.util.cli
|
||||
"Command line interface helpers.")
|
||||
|
||||
(defn exit!
|
|
@ -4,7 +4,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.closeable
|
||||
(ns app.util.closeable
|
||||
"A closeable abstraction. A drop in replacement for
|
||||
clojure builtin `with-open` syntax abstraction."
|
||||
(:refer-clojure :exclude [with-open]))
|
|
@ -4,12 +4,12 @@
|
|||
;;
|
||||
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.data
|
||||
(ns app.util.data
|
||||
"Data transformations utils."
|
||||
(:require [clojure.walk :as walk]
|
||||
[cuerdas.core :as str]))
|
||||
|
||||
;; TODO: move to uxbox.common.helpers
|
||||
;; TODO: move to app.common.helpers
|
||||
|
||||
(defn dissoc-in
|
||||
[m [k & ks :as keys]]
|
|
@ -4,13 +4,13 @@
|
|||
;;
|
||||
;; Copyright (c) 2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.dispatcher
|
||||
(ns app.util.dispatcher
|
||||
"A generic service dispatcher implementation."
|
||||
(:refer-clojure :exclude [defmethod])
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[expound.alpha :as expound]
|
||||
[uxbox.common.exceptions :as ex])
|
||||
[app.common.exceptions :as ex])
|
||||
(:import
|
||||
clojure.lang.IDeref
|
||||
clojure.lang.MapEntry
|
|
@ -4,14 +4,14 @@
|
|||
;;
|
||||
;; Copyright (c) 2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.emails
|
||||
(ns app.util.emails
|
||||
(:require
|
||||
[clojure.java.io :as io]
|
||||
[clojure.spec.alpha :as s]
|
||||
[cuerdas.core :as str]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.util.template :as tmpl]))
|
||||
[app.common.spec :as us]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.util.template :as tmpl]))
|
||||
|
||||
;; --- Impl.
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.http
|
||||
(ns app.util.http
|
||||
"Http client abstraction layer."
|
||||
(:require
|
||||
[promesa.core :as p]
|
|
@ -4,7 +4,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.migrations
|
||||
(ns app.util.migrations
|
||||
(:require
|
||||
[clojure.tools.logging :as log]
|
||||
[clojure.java.io :as io]
|
|
@ -4,7 +4,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.redis
|
||||
(ns app.util.redis
|
||||
"Asynchronous posgresql client."
|
||||
(:refer-clojure :exclude [run!])
|
||||
(:require
|
|
@ -22,7 +22,7 @@
|
|||
;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(ns uxbox.util.sql
|
||||
(ns app.util.sql
|
||||
"A composable sql helpers."
|
||||
(:refer-clojure :exclude [test update set format])
|
||||
(:require [clojure.core :as c]
|
|
@ -7,7 +7,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.storage
|
||||
(ns app.util.storage
|
||||
"A local filesystem storage implementation."
|
||||
(:require
|
||||
[clojure.java.io :as io]
|
||||
|
@ -17,7 +17,7 @@
|
|||
[datoteka.proto :as fp]
|
||||
[sodi.prng :as sodi.prng]
|
||||
[sodi.util :as sodi.util]
|
||||
[uxbox.common.exceptions :as ex])
|
||||
[app.common.exceptions :as ex])
|
||||
(:import
|
||||
java.io.ByteArrayInputStream
|
||||
java.io.InputStream
|
|
@ -4,13 +4,13 @@
|
|||
;;
|
||||
;; Copyright (c) 2016-2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.svg
|
||||
(ns app.util.svg
|
||||
"Icons SVG parsing helpers."
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[cuerdas.core :as str]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.exceptions :as ex])
|
||||
[app.common.spec :as us]
|
||||
[app.common.exceptions :as ex])
|
||||
(:import
|
||||
org.jsoup.Jsoup
|
||||
org.jsoup.nodes.Attribute
|
|
@ -4,7 +4,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2016-2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.template
|
||||
(ns app.util.template
|
||||
"A lightweight abstraction over mustache.java template engine.
|
||||
The documentation can be found: http://mustache.github.io/mustache.5.html"
|
||||
(:require
|
||||
|
@ -13,7 +13,7 @@
|
|||
[clojure.java.io :as io]
|
||||
[cuerdas.core :as str]
|
||||
[selmer.parser :as sp]
|
||||
[uxbox.common.exceptions :as ex]))
|
||||
[app.common.exceptions :as ex]))
|
||||
|
||||
;; (sp/cache-off!)
|
||||
|
|
@ -7,10 +7,10 @@
|
|||
;;
|
||||
;; Copyright (c) 2016-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.time
|
||||
(ns app.util.time
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[app.common.exceptions :as ex]
|
||||
[cognitect.transit :as t])
|
||||
(:import
|
||||
java.time.Instant
|
||||
|
@ -79,7 +79,7 @@
|
|||
|
||||
(defmethod print-method Duration
|
||||
[mv ^java.io.Writer writer]
|
||||
(.write writer (str "#uxbox/duration \"" (.toString ^Duration mv) "\"")))
|
||||
(.write writer (str "#app/duration \"" (.toString ^Duration mv) "\"")))
|
||||
|
||||
(defmethod print-dup Duration [o w]
|
||||
(print-method o w))
|
||||
|
@ -212,7 +212,7 @@
|
|||
|
||||
(defmethod print-method CronExpression
|
||||
[mv ^java.io.Writer writer]
|
||||
(.write writer (str "#uxbox/cron \"" (.toString ^CronExpression mv) "\"")))
|
||||
(.write writer (str "#app/cron \"" (.toString ^CronExpression mv) "\"")))
|
||||
|
||||
(defmethod print-dup CronExpression
|
||||
[o w]
|
||||
|
@ -248,7 +248,7 @@
|
|||
|
||||
(defmethod print-method Instant
|
||||
[mv ^java.io.Writer writer]
|
||||
(.write writer (str "#uxbox/instant \"" (.toString ^Instant mv) "\"")))
|
||||
(.write writer (str "#app/instant \"" (.toString ^Instant mv) "\"")))
|
||||
|
||||
(defmethod print-dup Instant [o w]
|
||||
(print-method o w))
|
|
@ -7,22 +7,22 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.util.transit
|
||||
(ns app.util.transit
|
||||
(:require
|
||||
[cognitect.transit :as t]
|
||||
[clojure.java.io :as io]
|
||||
[linked.core :as lk]
|
||||
[uxbox.util.time :as dt]
|
||||
[uxbox.util.data :as data]
|
||||
[uxbox.common.geom.point :as gpt]
|
||||
[uxbox.common.geom.matrix :as gmt])
|
||||
[app.util.time :as dt]
|
||||
[app.util.data :as data]
|
||||
[app.common.geom.point :as gpt]
|
||||
[app.common.geom.matrix :as gmt])
|
||||
(:import
|
||||
linked.set.LinkedSet
|
||||
java.io.ByteArrayInputStream
|
||||
java.io.ByteArrayOutputStream
|
||||
java.io.File
|
||||
uxbox.common.geom.point.Point
|
||||
uxbox.common.geom.matrix.Matrix))
|
||||
app.common.geom.point.Point
|
||||
app.common.geom.matrix.Matrix))
|
||||
|
||||
;; --- Handlers
|
||||
|
|
@ -4,12 +4,12 @@
|
|||
;;
|
||||
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.util.workers
|
||||
(ns app.util.workers
|
||||
"A distributed asynchronous tasks queue implementation on top
|
||||
of PostgreSQL reliable advirsory locking mechanism."
|
||||
#_(:require
|
||||
[suricatta.core :as sc]
|
||||
[uxbox.db :as db]))
|
||||
[app.db :as db]))
|
||||
|
||||
;; (defn- poll-for-task
|
||||
;; [conn queue]
|
|
@ -7,39 +7,39 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.worker
|
||||
(ns app.worker
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.tools.logging :as log]
|
||||
[mount.core :as mount :refer [defstate]]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.metrics :as mtx]
|
||||
[uxbox.tasks.delete-object]
|
||||
[uxbox.tasks.delete-profile]
|
||||
[uxbox.tasks.gc]
|
||||
[uxbox.tasks.remove-media]
|
||||
[uxbox.tasks.sendmail]
|
||||
[uxbox.tasks.trim-file]
|
||||
[uxbox.util.time :as dt]
|
||||
[uxbox.worker-impl :as impl]))
|
||||
[app.common.spec :as us]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.metrics :as mtx]
|
||||
[app.tasks.delete-object]
|
||||
[app.tasks.delete-profile]
|
||||
[app.tasks.gc]
|
||||
[app.tasks.remove-media]
|
||||
[app.tasks.sendmail]
|
||||
[app.tasks.trim-file]
|
||||
[app.util.time :as dt]
|
||||
[app.worker-impl :as impl]))
|
||||
|
||||
;; --- State initialization
|
||||
|
||||
(def ^:private tasks
|
||||
{"delete-profile" #'uxbox.tasks.delete-profile/handler
|
||||
"delete-object" #'uxbox.tasks.delete-object/handler
|
||||
"remove-media" #'uxbox.tasks.remove-media/handler
|
||||
"sendmail" #'uxbox.tasks.sendmail/handler})
|
||||
{"delete-profile" #'app.tasks.delete-profile/handler
|
||||
"delete-object" #'app.tasks.delete-object/handler
|
||||
"remove-media" #'app.tasks.remove-media/handler
|
||||
"sendmail" #'app.tasks.sendmail/handler})
|
||||
|
||||
(def ^:private schedule
|
||||
[{:id "remove-deleted-media"
|
||||
:cron (dt/cron "0 0 0 */1 * ? *") ;; daily
|
||||
:fn #'uxbox.tasks.gc/remove-deleted-media}
|
||||
:fn #'app.tasks.gc/remove-deleted-media}
|
||||
{:id "trim-file"
|
||||
:cron (dt/cron "0 0 0 */1 * ? *") ;; daily
|
||||
:fn #'uxbox.tasks.trim-file/handler}
|
||||
:fn #'app.tasks.trim-file/handler}
|
||||
])
|
||||
|
||||
|
|
@ -7,21 +7,21 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.worker-impl
|
||||
(ns app.worker-impl
|
||||
(:require
|
||||
[cuerdas.core :as str]
|
||||
[clojure.core.async :as a]
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.tools.logging :as log]
|
||||
[promesa.exec :as px]
|
||||
[uxbox.common.exceptions :as ex]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.util.async :as aa]
|
||||
[uxbox.util.blob :as blob]
|
||||
[uxbox.util.time :as dt])
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.util.async :as aa]
|
||||
[app.util.blob :as blob]
|
||||
[app.util.time :as dt])
|
||||
(:import
|
||||
org.eclipse.jetty.util.thread.QueuedThreadPool
|
||||
java.util.concurrent.ExecutorService
|
|
@ -1,3 +1,3 @@
|
|||
{uxbox/instant uxbox.util.time/from-string
|
||||
uxbox/cron uxbox.util.time/cron
|
||||
uxbox/duration uxbox.util.time/duration}
|
||||
{app/instant app.util.time/from-string
|
||||
app/cron app.util.time/cron
|
||||
app/duration app.util.time/duration}
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
;;
|
||||
;; This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
;; defined by the Mozilla Public License, v. 2.0.
|
||||
;;
|
||||
;; Copyright (c) 2019-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.services.init
|
||||
"A initialization of services."
|
||||
(:require
|
||||
[mount.core :as mount :refer [defstate]]))
|
||||
|
||||
(defn- load-query-services
|
||||
[]
|
||||
(require 'uxbox.services.queries.media)
|
||||
(require 'uxbox.services.queries.colors)
|
||||
(require 'uxbox.services.queries.projects)
|
||||
(require 'uxbox.services.queries.files)
|
||||
(require 'uxbox.services.queries.pages)
|
||||
(require 'uxbox.services.queries.profile)
|
||||
(require 'uxbox.services.queries.recent-files)
|
||||
(require 'uxbox.services.queries.viewer))
|
||||
|
||||
(defn- load-mutation-services
|
||||
[]
|
||||
(require 'uxbox.services.mutations.demo)
|
||||
(require 'uxbox.services.mutations.media)
|
||||
(require 'uxbox.services.mutations.colors)
|
||||
(require 'uxbox.services.mutations.projects)
|
||||
(require 'uxbox.services.mutations.files)
|
||||
(require 'uxbox.services.mutations.pages)
|
||||
(require 'uxbox.services.mutations.profile))
|
||||
|
||||
(defstate query-services
|
||||
:start (load-query-services))
|
||||
|
||||
(defstate mutation-services
|
||||
:start (load-mutation-services))
|
Before ![]() (image error) Size: 305 KiB After ![]() (image error) Size: 305 KiB ![]() ![]() |
Before (image error) Size: 3.5 KiB After (image error) Size: 3.5 KiB |
Before (image error) Size: 2.1 KiB After (image error) Size: 2.1 KiB |
|
@ -1,4 +1,4 @@
|
|||
(ns uxbox.tests.helpers
|
||||
(ns app.tests.helpers
|
||||
(:require
|
||||
[clojure.java.io :as io]
|
||||
[clojure.spec.alpha :as s]
|
||||
|
@ -7,49 +7,49 @@
|
|||
[cuerdas.core :as str]
|
||||
[mount.core :as mount]
|
||||
[environ.core :refer [env]]
|
||||
[uxbox.common.pages :as cp]
|
||||
[uxbox.services.init]
|
||||
[uxbox.services.mutations.profile :as profile]
|
||||
[uxbox.services.mutations.projects :as projects]
|
||||
[uxbox.services.mutations.teams :as teams]
|
||||
[uxbox.services.mutations.files :as files]
|
||||
[uxbox.services.mutations.pages :as pages]
|
||||
[uxbox.services.mutations.colors :as colors]
|
||||
[uxbox.migrations]
|
||||
[uxbox.media]
|
||||
[uxbox.media-storage]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.util.blob :as blob]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.util.storage :as ust]
|
||||
[uxbox.config :as cfg])
|
||||
[app.common.pages :as cp]
|
||||
[app.services.init]
|
||||
[app.services.mutations.profile :as profile]
|
||||
[app.services.mutations.projects :as projects]
|
||||
[app.services.mutations.teams :as teams]
|
||||
[app.services.mutations.files :as files]
|
||||
[app.services.mutations.pages :as pages]
|
||||
[app.services.mutations.colors :as colors]
|
||||
[app.migrations]
|
||||
[app.media]
|
||||
[app.media-storage]
|
||||
[app.db :as db]
|
||||
[app.util.blob :as blob]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.util.storage :as ust]
|
||||
[app.config :as cfg])
|
||||
(:import org.postgresql.ds.PGSimpleDataSource))
|
||||
|
||||
(defn testing-datasource
|
||||
[]
|
||||
(doto (PGSimpleDataSource.)
|
||||
(.setServerName "postgres")
|
||||
(.setDatabaseName "uxbox_test")
|
||||
(.setUser "uxbox")
|
||||
(.setPassword "uxbox")))
|
||||
(.setDatabaseName "app_test")
|
||||
(.setUser "app")
|
||||
(.setPassword "app")))
|
||||
|
||||
(defn state-init
|
||||
[next]
|
||||
(let [config (cfg/read-test-config env)]
|
||||
(try
|
||||
(let [pool (testing-datasource)]
|
||||
(-> (mount/only #{#'uxbox.config/config
|
||||
#'uxbox.db/pool
|
||||
#'uxbox.redis/client
|
||||
#'uxbox.redis/conn
|
||||
#'uxbox.media/semaphore
|
||||
#'uxbox.services.init/query-services
|
||||
#'uxbox.services.init/mutation-services
|
||||
#'uxbox.migrations/migrations
|
||||
#'uxbox.media-storage/assets-storage
|
||||
#'uxbox.media-storage/media-storage})
|
||||
(mount/swap {#'uxbox.config/config config
|
||||
#'uxbox.db/pool pool})
|
||||
(-> (mount/only #{#'app.config/config
|
||||
#'app.db/pool
|
||||
#'app.redis/client
|
||||
#'app.redis/conn
|
||||
#'app.media/semaphore
|
||||
#'app.services.init/query-services
|
||||
#'app.services.init/mutation-services
|
||||
#'app.migrations/migrations
|
||||
#'app.media-storage/assets-storage
|
||||
#'app.media-storage/media-storage})
|
||||
(mount/swap {#'app.config/config config
|
||||
#'app.db/pool pool})
|
||||
(mount/start)))
|
||||
(next)
|
||||
(finally
|
||||
|
@ -70,8 +70,8 @@
|
|||
(try
|
||||
(next)
|
||||
(finally
|
||||
(ust/clear! uxbox.media-storage/media-storage)
|
||||
(ust/clear! uxbox.media-storage/assets-storage))))
|
||||
(ust/clear! app.media-storage/media-storage)
|
||||
(ust/clear! app.media-storage/assets-storage))))
|
||||
|
||||
(defn mk-uuid
|
||||
[prefix & args]
|
|
@ -5,17 +5,17 @@
|
|||
;; This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
;; defined by the Mozilla Public License, v. 2.0.
|
||||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
;; Copyright (c) 2020 app Labs SL
|
||||
|
||||
(ns uxbox.tests.test-common-pages
|
||||
(ns app.tests.test-common-pages
|
||||
(:require
|
||||
[clojure.test :as t]
|
||||
[clojure.pprint :refer [pprint]]
|
||||
[promesa.core :as p]
|
||||
[mockery.core :refer [with-mock]]
|
||||
[uxbox.common.pages :as cp]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.tests.helpers :as th]))
|
||||
[app.common.pages :as cp]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.tests.helpers :as th]))
|
||||
|
||||
(t/deftest process-change-set-option
|
||||
(let [data cp/default-page-data]
|
|
@ -4,20 +4,20 @@
|
|||
;;
|
||||
;; Copyright (c) 2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.tests.test-emails
|
||||
(ns app.tests.test-emails
|
||||
(:require
|
||||
[clojure.test :as t]
|
||||
[promesa.core :as p]
|
||||
[mockery.core :refer [with-mock]]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.emails :as emails]
|
||||
[uxbox.tests.helpers :as th]))
|
||||
[app.db :as db]
|
||||
[app.emails :as emails]
|
||||
[app.tests.helpers :as th]))
|
||||
|
||||
(t/use-fixtures :once th/state-init)
|
||||
(t/use-fixtures :each th/database-reset)
|
||||
|
||||
(t/deftest register-email-rendering
|
||||
(let [result (emails/render emails/register {:to "example@uxbox.io" :name "foo"})]
|
||||
(let [result (emails/render emails/register {:to "example@app.io" :name "foo"})]
|
||||
(t/is (map? result))
|
||||
(t/is (contains? result :subject))
|
||||
(t/is (contains? result :content))
|
||||
|
@ -26,18 +26,18 @@
|
|||
(t/is (vector? (:content result)))))
|
||||
|
||||
;; (t/deftest email-sending-and-sendmail-job
|
||||
;; (let [res @(emails/send! emails/register {:to "example@uxbox.io" :name "foo"})]
|
||||
;; (let [res @(emails/send! emails/register {:to "example@app.io" :name "foo"})]
|
||||
;; (t/is (nil? res)))
|
||||
;; (with-mock mock
|
||||
;; {:target 'uxbox.jobs.sendmail/impl-sendmail
|
||||
;; {:target 'app.jobs.sendmail/impl-sendmail
|
||||
;; :return (p/resolved nil)}
|
||||
|
||||
;; (let [res @(uxbox.jobs.sendmail/send-emails {})]
|
||||
;; (let [res @(app.jobs.sendmail/send-emails {})]
|
||||
;; (t/is (= 1 res))
|
||||
;; (t/is (:called? @mock))
|
||||
;; (t/is (= 1 (:call-count @mock))))
|
||||
|
||||
;; (let [res @(uxbox.jobs.sendmail/send-emails {})]
|
||||
;; (let [res @(app.jobs.sendmail/send-emails {})]
|
||||
;; (t/is (= 0 res))
|
||||
;; (t/is (:called? @mock))
|
||||
;; (t/is (= 1 (:call-count @mock))))))
|
|
@ -5,19 +5,19 @@
|
|||
;; This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
;; defined by the Mozilla Public License, v. 2.0.
|
||||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
;; Copyright (c) 2020 app Labs SL
|
||||
|
||||
(ns uxbox.tests.test-services-colors
|
||||
(ns app.tests.test-services-colors
|
||||
(:require
|
||||
[clojure.test :as t]
|
||||
[datoteka.core :as fs]
|
||||
[clojure.java.io :as io]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.util.storage :as ust]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.tests.helpers :as th]))
|
||||
[app.db :as db]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.queries :as sq]
|
||||
[app.util.storage :as ust]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.tests.helpers :as th]))
|
||||
|
||||
(t/use-fixtures :once th/state-init)
|
||||
(t/use-fixtures :each th/database-reset)
|
|
@ -5,19 +5,19 @@
|
|||
;; This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
;; defined by the Mozilla Public License, v. 2.0.
|
||||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
;; Copyright (c) 2020 app Labs SL
|
||||
|
||||
(ns uxbox.tests.test-services-files
|
||||
(ns app.tests.test-services-files
|
||||
(:require
|
||||
[clojure.test :as t]
|
||||
[datoteka.core :as fs]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.http :as http]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.tests.helpers :as th]
|
||||
[uxbox.util.storage :as ust]))
|
||||
[app.common.uuid :as uuid]
|
||||
[app.db :as db]
|
||||
[app.http :as http]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.queries :as sq]
|
||||
[app.tests.helpers :as th]
|
||||
[app.util.storage :as ust]))
|
||||
|
||||
(t/use-fixtures :once th/state-init)
|
||||
(t/use-fixtures :each th/database-reset)
|
||||
|
@ -109,7 +109,7 @@
|
|||
error-data (ex-data error)]
|
||||
(t/is (th/ex-info? error))
|
||||
(t/is (= (:type error-data) :service-error))
|
||||
(t/is (= (:name error-data) :uxbox.services.queries.files/file)))
|
||||
(t/is (= (:name error-data) :app.services.queries.files/file)))
|
||||
|
||||
(let [error (ex-cause (:error out))
|
||||
error-data (ex-data error)]
|
|
@ -5,18 +5,18 @@
|
|||
;; This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
;; defined by the Mozilla Public License, v. 2.0.
|
||||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
;; Copyright (c) 2020 app Labs SL
|
||||
|
||||
(ns uxbox.tests.test-services-media
|
||||
(ns app.tests.test-services-media
|
||||
(:require
|
||||
[clojure.test :as t]
|
||||
[datoteka.core :as fs]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.tests.helpers :as th]
|
||||
[uxbox.util.storage :as ust]))
|
||||
[app.common.uuid :as uuid]
|
||||
[app.db :as db]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.queries :as sq]
|
||||
[app.tests.helpers :as th]
|
||||
[app.util.storage :as ust]))
|
||||
|
||||
(t/use-fixtures :once th/state-init)
|
||||
(t/use-fixtures :each th/database-reset)
|
||||
|
@ -30,7 +30,7 @@
|
|||
object-id-2 (uuid/next)]
|
||||
|
||||
(t/testing "create media object from url to file"
|
||||
(let [url "https://raw.githubusercontent.com/uxbox/uxbox/develop/frontend/resources/images/penpot-login.jpg"
|
||||
(let [url "https://raw.githubusercontent.com/app/app/develop/frontend/resources/images/penpot-login.jpg"
|
||||
data {::sm/type :add-media-object-from-url
|
||||
:id object-id-1
|
||||
:profile-id (:id prof)
|
||||
|
@ -54,7 +54,7 @@
|
|||
|
||||
(t/testing "upload media object to file"
|
||||
(let [content {:filename "sample.jpg"
|
||||
:tempfile (th/tempfile "uxbox/tests/_files/sample.jpg")
|
||||
:tempfile (th/tempfile "app/tests/_files/sample.jpg")
|
||||
:content-type "image/jpeg"
|
||||
:size 312043}
|
||||
data {::sm/type :upload-media-object
|
|
@ -5,20 +5,20 @@
|
|||
;; This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
;; defined by the Mozilla Public License, v. 2.0.
|
||||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
;; Copyright (c) 2020 app Labs SL
|
||||
|
||||
(ns uxbox.tests.test-services-pages
|
||||
(ns app.tests.test-services-pages
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.test :as t]
|
||||
[promesa.core :as p]
|
||||
[uxbox.common.pages :as cp]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.http :as http]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.tests.helpers :as th]))
|
||||
[app.common.pages :as cp]
|
||||
[app.db :as db]
|
||||
[app.http :as http]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.queries :as sq]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.tests.helpers :as th]))
|
||||
|
||||
(t/use-fixtures :once th/state-init)
|
||||
(t/use-fixtures :each th/database-reset)
|
||||
|
@ -168,7 +168,7 @@
|
|||
error-data (ex-data error)]
|
||||
(t/is (th/ex-info? error))
|
||||
(t/is (= (:type error-data) :service-error))
|
||||
(t/is (= (:name error-data) :uxbox.services.mutations.pages/update-page)))
|
||||
(t/is (= (:name error-data) :app.services.mutations.pages/update-page)))
|
||||
|
||||
(let [error (ex-cause (:error out))
|
||||
error-data (ex-data error)]
|
|
@ -7,18 +7,18 @@
|
|||
;;
|
||||
;; Copyright (c) 2019-2020 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.tests.test-services-profile
|
||||
(ns app.tests.test-services-profile
|
||||
(:require
|
||||
[clojure.test :as t]
|
||||
[clojure.java.io :as io]
|
||||
[mockery.core :refer [with-mocks]]
|
||||
[cuerdas.core :as str]
|
||||
[datoteka.core :as fs]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.services.mutations.profile :as profile]
|
||||
[uxbox.tests.helpers :as th]))
|
||||
[app.db :as db]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.queries :as sq]
|
||||
[app.services.mutations.profile :as profile]
|
||||
[app.tests.helpers :as th]))
|
||||
|
||||
(t/use-fixtures :once th/state-init)
|
||||
(t/use-fixtures :each th/database-reset)
|
||||
|
@ -40,7 +40,7 @@
|
|||
(let [error (ex-cause (:error out))]
|
||||
(t/is (th/ex-info? error))
|
||||
(t/is (th/ex-of-type? error :validation))
|
||||
(t/is (th/ex-of-code? error :uxbox.services.mutations.profile/wrong-credentials)))))
|
||||
(t/is (th/ex-of-code? error :app.services.mutations.profile/wrong-credentials)))))
|
||||
|
||||
(t/testing "success"
|
||||
(let [event {::sm/type :login
|
||||
|
@ -98,7 +98,7 @@
|
|||
:profile-id (:id profile)
|
||||
:file {:filename "sample.jpg"
|
||||
:size 123123
|
||||
:tempfile "tests/uxbox/tests/_files/sample.jpg"
|
||||
:tempfile "tests/app/tests/_files/sample.jpg"
|
||||
:content-type "image/jpeg"}}
|
||||
out (th/try-on! (sm/handle data))]
|
||||
|
||||
|
@ -116,7 +116,7 @@
|
|||
|
||||
;; (t/testing "try to delete profile not marked for deletion"
|
||||
;; (let [params {:props {:profile-id (:id prof)}}
|
||||
;; out (th/try-on! (uxbox.tasks.delete-profile/handler params))]
|
||||
;; out (th/try-on! (app.tasks.delete-profile/handler params))]
|
||||
|
||||
;; ;; (th/print-result! out)
|
||||
;; (t/is (nil? (:error out)))
|
||||
|
@ -135,7 +135,7 @@
|
|||
|
||||
;; (t/testing "mark profile for deletion"
|
||||
;; (with-mocks
|
||||
;; [mock {:target 'uxbox.tasks/schedule! :return nil}]
|
||||
;; [mock {:target 'app.tasks/schedule! :return nil}]
|
||||
|
||||
;; (let [data {::sm/type :delete-profile
|
||||
;; :profile-id (:id prof)}
|
||||
|
@ -163,7 +163,7 @@
|
|||
|
||||
;; (t/testing "try to delete profile marked for deletion"
|
||||
;; (let [params {:props {:profile-id (:id prof)}}
|
||||
;; out (th/try-on! (uxbox.tasks.delete-profile/handler params))]
|
||||
;; out (th/try-on! (app.tasks.delete-profile/handler params))]
|
||||
|
||||
;; ;; (th/print-result! out)
|
||||
;; (t/is (nil? (:error out)))
|
||||
|
@ -180,7 +180,7 @@
|
|||
;; error-data (ex-data error)]
|
||||
;; (t/is (th/ex-info? error))
|
||||
;; (t/is (= (:type error-data) :service-error))
|
||||
;; (t/is (= (:name error-data) :uxbox.services.queries.profile/profile)))
|
||||
;; (t/is (= (:name error-data) :app.services.queries.profile/profile)))
|
||||
|
||||
;; (let [error (ex-cause (:error out))
|
||||
;; error-data (ex-data error)]
|
|
@ -1,13 +1,13 @@
|
|||
(ns uxbox.tests.test-services-projects
|
||||
(ns app.tests.test-services-projects
|
||||
(:require
|
||||
[clojure.test :as t]
|
||||
[promesa.core :as p]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.http :as http]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.tests.helpers :as th]
|
||||
[uxbox.common.uuid :as uuid]))
|
||||
[app.db :as db]
|
||||
[app.http :as http]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.queries :as sq]
|
||||
[app.tests.helpers :as th]
|
||||
[app.common.uuid :as uuid]))
|
||||
|
||||
(t/use-fixtures :once th/state-init)
|
||||
(t/use-fixtures :each th/database-reset)
|
|
@ -1,13 +1,13 @@
|
|||
(ns uxbox.tests.test-services-user-attrs
|
||||
(ns app.tests.test-services-user-attrs
|
||||
(:require
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.test :as t]
|
||||
[promesa.core :as p]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.http :as http]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.tests.helpers :as th]))
|
||||
[app.db :as db]
|
||||
[app.http :as http]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.queries :as sq]
|
||||
[app.tests.helpers :as th]))
|
||||
|
||||
;; (t/use-fixtures :once th/state-init)
|
||||
;; (t/use-fixtures :each th/database-reset)
|
|
@ -5,19 +5,19 @@
|
|||
;; This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
;; defined by the Mozilla Public License, v. 2.0.
|
||||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
;; Copyright (c) 2020 app Labs SL
|
||||
|
||||
(ns uxbox.tests.test-services-viewer
|
||||
(ns app.tests.test-services-viewer
|
||||
(:require
|
||||
[clojure.test :as t]
|
||||
[datoteka.core :as fs]
|
||||
[uxbox.common.uuid :as uuid]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.http :as http]
|
||||
[uxbox.services.mutations :as sm]
|
||||
[uxbox.services.queries :as sq]
|
||||
[uxbox.tests.helpers :as th]
|
||||
[uxbox.util.storage :as ust]))
|
||||
[app.common.uuid :as uuid]
|
||||
[app.db :as db]
|
||||
[app.http :as http]
|
||||
[app.services.mutations :as sm]
|
||||
[app.services.queries :as sq]
|
||||
[app.tests.helpers :as th]
|
||||
[app.util.storage :as ust]))
|
||||
|
||||
(t/use-fixtures :once th/state-init)
|
||||
(t/use-fixtures :each th/database-reset)
|
||||
|
@ -71,7 +71,7 @@
|
|||
error-data (ex-data error)]
|
||||
(t/is (th/ex-info? error))
|
||||
(t/is (= (:type error-data) :service-error))
|
||||
(t/is (= (:name error-data) :uxbox.services.queries.viewer/viewer-bundle)))
|
||||
(t/is (= (:name error-data) :app.services.queries.viewer/viewer-bundle)))
|
||||
|
||||
(let [error (ex-cause (:error out))
|
||||
error-data (ex-data error)]
|
|
@ -1,13 +1,13 @@
|
|||
(ns uxbox.tests.test-util-svg
|
||||
(ns app.tests.test-util-svg
|
||||
(:require
|
||||
[clojure.test :as t]
|
||||
[clojure.java.io :as io]
|
||||
[uxbox.http :as http]
|
||||
[uxbox.util.svg :as svg]
|
||||
[uxbox.tests.helpers :as th]))
|
||||
[app.http :as http]
|
||||
[app.util.svg :as svg]
|
||||
[app.tests.helpers :as th]))
|
||||
|
||||
(t/deftest parse-svg-1
|
||||
(let [result (-> (io/resource "uxbox/tests/_files/sample1.svg")
|
||||
(let [result (-> (io/resource "app/tests/_files/sample1.svg")
|
||||
(svg/parse))]
|
||||
(t/is (contains? result :width))
|
||||
(t/is (contains? result :height))
|
||||
|
@ -20,7 +20,7 @@
|
|||
(t/is (= "lock.svg" (:name result)))))
|
||||
|
||||
(t/deftest parse-svg-2
|
||||
(let [result (-> (io/resource "uxbox/tests/_files/sample2.svg")
|
||||
(let [result (-> (io/resource "app/tests/_files/sample2.svg")
|
||||
(svg/parse))]
|
||||
(t/is (contains? result :width))
|
||||
(t/is (contains? result :height))
|
||||
|
@ -33,7 +33,7 @@
|
|||
(t/is (= "play.svg" (:name result)))))
|
||||
|
||||
(t/deftest parse-invalid-svg-1
|
||||
(let [image (io/resource "uxbox/tests/_files/sample.jpg")
|
||||
(let [image (io/resource "app/tests/_files/sample.jpg")
|
||||
out (th/try! (svg/parse image))]
|
||||
|
||||
(let [error (:error out)]
|
|
@ -15,16 +15,16 @@
|
|||
[clojure.pprint :refer [pprint]]
|
||||
[clojure.test :as test]
|
||||
[clojure.java.io :as io]
|
||||
[uxbox.common.pages :as cp]
|
||||
[app.common.pages :as cp]
|
||||
[clojure.repl :refer :all]
|
||||
[criterium.core :refer [quick-bench bench with-progress-reporting]]
|
||||
[clj-kondo.core :as kondo]
|
||||
[uxbox.migrations]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.metrics :as mtx]
|
||||
[uxbox.util.storage :as st]
|
||||
[uxbox.util.time :as tm]
|
||||
[uxbox.util.blob :as blob]
|
||||
[app.migrations]
|
||||
[app.db :as db]
|
||||
[app.metrics :as mtx]
|
||||
[app.util.storage :as st]
|
||||
[app.util.time :as tm]
|
||||
[app.util.blob :as blob]
|
||||
[mount.core :as mount]))
|
||||
|
||||
;; --- Benchmarking Tools
|
||||
|
@ -49,7 +49,7 @@
|
|||
|
||||
(defn- start
|
||||
[]
|
||||
(-> #_(mount/except #{#'uxbox.scheduled-jobs/scheduler})
|
||||
(-> #_(mount/except #{#'app.scheduled-jobs/scheduler})
|
||||
(mount/start)))
|
||||
|
||||
(defn- stop
|
||||
|
@ -62,7 +62,7 @@
|
|||
(repl/refresh :after 'user/start))
|
||||
|
||||
(defn- run-tests
|
||||
([] (run-tests #"^uxbox.tests.*"))
|
||||
([] (run-tests #"^app.tests.*"))
|
||||
([o]
|
||||
(repl/refresh)
|
||||
(cond
|
||||
|
@ -83,8 +83,8 @@
|
|||
:cache false
|
||||
:config {:linters
|
||||
{:unresolved-symbol
|
||||
{:exclude ['(uxbox.services.mutations/defmutation)
|
||||
'(uxbox.services.queries/defquery)
|
||||
'(uxbox.db/with-atomic)
|
||||
{:exclude ['(app.services.mutations/defmutation)
|
||||
'(app.services.queries/defquery)
|
||||
'(app.db/with-atomic)
|
||||
'(promesa.core/let)]}}}})
|
||||
(kondo/print!))))
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2016-2019 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.common.data
|
||||
(ns app.common.data
|
||||
"Data manipulation and query helper functions."
|
||||
(:refer-clojure :exclude [concat read-string])
|
||||
(:require [clojure.set :as set]
|
|
@ -4,7 +4,7 @@
|
|||
;;
|
||||
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
|
||||
|
||||
(ns uxbox.common.exceptions
|
||||
(ns app.common.exceptions
|
||||
"A helpers for work with exceptions."
|
||||
(:require [clojure.spec.alpha :as s]))
|
||||
|
|
@ -7,11 +7,11 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.common.geom.matrix
|
||||
(ns app.common.geom.matrix
|
||||
(:require
|
||||
[cuerdas.core :as str]
|
||||
[uxbox.common.math :as mth]
|
||||
[uxbox.common.geom.point :as gpt]))
|
||||
[app.common.math :as mth]
|
||||
[app.common.geom.point :as gpt]))
|
||||
|
||||
;; --- Matrix Impl
|
||||
|
|
@ -7,13 +7,13 @@
|
|||
;;
|
||||
;; Copyright (c) 2020 UXBOX Labs SL
|
||||
|
||||
(ns uxbox.common.geom.point
|
||||
(ns app.common.geom.point
|
||||
(:refer-clojure :exclude [divide min max])
|
||||
(:require
|
||||
#?(:cljs [cljs.core :as c]
|
||||
:clj [clojure.core :as c])
|
||||
[cuerdas.core :as str]
|
||||
[uxbox.common.math :as mth]))
|
||||
[app.common.math :as mth]))
|
||||
|
||||
;; --- Point Impl
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue