diff --git a/backend/src/uxbox/fixtures.clj b/backend/src/uxbox/fixtures.clj index 9b0013a3e..a0196f632 100644 --- a/backend/src/uxbox/fixtures.clj +++ b/backend/src/uxbox/fixtures.clj @@ -20,12 +20,12 @@ [uxbox.migrations] [uxbox.services.mutations.profile :as mt.profile] [uxbox.util.blob :as blob] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [vertx.util :as vu])) (defn- mk-uuid [prefix & args] - (uuid/namespaced uuid/oid (apply str prefix (interpose "-" args)))) + (uuid/namespaced uuid/zero (apply str prefix (interpose "-" args)))) ;; --- Profiles creation diff --git a/backend/src/uxbox/http/debug.clj b/backend/src/uxbox/http/debug.clj index 5aa3a3406..c02eb676e 100644 --- a/backend/src/uxbox/http/debug.clj +++ b/backend/src/uxbox/http/debug.clj @@ -11,7 +11,7 @@ [promesa.core :as p] [uxbox.http.errors :as errors] [uxbox.http.session :as session] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) (defn emails-list [req] diff --git a/backend/src/uxbox/http/handlers.clj b/backend/src/uxbox/http/handlers.clj index b1403d8ab..d620c8fbb 100644 --- a/backend/src/uxbox/http/handlers.clj +++ b/backend/src/uxbox/http/handlers.clj @@ -13,7 +13,7 @@ [uxbox.services.init] [uxbox.services.mutations :as sm] [uxbox.services.queries :as sq] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [vertx.web :as vw] [vertx.eventbus :as ve])) @@ -75,7 +75,7 @@ (defn logout-handler [req] (some-> (get-in req [:cookies "auth-token"]) - (uuid/from-string) + (uuid/uuid) (session/delete) (p/then' (fn [token] {:status 204 diff --git a/backend/src/uxbox/http/session.clj b/backend/src/uxbox/http/session.clj index 0c3af0560..0f48e8c34 100644 --- a/backend/src/uxbox/http/session.clj +++ b/backend/src/uxbox/http/session.clj @@ -9,7 +9,7 @@ [promesa.core :as p] [vertx.core :as vc] [uxbox.db :as db] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) ;; --- Main API @@ -40,7 +40,7 @@ [request] (try (when-let [token (get-in request [:cookies "auth-token"])] - (uuid/from-string token)) + (uuid/uuid token)) (catch java.lang.IllegalArgumentException e nil))) diff --git a/backend/src/uxbox/http/ws.clj b/backend/src/uxbox/http/ws.clj index 7ee867294..e4aa0fb9d 100644 --- a/backend/src/uxbox/http/ws.clj +++ b/backend/src/uxbox/http/ws.clj @@ -17,7 +17,7 @@ [uxbox.services.queries :as sq] [uxbox.util.blob :as blob] [uxbox.util.transit :as t] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [vertx.eventbus :as ve] [vertx.http :as vh] [vertx.util :as vu] diff --git a/backend/src/uxbox/media_loader.clj b/backend/src/uxbox/media_loader.clj index 8f42844ac..feb9d06c2 100644 --- a/backend/src/uxbox/media_loader.clj +++ b/backend/src/uxbox/media_loader.clj @@ -28,7 +28,7 @@ [uxbox.util.svg :as svg] [uxbox.util.transit :as t] [uxbox.util.blob :as blob] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.data :as data] [uxbox.services.mutations.colors :as colors] [uxbox.services.mutations.icons :as icons] diff --git a/backend/src/uxbox/services/mutations/colors.clj b/backend/src/uxbox/services/mutations/colors.clj index 9a48a7d7c..1da36b1e2 100644 --- a/backend/src/uxbox/services/mutations/colors.clj +++ b/backend/src/uxbox/services/mutations/colors.clj @@ -18,7 +18,7 @@ [uxbox.services.queries.teams :as teams] [uxbox.services.mutations :as sm] [uxbox.services.util :as su] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) ;; --- Helpers & Specs diff --git a/backend/src/uxbox/services/mutations/demo.clj b/backend/src/uxbox/services/mutations/demo.clj index 8f88c7111..ea0a5ae56 100644 --- a/backend/src/uxbox/services/mutations/demo.clj +++ b/backend/src/uxbox/services/mutations/demo.clj @@ -19,7 +19,7 @@ [uxbox.services.mutations :as sm] [uxbox.services.mutations.profile :as profile] [uxbox.tasks :as tasks] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.time :as tm])) (sm/defmutation ::create-demo-profile diff --git a/backend/src/uxbox/services/mutations/files.clj b/backend/src/uxbox/services/mutations/files.clj index 726410925..21c162bad 100644 --- a/backend/src/uxbox/services/mutations/files.clj +++ b/backend/src/uxbox/services/mutations/files.clj @@ -26,7 +26,7 @@ [uxbox.services.mutations.images :as imgs] [uxbox.services.util :as su] [uxbox.util.blob :as blob] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.storage :as ust] [vertx.util :as vu])) diff --git a/backend/src/uxbox/services/mutations/icons.clj b/backend/src/uxbox/services/mutations/icons.clj index 5c7329e13..a6b16e200 100644 --- a/backend/src/uxbox/services/mutations/icons.clj +++ b/backend/src/uxbox/services/mutations/icons.clj @@ -20,7 +20,7 @@ [uxbox.services.util :as su] [uxbox.tasks :as tasks] [uxbox.util.blob :as blob] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) ;; --- Helpers & Specs diff --git a/backend/src/uxbox/services/mutations/images.clj b/backend/src/uxbox/services/mutations/images.clj index f0f6c2861..a0242d6b6 100644 --- a/backend/src/uxbox/services/mutations/images.clj +++ b/backend/src/uxbox/services/mutations/images.clj @@ -22,7 +22,7 @@ [uxbox.services.queries.teams :as teams] [uxbox.services.mutations :as sm] [uxbox.services.util :as su] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.storage :as ust] [vertx.util :as vu])) diff --git a/backend/src/uxbox/services/mutations/pages.clj b/backend/src/uxbox/services/mutations/pages.clj index 0cf60aa9e..5ea32c3f7 100644 --- a/backend/src/uxbox/services/mutations/pages.clj +++ b/backend/src/uxbox/services/mutations/pages.clj @@ -23,7 +23,7 @@ [uxbox.tasks :as tasks] [uxbox.util.blob :as blob] [uxbox.util.sql :as sql] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [vertx.eventbus :as ve])) ;; --- Helpers & Specs diff --git a/backend/src/uxbox/services/mutations/profile.clj b/backend/src/uxbox/services/mutations/profile.clj index c5b00e599..dfe0ffd42 100644 --- a/backend/src/uxbox/services/mutations/profile.clj +++ b/backend/src/uxbox/services/mutations/profile.clj @@ -33,7 +33,7 @@ [uxbox.services.util :as su] [uxbox.util.blob :as blob] [uxbox.util.storage :as ust] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.time :as tm] [vertx.util :as vu])) diff --git a/backend/src/uxbox/services/mutations/projects.clj b/backend/src/uxbox/services/mutations/projects.clj index 5eae542c8..12214ed1b 100644 --- a/backend/src/uxbox/services/mutations/projects.clj +++ b/backend/src/uxbox/services/mutations/projects.clj @@ -19,7 +19,7 @@ [uxbox.services.mutations :as sm] [uxbox.services.util :as su] [uxbox.util.blob :as blob] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) ;; --- Helpers & Specs diff --git a/backend/src/uxbox/services/mutations/teams.clj b/backend/src/uxbox/services/mutations/teams.clj index 0c88ca28a..fb375580e 100644 --- a/backend/src/uxbox/services/mutations/teams.clj +++ b/backend/src/uxbox/services/mutations/teams.clj @@ -17,7 +17,7 @@ [uxbox.services.mutations :as sm] [uxbox.services.util :as su] [uxbox.util.blob :as blob] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) ;; --- Helpers & Specs diff --git a/backend/src/uxbox/services/queries/colors.clj b/backend/src/uxbox/services/queries/colors.clj index afe78209d..620ac7463 100644 --- a/backend/src/uxbox/services/queries/colors.clj +++ b/backend/src/uxbox/services/queries/colors.clj @@ -22,7 +22,7 @@ [uxbox.services.util :as su] [uxbox.util.blob :as blob] [uxbox.util.data :as data] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [vertx.core :as vc])) ;; --- Helpers & Specs diff --git a/backend/src/uxbox/services/queries/icons.clj b/backend/src/uxbox/services/queries/icons.clj index 8b1c7e7a7..5b0eb6b9b 100644 --- a/backend/src/uxbox/services/queries/icons.clj +++ b/backend/src/uxbox/services/queries/icons.clj @@ -22,7 +22,7 @@ [uxbox.services.util :as su] [uxbox.util.blob :as blob] [uxbox.util.data :as data] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [vertx.core :as vc])) ;; --- Helpers & Specs diff --git a/backend/src/uxbox/services/queries/profile.clj b/backend/src/uxbox/services/queries/profile.clj index c7a75aab4..578812ae6 100644 --- a/backend/src/uxbox/services/queries/profile.clj +++ b/backend/src/uxbox/services/queries/profile.clj @@ -15,7 +15,7 @@ [uxbox.images :as images] [uxbox.services.queries :as sq] [uxbox.services.util :as su] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.blob :as blob])) ;; --- Helpers & Specs diff --git a/backend/src/uxbox/services/queries/teams.clj b/backend/src/uxbox/services/queries/teams.clj index b3b32d58d..229c4444f 100644 --- a/backend/src/uxbox/services/queries/teams.clj +++ b/backend/src/uxbox/services/queries/teams.clj @@ -17,7 +17,7 @@ [uxbox.services.queries :as sq] [uxbox.services.util :as su] [uxbox.util.blob :as blob] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) ;; --- Team Edition Permissions diff --git a/backend/src/uxbox/services/queries/viewer.clj b/backend/src/uxbox/services/queries/viewer.clj index fc6b2abf5..6fe536089 100644 --- a/backend/src/uxbox/services/queries/viewer.clj +++ b/backend/src/uxbox/services/queries/viewer.clj @@ -23,7 +23,7 @@ [uxbox.services.util :as su] [uxbox.util.blob :as blob] [uxbox.util.data :as data] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [vertx.core :as vc])) ;; --- Helpers & Specs diff --git a/backend/src/uxbox/services/util.clj b/backend/src/uxbox/services/util.clj index 704194c3d..f2b4cde8c 100644 --- a/backend/src/uxbox/services/util.clj +++ b/backend/src/uxbox/services/util.clj @@ -11,7 +11,7 @@ [vertx.util :as vu] [uxbox.core :refer [system]] [uxbox.common.exceptions :as ex] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.dispatcher :as uds])) (defn raise-not-found-if-nil diff --git a/backend/src/uxbox/util/uuid.clj b/backend/src/uxbox/util/uuid.clj deleted file mode 100644 index d150a7023..000000000 --- a/backend/src/uxbox/util/uuid.clj +++ /dev/null @@ -1,42 +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) 2020 UXBOX Labs SL - -(ns uxbox.util.uuid - (:refer-clojure :exclude [next]) - (:require [clj-uuid :as uuid]) - (:import java.util.UUID)) - -(def ^:const zero uuid/+null+) -(def ^:const oid uuid/+namespace-oid+) - -(defmacro next - [] - `(uuid/v1)) - -(defmacro random - "Alias for clj-uuid/v4." - [] - `(uuid/v4)) - -(defmacro namespaced - [ns data] - `(uuid/v5 ~ns ~data)) - -(defmacro str->uuid - [s] - `(UUID/fromString ~s)) - -(defn from-string - "Parse string uuid representation into proper UUID instance." - [s] - (UUID/fromString s)) - -(defn custom - ([a] (UUID. 0 a)) - ([b a] (UUID. b a))) diff --git a/backend/tests/uxbox/tests/helpers.clj b/backend/tests/uxbox/tests/helpers.clj index aac3f6aa0..aa20deb71 100644 --- a/backend/tests/uxbox/tests/helpers.clj +++ b/backend/tests/uxbox/tests/helpers.clj @@ -19,7 +19,7 @@ [uxbox.media] [uxbox.db :as db] [uxbox.util.blob :as blob] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.storage :as ust] [uxbox.config :as cfg] [vertx.util :as vu])) @@ -67,7 +67,7 @@ (defn mk-uuid [prefix & args] - (uuid/namespaced uuid/oid (apply str prefix args))) + (uuid/namespaced uuid/zero (apply str prefix args))) ;; --- Profile creation diff --git a/backend/tests/uxbox/tests/test_common_pages.clj b/backend/tests/uxbox/tests/test_common_pages.clj index 71737d676..8866a6ab9 100644 --- a/backend/tests/uxbox/tests/test_common_pages.clj +++ b/backend/tests/uxbox/tests/test_common_pages.clj @@ -11,7 +11,7 @@ [promesa.core :as p] [mockery.core :refer [with-mock]] [uxbox.common.pages :as cp] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.tests.helpers :as th])) (t/deftest process-change-add-obj diff --git a/backend/tests/uxbox/tests/test_services_colors.clj b/backend/tests/uxbox/tests/test_services_colors.clj index fabb421be..a9808ca57 100644 --- a/backend/tests/uxbox/tests/test_services_colors.clj +++ b/backend/tests/uxbox/tests/test_services_colors.clj @@ -9,7 +9,7 @@ [uxbox.services.mutations :as sm] [uxbox.services.queries :as sq] [uxbox.util.storage :as ust] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.tests.helpers :as th] [vertx.core :as vc])) diff --git a/backend/tests/uxbox/tests/test_services_files.clj b/backend/tests/uxbox/tests/test_services_files.clj index 856b01a19..9e391c3e3 100644 --- a/backend/tests/uxbox/tests/test_services_files.clj +++ b/backend/tests/uxbox/tests/test_services_files.clj @@ -11,7 +11,7 @@ [uxbox.services.queries :as sq] [uxbox.tests.helpers :as th] [uxbox.util.storage :as ust] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [vertx.util :as vu])) (t/use-fixtures :once th/state-init) diff --git a/backend/tests/uxbox/tests/test_services_icons.clj b/backend/tests/uxbox/tests/test_services_icons.clj index 9a3b49e7a..8d83dac4e 100644 --- a/backend/tests/uxbox/tests/test_services_icons.clj +++ b/backend/tests/uxbox/tests/test_services_icons.clj @@ -9,7 +9,7 @@ [uxbox.services.mutations :as sm] [uxbox.services.queries :as sq] [uxbox.util.storage :as ust] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.tests.helpers :as th] [vertx.core :as vc])) diff --git a/backend/tests/uxbox/tests/test_services_images.clj b/backend/tests/uxbox/tests/test_services_images.clj index 57e96fc24..d6a8f7945 100644 --- a/backend/tests/uxbox/tests/test_services_images.clj +++ b/backend/tests/uxbox/tests/test_services_images.clj @@ -9,7 +9,7 @@ [uxbox.services.mutations :as sm] [uxbox.services.queries :as sq] [uxbox.util.storage :as ust] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.tests.helpers :as th] [vertx.core :as vc])) diff --git a/backend/tests/uxbox/tests/test_services_pages.clj b/backend/tests/uxbox/tests/test_services_pages.clj index 73bf60e1b..17991163b 100644 --- a/backend/tests/uxbox/tests/test_services_pages.clj +++ b/backend/tests/uxbox/tests/test_services_pages.clj @@ -8,7 +8,7 @@ [uxbox.http :as http] [uxbox.services.mutations :as sm] [uxbox.services.queries :as sq] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.tests.helpers :as th])) (t/use-fixtures :once th/state-init) diff --git a/backend/tests/uxbox/tests/test_services_projects.clj b/backend/tests/uxbox/tests/test_services_projects.clj index 475bc2685..175065189 100644 --- a/backend/tests/uxbox/tests/test_services_projects.clj +++ b/backend/tests/uxbox/tests/test_services_projects.clj @@ -7,7 +7,7 @@ [uxbox.services.mutations :as sm] [uxbox.services.queries :as sq] [uxbox.tests.helpers :as th] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) (t/use-fixtures :once th/state-init) (t/use-fixtures :each th/database-reset) diff --git a/backend/tests/uxbox/tests/test_services_viewer.clj b/backend/tests/uxbox/tests/test_services_viewer.clj index 6ee84f23b..3242c756b 100644 --- a/backend/tests/uxbox/tests/test_services_viewer.clj +++ b/backend/tests/uxbox/tests/test_services_viewer.clj @@ -11,7 +11,7 @@ [uxbox.services.queries :as sq] [uxbox.tests.helpers :as th] [uxbox.util.storage :as ust] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [vertx.util :as vu])) (t/use-fixtures :once th/state-init) diff --git a/common/uxbox/common/pages.cljc b/common/uxbox/common/pages.cljc index d4a5a5877..63537b292 100644 --- a/common/uxbox/common/pages.cljc +++ b/common/uxbox/common/pages.cljc @@ -11,6 +11,7 @@ "A common (clj/cljs) functions and specs for pages." (:require [clojure.spec.alpha :as s] + [uxbox.common.uuid :as uuid] [uxbox.common.data :as d] [uxbox.common.exceptions :as ex] [uxbox.common.spec :as us])) diff --git a/common/uxbox/common/spec.cljc b/common/uxbox/common/spec.cljc index 179d3bac6..bb3382902 100644 --- a/common/uxbox/common/spec.cljc +++ b/common/uxbox/common/spec.cljc @@ -13,6 +13,7 @@ #?(:clj [clojure.spec.alpha :as s] :cljs [cljs.spec.alpha :as s]) [expound.alpha :as expound] + [uxbox.common.uuid :as uuid] [uxbox.common.exceptions :as ex] [cuerdas.core :as str])) @@ -34,9 +35,7 @@ v (if (string? v) (if (re-matches uuid-rx v) - #?(:cljs (uuid v) - :clj (java.util.UUID/fromString v)) - + (uuid/uuid v) (if (str/empty? v) nil ::s/invalid)) ::s/invalid))) diff --git a/common/uxbox/common/uuid.cljc b/common/uxbox/common/uuid.cljc new file mode 100644 index 000000000..84222444c --- /dev/null +++ b/common/uxbox/common/uuid.cljc @@ -0,0 +1,51 @@ +;; 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) 2020 UXBOX Labs SL + +(ns uxbox.common.uuid + (:refer-clojure :exclude [next uuid zero?]) + #?(:clj (:import java.util.UUID)) + #?(:clj + (:require [clj-uuid :as impl] + [clojure.core :as c]) + :cljs + (:require ["./uuid_impl.js" :as impl] + [cljs.core :as c]))) + +(def zero #uuid "00000000-0000-0000-0000-000000000000") + +(defn zero? + [v] + (= zero v)) + +(defn next + [] + #?(:clj (impl/v1) + :cljs (impl/v1))) + +(defn random + "Alias for clj-uuid/v4." + [] + #?(:clj (impl/v4) + :cljs (impl/v4))) + +#?(:clj + (defn namespaced + [ns data] + (impl/v5 ns data))) + +(defn uuid + "Parse string uuid representation into proper UUID instance." + [s] + #?(:clj (UUID/fromString s) + :cljs (c/uuid s))) + +#?(:clj + (defn custom + ([a] (UUID. 0 a)) + ([b a] (UUID. b a)))) diff --git a/common/uxbox/common/uuid_impl.js b/common/uxbox/common/uuid_impl.js new file mode 100644 index 000000000..677a698a0 --- /dev/null +++ b/common/uxbox/common/uuid_impl.js @@ -0,0 +1,178 @@ +/* + * 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) 2020 UXBOX Labs SL + */ +"use strict"; + +import cljs from "goog:cljs.core"; + +const global = goog.global; +const crypto = global.crypto; + +function fill(buf) { + crypto.getRandomValues(buf); + return buf; +}; + +if (global.crypto === undefined) { + console.warn("No high quality RNG available, switching back to Math.random.", platform); + + fill = function(buf) { + for (let i = 0, r; i < buf.length; i++) { + if ((i & 0x03) === 0) { r = Math.random() * 0x100000000; } + buf[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + return buf; + } +} + +/* + * The MIT License (MIT) + * + * Copyright (c) 2010-2016 Robert Kieffer and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +const hexMap = []; +for (let i = 0; i < 256; i++) { + hexMap[i] = (i + 0x100).toString(16).substr(1); +} + +function toHexString(buf) { + let i = 0; + return (hexMap[buf[i++]] + + hexMap[buf[i++]] + + hexMap[buf[i++]] + + hexMap[buf[i++]] + '-' + + hexMap[buf[i++]] + + hexMap[buf[i++]] + '-' + + hexMap[buf[i++]] + + hexMap[buf[i++]] + '-' + + hexMap[buf[i++]] + + hexMap[buf[i++]] + '-' + + hexMap[buf[i++]] + + hexMap[buf[i++]] + + hexMap[buf[i++]] + + hexMap[buf[i++]] + + hexMap[buf[i++]] + + hexMap[buf[i++]]); +} + +const buff = new Uint8Array(16); + +export function v4() { + fill(buff); + buff[6] = (buff[6] & 0x0f) | 0x40; + buff[8] = (buff[8] & 0x3f) | 0x80; + return cljs.uuid(toHexString(buff)); +} + +let initialized = false; +let node; +let clockseq; +let lastms = 0; +let lastns = 0; + +export function v1() { + let cs = clockseq; + + if (!initialized) { + const seed = new Uint8Array(8) + fill(seed); + + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = [ + seed[0] | 0x01, + seed[1], + seed[2], + seed[3], + seed[4], + seed[5] + ]; + + // Per 4.2.2, randomize (14 bit) clockseq + cs = clockseq = (seed[6] << 8 | seed[7]) & 0x3fff; + initialized = true; + } + + let ms = Date.now(); + let ns = lastns + 1; + let dt = (ms - lastms) + (ns - lastns) / 10000; + + // Per 4.2.1.2, Bump clockseq on clock regression + if (dt < 0) { + cs = cs + 1 & 0x3fff; + } + + // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + if (dt < 0 || ms > lastms) { + ns = 0; + } + + // Per 4.2.1.2 Throw error if too many uuids are requested + if (ns >= 10000) { + throw new Error("uuid v1 can't create more than 10M uuids/s") + } + + lastms = ms; + lastns = ns; + clockseq = cs; + + // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + ms += 12219292800000; + + let i = 0; + + // `time_low` + var tl = ((ms & 0xfffffff) * 10000 + ns) % 0x100000000; + buff[i++] = tl >>> 24 & 0xff; + buff[i++] = tl >>> 16 & 0xff; + buff[i++] = tl >>> 8 & 0xff; + buff[i++] = tl & 0xff; + + // `time_mid` + var tmh = (ms / 0x100000000 * 10000) & 0xfffffff; + buff[i++] = tmh >>> 8 & 0xff; + buff[i++] = tmh & 0xff; + + // `time_high_and_version` + buff[i++] = tmh >>> 24 & 0xf | 0x10; // include version + buff[i++] = tmh >>> 16 & 0xff; + + // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + buff[i++] = cs >>> 8 | 0x80; + + // `clock_seq_low` + buff[i++] = cs & 0xff; + + // `node` + for (var n = 0; n < 6; ++n) { + buff[i + n] = node[n]; + } + + return cljs.uuid(toHexString(buff)); +} diff --git a/frontend/deps.edn b/frontend/deps.edn index 9ab1f0780..44309fb71 100644 --- a/frontend/deps.edn +++ b/frontend/deps.edn @@ -6,7 +6,9 @@ environ/environ {:mvn/version "1.1.0"} metosin/reitit-core {:mvn/version "0.3.10"} - expound/expound {:mvn/version "0.7.2"} + expound/expound {:mvn/version "0.8.4"} + + danlentz/clj-uuid {:mvn/version "0.1.9"} funcool/beicon {:mvn/version "2020.03.29-1"} funcool/cuerdas {:mvn/version "2020.03.26-3"} diff --git a/frontend/src/uxbox/main/data/colors.cljs b/frontend/src/uxbox/main/data/colors.cljs index 5639ab5e8..0f80684df 100644 --- a/frontend/src/uxbox/main/data/colors.cljs +++ b/frontend/src/uxbox/main/data/colors.cljs @@ -17,7 +17,7 @@ [uxbox.util.i18n :refer [tr]] [uxbox.util.router :as rt] [uxbox.util.time :as dt] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) ;; ;; TODO: need a good refactor ;; diff --git a/frontend/src/uxbox/main/data/dashboard.cljs b/frontend/src/uxbox/main/data/dashboard.cljs index b9ec00ff7..4574722d2 100644 --- a/frontend/src/uxbox/main/data/dashboard.cljs +++ b/frontend/src/uxbox/main/data/dashboard.cljs @@ -17,7 +17,7 @@ [uxbox.util.router :as rt] [uxbox.util.time :as dt] [uxbox.util.timers :as ts] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) ;; --- Specs diff --git a/frontend/src/uxbox/main/data/icons.cljs b/frontend/src/uxbox/main/data/icons.cljs index ee0d5717f..b7da86760 100644 --- a/frontend/src/uxbox/main/data/icons.cljs +++ b/frontend/src/uxbox/main/data/icons.cljs @@ -18,7 +18,7 @@ [uxbox.util.webapi :as wapi] [uxbox.util.i18n :as i18n :refer [t tr]] [uxbox.util.router :as r] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) (s/def ::id uuid?) (s/def ::name string?) diff --git a/frontend/src/uxbox/main/data/images.cljs b/frontend/src/uxbox/main/data/images.cljs index 38dfcb8c9..7711aa7f6 100644 --- a/frontend/src/uxbox/main/data/images.cljs +++ b/frontend/src/uxbox/main/data/images.cljs @@ -16,7 +16,7 @@ [uxbox.main.repo :as rp] [uxbox.util.i18n :refer [tr]] [uxbox.util.router :as rt] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.time :as ts] [uxbox.util.router :as r] [uxbox.util.files :as files])) diff --git a/frontend/src/uxbox/main/data/library.cljs b/frontend/src/uxbox/main/data/library.cljs index 9c716ee85..8f7fb3e61 100644 --- a/frontend/src/uxbox/main/data/library.cljs +++ b/frontend/src/uxbox/main/data/library.cljs @@ -12,7 +12,7 @@ [uxbox.util.webapi :as wapi] [uxbox.util.i18n :as i18n :refer [t tr]] [uxbox.util.router :as r] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) (defn initialize-workspace-libraries [] ()) diff --git a/frontend/src/uxbox/main/data/viewer.cljs b/frontend/src/uxbox/main/data/viewer.cljs index 6d4291bdb..cbfdbc71e 100644 --- a/frontend/src/uxbox/main/data/viewer.cljs +++ b/frontend/src/uxbox/main/data/viewer.cljs @@ -20,7 +20,7 @@ [uxbox.common.data :as d] [uxbox.common.exceptions :as ex] [uxbox.util.router :as rt] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) ;; --- Specs diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index 098bb3ba2..560e28b36 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -38,7 +38,7 @@ [uxbox.util.router :as rt] [uxbox.util.time :as dt] [uxbox.util.transit :as t] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.webapi :as wapi] #_[vendor.randomcolor]) (:import goog.events.EventType diff --git a/frontend/src/uxbox/main/exports.cljs b/frontend/src/uxbox/main/exports.cljs index 775bea27c..61b757e01 100644 --- a/frontend/src/uxbox/main/exports.cljs +++ b/frontend/src/uxbox/main/exports.cljs @@ -8,7 +8,7 @@ "The main logic for SVG export functionality." (:require [rumext.alpha :as mf] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.math :as mth] [uxbox.main.geom :as geom] [uxbox.util.geom.point :as gpt] diff --git a/frontend/src/uxbox/main/store.cljs b/frontend/src/uxbox/main/store.cljs index a6cced39e..71363be8a 100644 --- a/frontend/src/uxbox/main/store.cljs +++ b/frontend/src/uxbox/main/store.cljs @@ -8,7 +8,7 @@ (:require [beicon.core :as rx] [lentes.core :as l] [potok.core :as ptk] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.storage :refer [storage]])) ;; TODO: move outside uxbox.main diff --git a/frontend/src/uxbox/main/ui/components/context_menu.cljs b/frontend/src/uxbox/main/ui/components/context_menu.cljs index ffab4be4d..a9ae18334 100644 --- a/frontend/src/uxbox/main/ui/components/context_menu.cljs +++ b/frontend/src/uxbox/main/ui/components/context_menu.cljs @@ -3,7 +3,7 @@ [rumext.alpha :as mf] [goog.object :as gobj] [uxbox.main.ui.components.dropdown :refer [dropdown']] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.data :refer [classnames]])) (mf/defc context-menu diff --git a/frontend/src/uxbox/main/ui/components/dropdown.cljs b/frontend/src/uxbox/main/ui/components/dropdown.cljs index abe796e55..48f8f6d86 100644 --- a/frontend/src/uxbox/main/ui/components/dropdown.cljs +++ b/frontend/src/uxbox/main/ui/components/dropdown.cljs @@ -1,7 +1,7 @@ (ns uxbox.main.ui.components.dropdown (:require [rumext.alpha :as mf] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.dom :as dom] [goog.events :as events] [goog.object :as gobj]) diff --git a/frontend/src/uxbox/main/ui/viewer/header.cljs b/frontend/src/uxbox/main/ui/viewer/header.cljs index 254b1c199..ccca0d989 100644 --- a/frontend/src/uxbox/main/ui/viewer/header.cljs +++ b/frontend/src/uxbox/main/ui/viewer/header.cljs @@ -21,7 +21,7 @@ [uxbox.util.dom :as dom] [uxbox.util.i18n :as i18n :refer [t]] [uxbox.util.router :as rt] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.webapi :as wapi])) diff --git a/frontend/src/uxbox/main/ui/workspace/drawarea.cljs b/frontend/src/uxbox/main/ui/workspace/drawarea.cljs index 6bd603bef..baf5671a3 100644 --- a/frontend/src/uxbox/main/ui/workspace/drawarea.cljs +++ b/frontend/src/uxbox/main/ui/workspace/drawarea.cljs @@ -25,7 +25,7 @@ [uxbox.util.geom.path :as path] [uxbox.util.geom.point :as gpt] [uxbox.util.i18n :as i18n :refer [t]] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) ;; --- Events diff --git a/frontend/src/uxbox/main/ui/workspace/images.cljs b/frontend/src/uxbox/main/ui/workspace/images.cljs index b0ceeafd0..d7e161b79 100644 --- a/frontend/src/uxbox/main/ui/workspace/images.cljs +++ b/frontend/src/uxbox/main/ui/workspace/images.cljs @@ -18,7 +18,7 @@ [uxbox.main.ui.modal :as modal] [uxbox.util.dom :as dom] [uxbox.util.i18n :as i18n :refer [tr t]] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) ;; --- Refs diff --git a/frontend/src/uxbox/main/ui/workspace/sidebar/align.cljs b/frontend/src/uxbox/main/ui/workspace/sidebar/align.cljs index fae75dc99..16938f7ac 100644 --- a/frontend/src/uxbox/main/ui/workspace/sidebar/align.cljs +++ b/frontend/src/uxbox/main/ui/workspace/sidebar/align.cljs @@ -13,7 +13,7 @@ [uxbox.main.store :as st] [uxbox.main.data.workspace :as dw] [uxbox.util.i18n :as i18n :refer [t]] - [uxbox.util.uuid :as uuid])) + [uxbox.common.uuid :as uuid])) (mf/defc align-options [] diff --git a/frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs b/frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs index 365d30d7f..373f98e8f 100644 --- a/frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs +++ b/frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs @@ -23,7 +23,7 @@ [uxbox.main.ui.workspace.sortable :refer [use-sortable]] [uxbox.util.dom :as dom] [uxbox.util.perf :as perf] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.i18n :as i18n :refer [t]])) (def ^:private shapes-iref diff --git a/frontend/src/uxbox/main/ui/workspace/sidebar/libraries.cljs b/frontend/src/uxbox/main/ui/workspace/sidebar/libraries.cljs index 57a773f8e..e23a26816 100644 --- a/frontend/src/uxbox/main/ui/workspace/sidebar/libraries.cljs +++ b/frontend/src/uxbox/main/ui/workspace/sidebar/libraries.cljs @@ -22,7 +22,7 @@ [uxbox.main.ui.workspace.sortable :refer [use-sortable]] [uxbox.util.dom :as dom] [uxbox.util.timers :as timers] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.i18n :as i18n :refer [tr]] [uxbox.util.data :refer [classnames]] [uxbox.main.ui.components.tab-container :refer [tab-container tab-element]] diff --git a/frontend/src/uxbox/main/ui/workspace/viewport.cljs b/frontend/src/uxbox/main/ui/workspace/viewport.cljs index 66265cb52..555cf28de 100644 --- a/frontend/src/uxbox/main/ui/workspace/viewport.cljs +++ b/frontend/src/uxbox/main/ui/workspace/viewport.cljs @@ -29,7 +29,7 @@ [uxbox.util.dom :as dom] [uxbox.util.geom.point :as gpt] [uxbox.util.perf :as perf] - [uxbox.util.uuid :as uuid]) + [uxbox.common.uuid :as uuid]) (:import goog.events.EventType)) ;; --- Coordinates Widget diff --git a/frontend/src/uxbox/util/rng_impl.js b/frontend/src/uxbox/util/rng_impl.js deleted file mode 100644 index 7a7042cc3..000000000 --- a/frontend/src/uxbox/util/rng_impl.js +++ /dev/null @@ -1,52 +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/. - * - * Copyright (c) 2016 Andrey Antukh -*/ - -"use strict"; - -goog.provide("uxbox.util.rng_impl"); -goog.require("cljs.core"); -goog.require("goog.object"); - -goog.scope(function() { - const self = uxbox.util.rng_impl; - const platform = cljs.core._STAR_target_STAR_; - - if (platform === "nodejs") { - const crypto = require("crypto"); - - self.getBytes = function(n) { - return crypto.randomBytes(n); - }; - - } else { - const gobj = goog.object; - const global = goog.global; - const crypto = gobj.get(global, "crypto"); - - if (crypto === undefined) { - console.warn("No high quality RNG available, switching back to Math.random.", platform); - - self.getBytes = function(n) { - const buf = new Uint8Array(n); - - for (let i = 0, r; i < n; i++) { - if ((i & 0x03) === 0) { r = Math.random() * 0x100000000; } - buf[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return buf; - }; - } else { - self.getBytes = function(n) { - const buf = new Uint8Array(n); - crypto.getRandomValues(buf); - return buf; - }; - } - } -}); diff --git a/frontend/src/uxbox/util/uuid.cljs b/frontend/src/uxbox/util/uuid.cljs deleted file mode 100644 index 030a0237b..000000000 --- a/frontend/src/uxbox/util/uuid.cljs +++ /dev/null @@ -1,36 +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) 2016-2020 Andrey Antukh - -(ns uxbox.util.uuid - "Provides a UUID v4 uuid generation. - - In difference with builtin `random-uuid` function this - implementation tries to use high quality RNG if is - available (browser crypto object or nodejs crypto module). - - If no high qualiry RNG, switches to the default Math based - RNG with proper waring in the console." - (:refer-clojure :exclude [zero? next]) - (:require [uxbox.util.uuid-impl :as impl])) - -(def zero #uuid "00000000-0000-0000-0000-000000000000") - -(defn zero? - [v] - (= zero v)) - -(defn next - "Generate a v1 (time-based) UUID." - [] - (uuid (impl/v1))) - -(defn random - "Generate a v4 (random) UUID." - [] - (uuid (impl/v4))) diff --git a/frontend/src/uxbox/util/uuid_impl.js b/frontend/src/uxbox/util/uuid_impl.js deleted file mode 100644 index 2c77e70a4..000000000 --- a/frontend/src/uxbox/util/uuid_impl.js +++ /dev/null @@ -1,161 +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) 2016-2020 Andrey Antukh - */ -/* - * The MIT License (MIT) - * - * Copyright (c) 2010-2016 Robert Kieffer and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -"use strict"; - -goog.provide("uxbox.util.uuid_impl"); -goog.require("uxbox.util.rng_impl"); - -goog.scope(function() { - const self = uxbox.util.uuid_impl; - const rng = uxbox.util.rng_impl; - - const hexMap = []; - for (let i = 0; i < 256; i++) { - hexMap[i] = (i + 0x100).toString(16).substr(1); - } - - function toHexString(buf) { - let i = 0; - return (hexMap[buf[i++]] + - hexMap[buf[i++]] + - hexMap[buf[i++]] + - hexMap[buf[i++]] + '-' + - hexMap[buf[i++]] + - hexMap[buf[i++]] + '-' + - hexMap[buf[i++]] + - hexMap[buf[i++]] + '-' + - hexMap[buf[i++]] + - hexMap[buf[i++]] + '-' + - hexMap[buf[i++]] + - hexMap[buf[i++]] + - hexMap[buf[i++]] + - hexMap[buf[i++]] + - hexMap[buf[i++]] + - hexMap[buf[i++]]); - } - - self.v4 = function() { - const buf = rng.getBytes(16); - buf[6] = (buf[6] & 0x0f) | 0x40; - buf[8] = (buf[8] & 0x3f) | 0x80; - return toHexString(buf); - }; - - let initialized = false; - let node; - let clockseq; - let lastms = 0; - let lastns = 0; - - self.v1 = function() { - let cs = clockseq; - - if (!initialized) { - const seed = rng.getBytes(8); - - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = [ - seed[0] | 0x01, - seed[1], - seed[2], - seed[3], - seed[4], - seed[5] - ]; - - // Per 4.2.2, randomize (14 bit) clockseq - cs = clockseq = (seed[6] << 8 | seed[7]) & 0x3fff; - initialized = true; - } - - let ms = Date.now(); - let ns = lastns + 1; - let dt = (ms - lastms) + (ns - lastns) / 10000; - - // Per 4.2.1.2, Bump clockseq on clock regression - if (dt < 0) { - cs = cs + 1 & 0x3fff; - } - - // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - if (dt < 0 || ms > lastms) { - ns = 0; - } - - // Per 4.2.1.2 Throw error if too many uuids are requested - if (ns >= 10000) { - throw new Error("uuid v1 can't create more than 10M uuids/s") - } - - lastms = ms; - lastns = ns; - clockseq = cs; - - // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - ms += 12219292800000; - - let i = 0; - let buf = new Uint8Array(16); - - // `time_low` - var tl = ((ms & 0xfffffff) * 10000 + ns) % 0x100000000; - buf[i++] = tl >>> 24 & 0xff; - buf[i++] = tl >>> 16 & 0xff; - buf[i++] = tl >>> 8 & 0xff; - buf[i++] = tl & 0xff; - - // `time_mid` - var tmh = (ms / 0x100000000 * 10000) & 0xfffffff; - buf[i++] = tmh >>> 8 & 0xff; - buf[i++] = tmh & 0xff; - - // `time_high_and_version` - buf[i++] = tmh >>> 24 & 0xf | 0x10; // include version - buf[i++] = tmh >>> 16 & 0xff; - - // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - buf[i++] = cs >>> 8 | 0x80; - - // `clock_seq_low` - buf[i++] = cs & 0xff; - - // `node` - for (var n = 0; n < 6; ++n) { - buf[i + n] = node[n]; - } - - return toHexString(buf); - } -}); diff --git a/frontend/src/uxbox/util/workers.cljs b/frontend/src/uxbox/util/workers.cljs index 3cebb94d8..4391d9b9e 100644 --- a/frontend/src/uxbox/util/workers.cljs +++ b/frontend/src/uxbox/util/workers.cljs @@ -7,7 +7,7 @@ (ns uxbox.util.workers "A lightweight layer on top of webworkers api." (:require [beicon.core :as rx] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.util.transit :as t])) ;; --- Implementation diff --git a/frontend/src/uxbox/worker.cljs b/frontend/src/uxbox/worker.cljs index ed944f19e..3efca58e2 100644 --- a/frontend/src/uxbox/worker.cljs +++ b/frontend/src/uxbox/worker.cljs @@ -8,7 +8,7 @@ (:require [beicon.core :as rx] [cuerdas.core :as str] [uxbox.util.transit :as t] - [uxbox.util.uuid :as uuid] + [uxbox.common.uuid :as uuid] [uxbox.worker.impl :as impl] [uxbox.worker.align]))