diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/.clj-kondo/config.edn @@ -0,0 +1 @@ +{} diff --git a/.gitignore b/.gitignore index 549d464b..18c6626e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,7 @@ npm-debug.log package.json *.log /out_test +.calva/ +.clj-kondo/* +!.clj-kondo/config.edn +.lsp/ diff --git a/CHANGELOG.md b/CHANGELOG.md index c0e207e8..cc9ffe75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,33 @@ ## Unreleased +## [1.2.21] - 2024-09-24 +- Update xapi-schema to 1.4.0 to support empty statement batch POSTs +- Update GitHub actions to resolve Node deprecation warnings + +## [1.2.20] - 2024-07-25 +- Fix error in `/xapi/statements` POST OpenAPI spec + +## [1.2.19] - 2024-07-18 +- Implement OpenAPI annotations + +## [1.2.18] - 2024-05-20 +- Update xapi-schema to 1.3.0 +- Address Babel vulnerability + +## [1.2.17] - 2024-02-16 +- Changed Clojars deploy action + +## [1.2.16] - 2023-11-22 +- Support Attachment and Document Scanning + +## [1.2.15] - 2023-02-22 +- CVE-2023-24998: Update commons-fileupload to 1.5 +- Update package-lock for qs vulnerability + +## [1.2.14] - 2022-11-16 +- Exclude msgpack from dependencies to clear CVE-2022-41719 + ## [1.2.13] - 2022-10-24 - Update GitHub CI and CD to remove deprecation warnings diff --git a/deps.edn b/deps.edn index 3a6b89be..b46da124 100644 --- a/deps.edn +++ b/deps.edn @@ -3,7 +3,7 @@ {org.clojure/clojure {:mvn/version "1.10.1"} org.clojure/clojurescript {:mvn/version "1.10.741"} org.clojure/core.async {:mvn/version "1.5.648"} - com.yetanalytics/xapi-schema {:mvn/version "1.3.0" + com.yetanalytics/xapi-schema {:mvn/version "1.4.0" :exclusions [org.clojure/clojurescript]} com.yetanalytics/gen-openapi {:mvn/version "0.0.5"} cheshire/cheshire {:mvn/version "5.10.1"} diff --git a/src/test/com/yetanalytics/lrs_test.clj b/src/test/com/yetanalytics/lrs_test.clj index fb01a555..1c04d70b 100644 --- a/src/test/com/yetanalytics/lrs_test.clj +++ b/src/test/com/yetanalytics/lrs_test.clj @@ -54,12 +54,25 @@ lrs/authorize lrs/authorize-async]) +(def auth-id + {:auth {:no-op {}} + :prefix "" + :scopes #{:scope/all} + :agent {"mbox" "mailto:lrs@yetanalytics.io"}}) + +(deftest empty-store-test + (let [lrs (doto (mem/new-lrs {:statements-result-max 100}) + (lrs/store-statements auth-id [] [])) + ret-statements (get-in (lrs/get-statements lrs + auth-id + {:limit 100} + #{"en-US"}) + [:statement-result :statements])] + (is (s/valid? ::xs/statements ret-statements)) + (is (empty? ret-statements)))) + (deftest query-test - (let [auth-id {:auth {:no-op {}} - :prefix "" - :scopes #{:scope/all} - :agent {"mbox" "mailto:lrs@yetanalytics.io"}} - ;; The serialized state shouldn't be used for this, because we're + (let [;; The serialized state shouldn't be used for this, because we're ;; changing things around. ;; The datasim data is not currently normalized, but only happens at a ;; max precision of 1 ms. That's timestamps though, looks like we have @@ -75,8 +88,7 @@ [:statement-result :statements])) ret-statements (get-ss {:limit 100})] (testing (format "%s valid return statements?" (count ret-statements)) - (is (s/valid? (s/every ::xs/statement) - ret-statements))) + (is (s/valid? ::xs/statements ret-statements))) (testing "preserved?" (is (= (dissoc (first ret-statements) "authority"