From 56f69d5032512d90829f9b5d38b75d4fd22980af Mon Sep 17 00:00:00 2001 From: liquidz Date: Fri, 20 Oct 2023 14:15:02 +0900 Subject: [PATCH 1/9] deps: Bump outdated dependencies --- project.clj | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/project.clj b/project.clj index 63ca1b3..479527c 100644 --- a/project.clj +++ b/project.clj @@ -5,14 +5,14 @@ :url "http://www.apache.org/licenses/LICENSE-2.0"} :deploy-repositories [["releases" {:url "https://repo.clojars.org" :creds :gpg}] ["snapshots" :clojars]] - :dependencies [[org.clojure/clojure "1.10.0"] - [org.clojure/core.async "0.4.500"] - [clj-http "3.10.1"] - [cheshire "5.9.0"]] + :dependencies [[org.clojure/clojure "1.11.2"] + [org.clojure/core.async "1.6.681"] + [clj-http "3.12.3"] + [cheshire "5.13.0"]] :clean-targets ^{:protect false} ["target"] :aliases {"test:cljs" ["doo" "chrome-headless" "test" "once"] "bump-version" ["change" "version" "leiningen.release/bump-version"]} - :plugins [[lein-doo "0.1.10"]] + :plugins [[lein-doo "0.1.11"]] ;; Switch to Figwheel Main when this issue is solved ;; https://github.com/bhauman/figwheel-main/issues/159 :cljsbuild {:builds [{:id "test" @@ -20,12 +20,12 @@ :compiler {:output-to "target/public/js/test.js" :main cljs.test-runner :optimizations :none}}]} - :profiles {:provided {:dependencies [[org.clojure/clojurescript "1.10.520"] - [cljs-ajax "0.8.0"]]} + :profiles {:provided {:dependencies [[org.clojure/clojurescript "1.11.132"] + [cljs-ajax "0.8.4"]]} :dev {:source-paths ["dev"] :resource-paths ["target"] - :dependencies [[nrepl/nrepl "0.6.0"] - [cider/piggieback "0.4.0"] - [com.bhauman/figwheel-main "0.2.3"] + :dependencies [[nrepl/nrepl "1.1.1"] + [cider/piggieback "0.5.3"] + [com.bhauman/figwheel-main "0.2.18"] [com.bhauman/cljs-test-display "0.1.1"]] :repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}}}) From ef535148fd36310eb06a15a342e38014795ef941 Mon Sep 17 00:00:00 2001 From: liquidz Date: Fri, 20 Oct 2023 14:15:14 +0900 Subject: [PATCH 2/9] chore: Add .clj-kondo/.cache to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8979925..42714ac 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ pom.xml.asc .hg/ .idea/ dev-resources/config.edn +.clj-kondo/.cache From 7e83bceb4eca22e5dbeddbdc7660335b04b53e6b Mon Sep 17 00:00:00 2001 From: liquidz Date: Fri, 20 Oct 2023 14:16:12 +0900 Subject: [PATCH 3/9] test: Add package.json for clojurescript testing --- .gitignore | 1 + package.json | 8 + pnpm-lock.yaml | 1028 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1037 insertions(+) create mode 100644 package.json create mode 100644 pnpm-lock.yaml diff --git a/.gitignore b/.gitignore index 42714ac..0eaaf47 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ pom.xml.asc .idea/ dev-resources/config.edn .clj-kondo/.cache +/node_modules diff --git a/package.json b/package.json new file mode 100644 index 0000000..9698bc7 --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "devDependencies": { + "karma": "^6.4.2", + "karma-chrome-launcher": "^3.2.0", + "karma-cli": "^2.0.0", + "karma-cljs-test": "^0.1.0" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..51b5ddb --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,1028 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +devDependencies: + karma: + specifier: ^6.4.2 + version: 6.4.2 + karma-chrome-launcher: + specifier: ^3.2.0 + version: 3.2.0 + karma-cli: + specifier: ^2.0.0 + version: 2.0.0 + karma-cljs-test: + specifier: ^0.1.0 + version: 0.1.0 + +packages: + + /@colors/colors@1.5.0: + resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} + engines: {node: '>=0.1.90'} + dev: true + + /@socket.io/component-emitter@3.1.0: + resolution: {integrity: sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==} + dev: true + + /@types/cookie@0.4.1: + resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} + dev: true + + /@types/cors@2.8.17: + resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} + dependencies: + '@types/node': 20.12.3 + dev: true + + /@types/node@20.12.3: + resolution: {integrity: sha512-sD+ia2ubTeWrOu+YMF+MTAB7E+O7qsMqAbMfW7DG3K1URwhZ5hN1pLlRVGbf4wDFzSfikL05M17EyorS86jShw==} + dependencies: + undici-types: 5.26.5 + dev: true + + /accepts@1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + dev: true + + /ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + dev: true + + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /base64id@2.0.0: + resolution: {integrity: sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==} + engines: {node: ^4.5.0 || >= 5.9} + dev: true + + /binary-extensions@2.3.0: + resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} + engines: {node: '>=8'} + dev: true + + /body-parser@1.20.2: + resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.2 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /brace-expansion@1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /braces@3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: true + + /bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + dev: true + + /call-bind@1.0.7: + resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + set-function-length: 1.2.2 + dev: true + + /chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + dev: true + + /cliui@7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true + + /connect@3.7.0: + resolution: {integrity: sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==} + engines: {node: '>= 0.10.0'} + dependencies: + debug: 2.6.9 + finalhandler: 1.1.2 + parseurl: 1.3.3 + utils-merge: 1.0.1 + transitivePeerDependencies: + - supports-color + dev: true + + /content-type@1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + dev: true + + /cookie@0.4.2: + resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} + engines: {node: '>= 0.6'} + dev: true + + /cors@2.8.5: + resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} + engines: {node: '>= 0.10'} + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + dev: true + + /custom-event@1.0.1: + resolution: {integrity: sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==} + dev: true + + /date-format@4.0.14: + resolution: {integrity: sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==} + engines: {node: '>=4.0'} + dev: true + + /debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: true + + /debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + + /define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + gopd: 1.0.1 + dev: true + + /depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + dev: true + + /destroy@1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dev: true + + /di@0.0.1: + resolution: {integrity: sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==} + dev: true + + /dom-serialize@2.2.1: + resolution: {integrity: sha512-Yra4DbvoW7/Z6LBN560ZwXMjoNOSAN2wRsKFGc4iBeso+mpIA6qj1vfdf9HpMaKAqG6wXTy+1SYEzmNpKXOSsQ==} + dependencies: + custom-event: 1.0.1 + ent: 2.2.0 + extend: 3.0.2 + void-elements: 2.0.1 + dev: true + + /ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + dev: true + + /emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true + + /encodeurl@1.0.2: + resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} + engines: {node: '>= 0.8'} + dev: true + + /engine.io-parser@5.2.2: + resolution: {integrity: sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw==} + engines: {node: '>=10.0.0'} + dev: true + + /engine.io@6.5.4: + resolution: {integrity: sha512-KdVSDKhVKyOi+r5uEabrDLZw2qXStVvCsEB/LN3mw4WFi6Gx50jTyuxYVCwAAC0U46FdnzP/ScKRBTXb/NiEOg==} + engines: {node: '>=10.2.0'} + dependencies: + '@types/cookie': 0.4.1 + '@types/cors': 2.8.17 + '@types/node': 20.12.3 + accepts: 1.3.8 + base64id: 2.0.0 + cookie: 0.4.2 + cors: 2.8.5 + debug: 4.3.4 + engine.io-parser: 5.2.2 + ws: 8.11.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /ent@2.2.0: + resolution: {integrity: sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA==} + dev: true + + /es-define-property@1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.4 + dev: true + + /es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + dev: true + + /escalade@3.1.2: + resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} + engines: {node: '>=6'} + dev: true + + /escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + dev: true + + /eventemitter3@4.0.7: + resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} + dev: true + + /extend@3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + dev: true + + /fill-range@7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + + /finalhandler@1.1.2: + resolution: {integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==} + engines: {node: '>= 0.8'} + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.3.0 + parseurl: 1.3.3 + statuses: 1.5.0 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /flatted@3.3.1: + resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + dev: true + + /follow-redirects@1.15.6: + resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: true + + /fs-extra@8.1.0: + resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} + engines: {node: '>=6 <7 || >=8'} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: true + + /fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true + + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + dev: true + + /get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + + /get-intrinsic@1.2.4: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + has-proto: 1.0.3 + has-symbols: 1.0.3 + hasown: 2.0.2 + dev: true + + /glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + dev: true + + /glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /gopd@1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.2.4 + dev: true + + /graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + dev: true + + /has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + dependencies: + es-define-property: 1.0.0 + dev: true + + /has-proto@1.0.3: + resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + engines: {node: '>= 0.4'} + dev: true + + /has-symbols@1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: true + + /hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + dependencies: + function-bind: 1.1.2 + dev: true + + /http-errors@2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + dev: true + + /http-proxy@1.18.1: + resolution: {integrity: sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.7 + follow-redirects: 1.15.6 + requires-port: 1.0.0 + transitivePeerDependencies: + - debug + dev: true + + /iconv-lite@0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: true + + /inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true + + /is-binary-path@2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + dependencies: + binary-extensions: 2.3.0 + dev: true + + /is-core-module@2.13.1: + resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + dependencies: + hasown: 2.0.2 + dev: true + + /is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + dev: true + + /is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true + + /is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + dev: true + + /is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true + + /isbinaryfile@4.0.10: + resolution: {integrity: sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==} + engines: {node: '>= 8.0.0'} + dev: true + + /isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true + + /jsonfile@4.0.0: + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + optionalDependencies: + graceful-fs: 4.2.11 + dev: true + + /karma-chrome-launcher@3.2.0: + resolution: {integrity: sha512-rE9RkUPI7I9mAxByQWkGJFXfFD6lE4gC5nPuZdobf/QdTEJI6EU4yIay/cfU/xV4ZxlM5JiTv7zWYgA64NpS5Q==} + dependencies: + which: 1.3.1 + dev: true + + /karma-cli@2.0.0: + resolution: {integrity: sha512-1Kb28UILg1ZsfqQmeELbPzuEb5C6GZJfVIk0qOr8LNYQuYWmAaqP16WpbpKEjhejDrDYyYOwwJXSZO6u7q5Pvw==} + engines: {node: '>= 6'} + hasBin: true + dependencies: + resolve: 1.22.8 + dev: true + + /karma-cljs-test@0.1.0: + resolution: {integrity: sha512-fd4aLynTv3htQCUS+OV1HfoB9UqYfEVFruKxkfTE3zB2aoSCHD966ZitSSgUeVYahWiaCK0XHZp9cB39t65cLQ==} + dev: true + + /karma@6.4.2: + resolution: {integrity: sha512-C6SU/53LB31BEgRg+omznBEMY4SjHU3ricV6zBcAe1EeILKkeScr+fZXtaI5WyDbkVowJxxAI6h73NcFPmXolQ==} + engines: {node: '>= 10'} + hasBin: true + dependencies: + '@colors/colors': 1.5.0 + body-parser: 1.20.2 + braces: 3.0.2 + chokidar: 3.6.0 + connect: 3.7.0 + di: 0.0.1 + dom-serialize: 2.2.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + http-proxy: 1.18.1 + isbinaryfile: 4.0.10 + lodash: 4.17.21 + log4js: 6.9.1 + mime: 2.6.0 + minimatch: 3.1.2 + mkdirp: 0.5.6 + qjobs: 1.2.0 + range-parser: 1.2.1 + rimraf: 3.0.2 + socket.io: 4.7.5 + source-map: 0.6.1 + tmp: 0.2.3 + ua-parser-js: 0.7.37 + yargs: 16.2.0 + transitivePeerDependencies: + - bufferutil + - debug + - supports-color + - utf-8-validate + dev: true + + /lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: true + + /log4js@6.9.1: + resolution: {integrity: sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g==} + engines: {node: '>=8.0'} + dependencies: + date-format: 4.0.14 + debug: 4.3.4 + flatted: 3.3.1 + rfdc: 1.3.1 + streamroller: 3.1.5 + transitivePeerDependencies: + - supports-color + dev: true + + /media-typer@0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + dev: true + + /mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: true + + /mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: true + + /mime@2.6.0: + resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==} + engines: {node: '>=4.0.0'} + hasBin: true + dev: true + + /minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: true + + /mkdirp@0.5.6: + resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} + hasBin: true + dependencies: + minimist: 1.2.8 + dev: true + + /ms@2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + dev: true + + /ms@2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: true + + /negotiator@0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + dev: true + + /normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + dev: true + + /object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: true + + /object-inspect@1.13.1: + resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + dev: true + + /on-finished@2.3.0: + resolution: {integrity: sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==} + engines: {node: '>= 0.8'} + dependencies: + ee-first: 1.1.1 + dev: true + + /on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + dependencies: + ee-first: 1.1.1 + dev: true + + /once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: true + + /parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + dev: true + + /path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: true + + /path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + + /picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true + + /qjobs@1.2.0: + resolution: {integrity: sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==} + engines: {node: '>=0.9'} + dev: true + + /qs@6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.6 + dev: true + + /range-parser@1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + dev: true + + /raw-body@2.5.2: + resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} + engines: {node: '>= 0.8'} + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: true + + /readdirp@3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + dependencies: + picomatch: 2.3.1 + dev: true + + /require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true + + /requires-port@1.0.0: + resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + dev: true + + /resolve@1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true + dependencies: + is-core-module: 2.13.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /rfdc@1.3.1: + resolution: {integrity: sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==} + dev: true + + /rimraf@3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + + /safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: true + + /set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + dev: true + + /setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + dev: true + + /side-channel@1.0.6: + resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + object-inspect: 1.13.1 + dev: true + + /socket.io-adapter@2.5.4: + resolution: {integrity: sha512-wDNHGXGewWAjQPt3pyeYBtpWSq9cLE5UW1ZUPL/2eGK9jtse/FpXib7epSTsz0Q0m+6sg6Y4KtcFTlah1bdOVg==} + dependencies: + debug: 4.3.4 + ws: 8.11.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /socket.io-parser@4.2.4: + resolution: {integrity: sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==} + engines: {node: '>=10.0.0'} + dependencies: + '@socket.io/component-emitter': 3.1.0 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /socket.io@4.7.5: + resolution: {integrity: sha512-DmeAkF6cwM9jSfmp6Dr/5/mfMwb5Z5qRrSXLpo3Fq5SqyU8CMF15jIN4ZhfSwu35ksM1qmHZDQ/DK5XTccSTvA==} + engines: {node: '>=10.2.0'} + dependencies: + accepts: 1.3.8 + base64id: 2.0.0 + cors: 2.8.5 + debug: 4.3.4 + engine.io: 6.5.4 + socket.io-adapter: 2.5.4 + socket.io-parser: 4.2.4 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + dev: true + + /statuses@1.5.0: + resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} + engines: {node: '>= 0.6'} + dev: true + + /statuses@2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + dev: true + + /streamroller@3.1.5: + resolution: {integrity: sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==} + engines: {node: '>=8.0'} + dependencies: + date-format: 4.0.14 + debug: 4.3.4 + fs-extra: 8.1.0 + transitivePeerDependencies: + - supports-color + dev: true + + /string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + + /supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + + /tmp@0.2.3: + resolution: {integrity: sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==} + engines: {node: '>=14.14'} + dev: true + + /to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: true + + /toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + dev: true + + /type-is@1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + dev: true + + /ua-parser-js@0.7.37: + resolution: {integrity: sha512-xV8kqRKM+jhMvcHWUKthV9fNebIzrNy//2O9ZwWcfiBFR5f25XVZPLlEajk/sf3Ra15V92isyQqnIEXRDaZWEA==} + dev: true + + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true + + /universalify@0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} + dev: true + + /unpipe@1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + dev: true + + /utils-merge@1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + dev: true + + /vary@1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + dev: true + + /void-elements@2.0.1: + resolution: {integrity: sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==} + engines: {node: '>=0.10.0'} + dev: true + + /which@1.3.1: + resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true + + /ws@8.11.0: + resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + + /yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + dev: true + + /yargs@16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.2 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + dev: true From f2f4f65278a25381c9ef5294bd0c8096f47377af Mon Sep 17 00:00:00 2001 From: liquidz Date: Mon, 1 Apr 2024 16:02:56 +0900 Subject: [PATCH 4/9] test: Add doo configuration for karma --- project.clj | 1 + 1 file changed, 1 insertion(+) diff --git a/project.clj b/project.clj index 479527c..8c6aaf7 100644 --- a/project.clj +++ b/project.clj @@ -13,6 +13,7 @@ :aliases {"test:cljs" ["doo" "chrome-headless" "test" "once"] "bump-version" ["change" "version" "leiningen.release/bump-version"]} :plugins [[lein-doo "0.1.11"]] + :doo {:paths {:karma "node_modules/karma/bin/karma"}} ;; Switch to Figwheel Main when this issue is solved ;; https://github.com/bhauman/figwheel-main/issues/159 :cljsbuild {:builds [{:id "test" From 5126e7c1a71ecb8128875d743480a652f329be84 Mon Sep 17 00:00:00 2001 From: liquidz Date: Fri, 20 Oct 2023 14:26:01 +0900 Subject: [PATCH 5/9] style: Apply cljstyle --- .cljstyle | 15 + dev/cljs/user.cljs | 15 +- dev/test.clj | 57 +- dev/user.clj | 3 +- script/cljs/test_runner.cljs | 17 +- src/kintone_client/app.cljc | 5 +- src/kintone_client/authentication.cljc | 17 +- src/kintone_client/connection.cljc | 46 +- src/kintone_client/record.cljc | 11 +- src/kintone_client/url.cljc | 3 +- src/kintone_client/user.cljc | 11 +- test/kintone_client/app_test.clj | 11 +- test/kintone_client/app_test.cljs | 1249 ++++++++--------- test/kintone_client/authentication_test.cljc | 9 +- test/kintone_client/connection_test.cljc | 911 ++++++------- test/kintone_client/record_test.clj | 77 +- test/kintone_client/record_test.cljs | 1147 ++++++++-------- test/kintone_client/test_helper.cljc | 15 +- test/kintone_client/url_test.cljc | 791 +++++------ test/kintone_client/user_test.clj | 13 +- test/kintone_client/user_test.cljs | 1285 +++++++++--------- 21 files changed, 2875 insertions(+), 2833 deletions(-) create mode 100644 .cljstyle diff --git a/.cljstyle b/.cljstyle new file mode 100644 index 0000000..bdedb99 --- /dev/null +++ b/.cljstyle @@ -0,0 +1,15 @@ +{:rules {:indentation {:list-indent 1 + :indents {#"^(.*/)?def.*" [[:inner 0]] + #"^(.*/)?with-" [[:inner 0]] + defrecord [[:inner 0] [:inner 1]] + cond-> [[:inner 0]]}} + :comments {:enabled? false} + :blank-lines {:insert-padding? false + :trim-consecutive? true} + :vars {:enabled? false} + :functions {:enabled? false} + :types {:enabled? false} + :namespaces {:indent-size 1}} + :files {:ignore #{"out" "target"}}} + +;; vim: ft=clojure diff --git a/dev/cljs/user.cljs b/dev/cljs/user.cljs index 131eaac..43c61d2 100644 --- a/dev/cljs/user.cljs +++ b/dev/cljs/user.cljs @@ -1,11 +1,12 @@ (ns cljs.user - (:require [cljs-test-display.core] - [figwheel.main.testing :refer-macros [run-tests run-tests-async]] - ;; require all the namespaces that have tests in them - [kintone-client.authentication-test] - [kintone-client.connection-test] - [kintone-client.record-test] - [kintone-client.url-test])) + (:require + [cljs-test-display.core] + [figwheel.main.testing :refer-macros [run-tests run-tests-async]] + ;; require all the namespaces that have tests in them + [kintone-client.authentication-test] + [kintone-client.connection-test] + [kintone-client.record-test] + [kintone-client.url-test])) (goog-define ^boolean DEBUG false) diff --git a/dev/test.clj b/dev/test.clj index c4387a4..12f9ffb 100644 --- a/dev/test.clj +++ b/dev/test.clj @@ -1,14 +1,15 @@ (ns test - (:require [clojure.core.async :refer [ ( ( ( ( ( ( ( {} - basic (assoc "Authorization" (str "Basic " basic)) - password (assoc "X-Cybozu-Authorization" password) - api-token (assoc "X-Cybozu-API-Token" api-token)))) + (cond-> {} + basic (assoc "Authorization" (str "Basic " basic)) + password (assoc "X-Cybozu-Authorization" password) + api-token (assoc "X-Cybozu-API-Token" api-token)))) (defn new-auth "Make a new Auth object. diff --git a/src/kintone_client/connection.cljc b/src/kintone_client/connection.cljc index 665fec0..43a26ac 100644 --- a/src/kintone_client/connection.cljc +++ b/src/kintone_client/connection.cljc @@ -1,17 +1,23 @@ (ns kintone-client.connection "Connection object has connection information to call kintone API" - (:require #?(:clj [cheshire.core :as json]) - #?(:clj [clj-http.client :as client] - :cljs [ajax.core :as ajax]) - #?(:clj [clojure.core.async :refer [chan put! thread]] - :cljs [cljs.core.async :refer [chan put!]]) - [clojure.string :as str] - [kintone-client.protocols :as pt] - [kintone-client.types :as t] - #?(:cljs [goog.object :as go])) - #?(:clj (:import (clojure.lang ExceptionInfo) - (java.lang Exception) - (org.apache.http.entity.mime HttpMultipartMode)))) + (:require + #?(:clj [cheshire.core :as json]) + #?(:clj [clj-http.client :as client] + :cljs [ajax.core :as ajax]) + #?(:clj [clojure.core.async :refer [chan put! thread]] + :cljs [cljs.core.async :refer [chan put!]]) + [clojure.string :as str] + #?(:cljs [goog.object :as go]) + [kintone-client.protocols :as pt] + [kintone-client.types :as t]) + #?(:clj + (:import + (clojure.lang + ExceptionInfo) + (java.lang + Exception) + (org.apache.http.entity.mime + HttpMultipartMode)))) (def ^:dynamic ^:private *default-req* "Default request parameters." @@ -131,8 +137,8 @@ (-user-api-url [_ path] (str "https://" domain path)) (-get [this url req] - ;; Use POST method to pass the URL bytes limitation in kintone API. - ;; User API does not support 'post-as-get' request. + ;; Use POST method to pass the URL bytes limitation in kintone API. + ;; User API does not support 'post-as-get' request. (if (str/includes? url "/k/") (pt/-post this url (post-as-get req)) (let [c (chan) @@ -184,12 +190,12 @@ handler (->handler handler c) error-handler (->error-handler error-handler c)] #?(:clj (thread - (try - (handler (client/post url req)) - (catch ExceptionInfo e - (error-handler e)) - (catch Exception e - (error-handler e)))) + (try + (handler (client/post url req)) + (catch ExceptionInfo e + (error-handler e)) + (catch Exception e + (error-handler e)))) :cljs (ajax/POST (add-csrf-token-to-url url) req)) c))) diff --git a/src/kintone_client/record.cljc b/src/kintone_client/record.cljc index 3bec366..8ce9e19 100644 --- a/src/kintone_client/record.cljc +++ b/src/kintone_client/record.cljc @@ -1,9 +1,10 @@ (ns kintone-client.record - (:require #?(:clj [clojure.core.async :refer [go go-loop KintoneResponse {:url "https://test.kintone.com/k/v1/app.json" - :req {:params {:id app}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/app.json" + :req {:params {:id app}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/form.json" - :req {:params {:app app}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/form.json" + :req {:params {:app app}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/apps.json" - :req {:params {}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/apps.json" - :req {:params {:offset 10 + (go + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/apps.json" + :req {:params {}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/apps.json" + :req {:params {:offset 10 + :limit 20 + :codes ["code1" "code2"] + :name "app-name" + :ids [100 200] + :spaceIds [1 2]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/app/form/layout.json" - :req {:params {:app 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/layout.json" - :req {:params {:app 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/app/form/layout.json" + :req {:params {:app 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/layout.json" + :req {:params {:app 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/layout.json" - :req {:params {:app 100 - :layout [{:type "ROW" :fields [{:type "SINGLE_LINE_TEXT" - :code "TEXT1" - :size {:width "100"}}]} - {:type "ROW" :fields [{:type "FILE" - :code "FILE1" - :size {:width "200"}} - {:type "DATE" - :code "DATE1" - :size {:width "300"}}]}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/layout.json" - :req {:params {:app 100 - :layout [{:type "ROW" :fields [{:type "SINGLE_LINE_TEXT" - :code "TEXT1" - :size {:width "100"}}]} - {:type "ROW" :fields [{:type "FILE" - :code "FILE1" - :size {:width "200"}} - {:type "DATE" - :code "DATE1" - :size {:width "300"}}]}] - :revision 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/layout.json" + :req {:params {:app 100 + :layout [{:type "ROW" :fields [{:type "SINGLE_LINE_TEXT" + :code "TEXT1" + :size {:width "100"}}]} + {:type "ROW" :fields [{:type "FILE" + :code "FILE1" + :size {:width "200"}} + {:type "DATE" + :code "DATE1" + :size {:width "300"}}]}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/layout.json" + :req {:params {:app 100 + :layout [{:type "ROW" :fields [{:type "SINGLE_LINE_TEXT" + :code "TEXT1" + :size {:width "100"}}]} + {:type "ROW" :fields [{:type "FILE" + :code "FILE1" + :size {:width "200"}} + {:type "DATE" + :code "DATE1" + :size {:width "300"}}]}] + :revision 5}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/app/form/fields.json" - :req {:params {:app 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/app/form/fields.json" + :req {:params {:app 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/fields.json" - :req {:params {:app 100 - :properties {:TEXT1 {:type "SINGLE_LINE_TEXT" - :code "TEXT1" - :label "文字列1行"} - :ファイル {:type "FILE" - :code "ファイル" - :label "ファイル"} - :checkbox {:type "CHECK_BOX" - :code "checkbox" - :label "チェックボックス" - :options {:A {:label "A" :index 1} - :B {:label "B" :index 2} - ":C" {:label ":C" :index 3}} - :defaultValue ["A"]}}}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/fields.json" - :req {:params {:app 100 - :properties {:TEXT1 {:type "SINGLE_LINE_TEXT" - :code "TEXT1" - :label "文字列1行"} - :ファイル {:type "FILE" - :code "ファイル" - :label "ファイル"} - :checkbox {:type "CHECK_BOX" - :code "checkbox" - :label "チェックボックス" - :options {:A {:label "A" :index 1} - :B {:label "B" :index 2} - ":C" {:label ":C" :index 3}} - :defaultValue ["A"]}} - :revision 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/fields.json" + :req {:params {:app 100 + :properties {:TEXT1 {:type "SINGLE_LINE_TEXT" + :code "TEXT1" + :label "文字列1行"} + :ファイル {:type "FILE" + :code "ファイル" + :label "ファイル"} + :checkbox {:type "CHECK_BOX" + :code "checkbox" + :label "チェックボックス" + :options {:A {:label "A" :index 1} + :B {:label "B" :index 2} + ":C" {:label ":C" :index 3}} + :defaultValue ["A"]}}}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/fields.json" + :req {:params {:app 100 + :properties {:TEXT1 {:type "SINGLE_LINE_TEXT" + :code "TEXT1" + :label "文字列1行"} + :ファイル {:type "FILE" + :code "ファイル" + :label "ファイル"} + :checkbox {:type "CHECK_BOX" + :code "checkbox" + :label "チェックボックス" + :options {:A {:label "A" :index 1} + :B {:label "B" :index 2} + ":C" {:label ":C" :index 3}} + :defaultValue ["A"]}} + :revision 5}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/fields.json" - :req {:params {:app 100 - :properties {:TEXT1 {:type "SINGLE_LINE_TEXT" - :code "TEXT1" - :label "変更後"}}}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/fields.json" - :req {:params {:app 100 - :properties {:TEXT1 {:type "SINGLE_LINE_TEXT" - :code "TEXT1" - :label "変更後"}} - :revision 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/fields.json" + :req {:params {:app 100 + :properties {:TEXT1 {:type "SINGLE_LINE_TEXT" + :code "TEXT1" + :label "変更後"}}}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/fields.json" + :req {:params {:app 100 + :properties {:TEXT1 {:type "SINGLE_LINE_TEXT" + :code "TEXT1" + :label "変更後"}} + :revision 5}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/fields.json" - :req {:params {:app 100 - :fields ["code1" "code_2"]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/fields.json" - :req {:params {:app 100 - :fields ["code1" "code_2"] - :revision 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/fields.json" + :req {:params {:app 100 + :fields ["code1" "code_2"]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/form/fields.json" + :req {:params {:app 100 + :fields ["code1" "code_2"] + :revision 5}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app.json" - :req {:params {:name "TEST-APP"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app.json" - :req {:params {:name "TEST-APP" - :thread 50 - :space 51}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app.json" + :req {:params {:name "TEST-APP"}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app.json" + :req {:params {:name "TEST-APP" + :thread 50 + :space 51}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/deploy.json" - :req {:params {:apps [{:app 100} - {:app 101 - :revision 5}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/deploy.json" - :req {:params {:apps [{:app 100} - {:app 101 - :revision 5}] - :revert true}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/deploy.json" + :req {:params {:apps [{:app 100} + {:app 101 + :revision 5}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/deploy.json" + :req {:params {:apps [{:app 100} + {:app 101 + :revision 5}] + :revert true}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/deploy.json" - :req {:params {:apps [100 101]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/deploy.json" + :req {:params {:apps [100 101]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/app/views.json" - :req {:params {:app 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/views.json" - :req {:params {:app 100 - :lang "en"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/app/views.json" + :req {:params {:app 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/views.json" + :req {:params {:app 100 + :lang "en"}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/views.json" - :req {:params {:app 100 - :views {:view1 {:index "0" + (go + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/views.json" + :req {:params {:app 100 + :views {:view1 {:index "0" + :type "LIST" + :name "view1" + :fields ["作成者"] + :filterCond "更新日時 > \"2012-02-03T09:00:00Z\""} + :cal {:index "1" + :type "CALENDAR" + :name "cal"}}}}} + nil) + ( \"2012-02-03T09:00:00Z\""} :cal {:index "1" :type "CALENDAR" - :name "cal"}}}}} - nil) - ( \"2012-02-03T09:00:00Z\""} - :cal {:index "1" - :type "CALENDAR" - :name "cal"}} {})))) - (done)))) + :name "cal"}} {})))) + (done)))) (deftest get-general-settings-test (async done - (go - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/app/settings.json" - :req {:params {:app 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/settings.json" - :req {:params {:app 100 - :lang "en"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/app/settings.json" + :req {:params {:app 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/settings.json" + :req {:params {:app 100 + :lang "en"}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/settings.json" - :req {:params {:app 100 - :name "new-NAME" - :description "

new-DESCRIPTION

" - :icon {:type "PRESET" - :key "APP65"} - :theme "RED"}}} - nil) - (new-DESCRIPTION" - :icon {:type "PRESET" - :key "APP65"} - :theme "RED"} {})))) - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/settings.json" - :req {:params {:app 100 - :name "new-NAME" - :description "

new-DESCRIPTION

" - :icon {:type "PRESET" - :key "APP65"} - :theme "RED" - :revision 5}}} - nil) - (new-DESCRIPTION" - :icon {:type "PRESET" - :key "APP65"} - :theme "RED"} {:revision 5})))) - (done)))) + (go + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/settings.json" + :req {:params {:app 100 + :name "new-NAME" + :description "

new-DESCRIPTION

" + :icon {:type "PRESET" + :key "APP65"} + :theme "RED"}}} + nil) + (new-DESCRIPTION" + :icon {:type "PRESET" + :key "APP65"} + :theme "RED"} {})))) + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/settings.json" + :req {:params {:app 100 + :name "new-NAME" + :description "

new-DESCRIPTION

" + :icon {:type "PRESET" + :key "APP65"} + :theme "RED" + :revision 5}}} + nil) + (new-DESCRIPTION" + :icon {:type "PRESET" + :key "APP65"} + :theme "RED"} {:revision 5})))) + (done)))) (deftest get-status-test (async done - (go - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/app/status.json" - :req {:params {:app 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/status.json" - :req {:params {:app 100 - :lang "en"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/app/status.json" + :req {:params {:app 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/status.json" + :req {:params {:app 100 + :lang "en"}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/status.json" - :req {:params {:app 100 - :enable true - :states {:s1 {:name "s1" - :index "0"} - :s2 {:name "s2" - :index "1"}} - :actions [{:name "a1" - :from "s1" - :to "s2"}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/status.json" - :req {:params {:app 100 - :enable true - :states {:s1 {:name "s1" - :index "0"} - :s2 {:name "s2" - :index "1"}} - :actions [{:name "a1" - :from "s1" - :to "s2"}] - :revision 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/status.json" + :req {:params {:app 100 + :enable true + :states {:s1 {:name "s1" + :index "0"} + :s2 {:name "s2" + :index "1"}} + :actions [{:name "a1" + :from "s1" + :to "s2"}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/status.json" + :req {:params {:app 100 + :enable true + :states {:s1 {:name "s1" + :index "0"} + :s2 {:name "s2" + :index "1"}} + :actions [{:name "a1" + :from "s1" + :to "s2"}] + :revision 5}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/app/customize.json" - :req {:params {:app 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/customize.json" - :req {:params {:app 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/app/customize.json" + :req {:params {:app 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/customize.json" + :req {:params {:app 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/customize.json" - :req {:params {:app 100 - :scope "ADMIN" - :desktop {:js [{:type "URL" - :url "https://example.com/app.js"} - {:type "FILE" - :file {:fileKey "key1"}}] - :css [{:type "URL" - :url "https://example.net/style.css"}]} - :mobile {:js [{:type "FILE" - :file {:fileKey "key2"}}] - :css [{:type "URL" - :url "https://example.net/mobile.css"}]}}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/customize.json" - :req {:params {:app 100 - :scope "ADMIN" - :desktop {:js [{:type "URL" - :url "https://example.com/app.js"} - {:type "FILE" - :file {:fileKey "key1"}}] - :css [{:type "URL" - :url "https://example.net/style.css"}]} - :mobile {:js [{:type "FILE" - :file {:fileKey "key2"}}] - :css [{:type "URL" - :url "https://example.net/mobile.css"}]} - :revision 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/customize.json" + :req {:params {:app 100 + :scope "ADMIN" + :desktop {:js [{:type "URL" + :url "https://example.com/app.js"} + {:type "FILE" + :file {:fileKey "key1"}}] + :css [{:type "URL" + :url "https://example.net/style.css"}]} + :mobile {:js [{:type "FILE" + :file {:fileKey "key2"}}] + :css [{:type "URL" + :url "https://example.net/mobile.css"}]}}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/customize.json" + :req {:params {:app 100 + :scope "ADMIN" + :desktop {:js [{:type "URL" + :url "https://example.com/app.js"} + {:type "FILE" + :file {:fileKey "key1"}}] + :css [{:type "URL" + :url "https://example.net/style.css"}]} + :mobile {:js [{:type "FILE" + :file {:fileKey "key2"}}] + :css [{:type "URL" + :url "https://example.net/mobile.css"}]} + :revision 5}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/app/acl.json" - :req {:params {:app 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/acl.json" - :req {:params {:app 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/app/acl.json" + :req {:params {:app 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/acl.json" + :req {:params {:app 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/acl.json" - :req {:params {:app 100 - :rights [{:entity {:type "GROUP" - :code "Administrators"} - :appEditable true - :recordViewable false - :recordAddable false} - {:entity {:type "CREATOR"} - :appEditable true - :recordViewable true - :recordAddable true - :recordEditable true - :recordDeletable true - :recordImportable true - :recordExportable true}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/acl.json" - :req {:params {:app 100 - :rights [{:entity {:type "GROUP" - :code "Administrators"} - :appEditable true - :recordViewable false - :recordAddable false} - {:entity {:type "CREATOR"} - :appEditable true - :recordViewable true - :recordAddable true - :recordEditable true - :recordDeletable true - :recordImportable true - :recordExportable true}] - :revision 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/acl.json" + :req {:params {:app 100 + :rights [{:entity {:type "GROUP" + :code "Administrators"} + :appEditable true + :recordViewable false + :recordAddable false} + {:entity {:type "CREATOR"} + :appEditable true + :recordViewable true + :recordAddable true + :recordEditable true + :recordDeletable true + :recordImportable true + :recordExportable true}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/app/acl.json" + :req {:params {:app 100 + :rights [{:entity {:type "GROUP" + :code "Administrators"} + :appEditable true + :recordViewable false + :recordAddable false} + {:entity {:type "CREATOR"} + :appEditable true + :recordViewable true + :recordAddable true + :recordEditable true + :recordDeletable true + :recordImportable true + :recordExportable true}] + :revision 5}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/field/acl.json" - :req {:params {:app 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/field/acl.json" - :req {:params {:app 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/field/acl.json" + :req {:params {:app 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/field/acl.json" + :req {:params {:app 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/field/acl.json" - :req {:params {:app 100 - :rights [{:code "TEXT1" - :entities [{:accessibility "READ" - :entity {:type "GROUP" - :code "Administrators"}} - {:accessibility "NONE" - :entity {:type "GROUP" - :code "everyone"}}]} - {:code "作成者" - :entities [{:accessibility "READ" - :entity {:type "GROUP" - :code "Administrators"}}]}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/field/acl.json" - :req {:params {:app 100 - :rights [{:code "TEXT1" - :entities [{:accessibility "READ" - :entity {:type "GROUP" - :code "Administrators"}} - {:accessibility "NONE" - :entity {:type "GROUP" - :code "everyone"}}]} - {:code "作成者" - :entities [{:accessibility "READ" - :entity {:type "GROUP" - :code "Administrators"}}]}] - :revision 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/field/acl.json" + :req {:params {:app 100 + :rights [{:code "TEXT1" + :entities [{:accessibility "READ" + :entity {:type "GROUP" + :code "Administrators"}} + {:accessibility "NONE" + :entity {:type "GROUP" + :code "everyone"}}]} + {:code "作成者" + :entities [{:accessibility "READ" + :entity {:type "GROUP" + :code "Administrators"}}]}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/preview/field/acl.json" + :req {:params {:app 100 + :rights [{:code "TEXT1" + :entities [{:accessibility "READ" + :entity {:type "GROUP" + :code "Administrators"}} + {:accessibility "NONE" + :entity {:type "GROUP" + :code "everyone"}}]} + {:code "作成者" + :entities [{:accessibility "READ" + :entity {:type "GROUP" + :code "Administrators"}}]}] + :revision 5}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/field/acl.json" - :req {:params {:app 100 - :rights [{:code "TEXT1" - :entities [{:accessibility "READ" - :entity {:type "GROUP" - :code "Administrators"}} - {:accessibility "NONE" - :entity {:type "GROUP" - :code "everyone"}}]} - {:code "作成者" - :entities [{:accessibility "READ" - :entity {:type "GROUP" - :code "Administrators"}}]}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/field/acl.json" - :req {:params {:app 100 - :rights [{:code "TEXT1" - :entities [{:accessibility "READ" - :entity {:type "GROUP" - :code "Administrators"}} - {:accessibility "NONE" - :entity {:type "GROUP" - :code "everyone"}}]} - {:code "作成者" - :entities [{:accessibility "READ" - :entity {:type "GROUP" - :code "Administrators"}}]}] - :revision 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/field/acl.json" + :req {:params {:app 100 + :rights [{:code "TEXT1" + :entities [{:accessibility "READ" + :entity {:type "GROUP" + :code "Administrators"}} + {:accessibility "NONE" + :entity {:type "GROUP" + :code "everyone"}}]} + {:code "作成者" + :entities [{:accessibility "READ" + :entity {:type "GROUP" + :code "Administrators"}}]}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/field/acl.json" + :req {:params {:app 100 + :rights [{:code "TEXT1" + :entities [{:accessibility "READ" + :entity {:type "GROUP" + :code "Administrators"}} + {:accessibility "NONE" + :entity {:type "GROUP" + :code "everyone"}}]} + {:code "作成者" + :entities [{:accessibility "READ" + :entity {:type "GROUP" + :code "Administrators"}}]}] + :revision 5}}} + nil) + (KintoneResponse - {:headers {"X-Cybozu-API-Token" "TestApiToken" - "X-HTTP-Method-Override" "GET" - "X-Requested-With" "XMLHttpRequest"} - :format :json - :response-format :json - :keywords? true - :timeout 30000 - :params {:id 1}} - nil) - (KintoneResponse + {:headers {"X-Cybozu-API-Token" "TestApiToken" + "X-HTTP-Method-Override" "GET" + "X-Requested-With" "XMLHttpRequest"} + :format :json + :response-format :json + :keywords? true + :timeout 30000 + :params {:id 1}} + nil) + (KintoneResponse - {:headers {"X-Cybozu-API-Token" "TestApiToken" - "X-Requested-With" "XMLHttpRequest"} - :format :json - :response-format :json - :keywords? true - :timeout 30000 - :query-params {:id 1}} - nil) - (KintoneResponse + {:headers {"X-Cybozu-API-Token" "TestApiToken" + "X-Requested-With" "XMLHttpRequest"} + :format :json + :response-format :json + :keywords? true + :timeout 30000 + :query-params {:id 1}} + nil) + (KintoneResponse - {:id 1} - nil) - (KintoneResponse + {:id 1} + nil) + (KintoneResponse - {:id 1} - nil) - (KintoneResponse + {:id 1} + nil) + (KintoneResponse - nil - {:status 400 - :status-text "400" - :response {:message "Something bad happen"}}) - (KintoneResponse + nil + {:status 400 + :status-text "400" + :response {:message "Something bad happen"}}) + (KintoneResponse - nil - {:status 400 :status-text "400" - :response {:message "Something bad happen"}}) - (KintoneResponse + nil + {:status 400 :status-text "400" + :response {:message "Something bad happen"}}) + (KintoneResponse - nil - {:message "Something bad happen"}) - (KintoneResponse + nil + {:message "Something bad happen"}) + (KintoneResponse - nil - {:message "Something bad happen"}) - (KintoneResponse + nil + {:message "Something bad happen"}) + (KintoneResponse - {:headers {"X-Cybozu-API-Token" "TestApiToken" - "X-Requested-With" "XMLHttpRequest"} - :format :json - :response-format :json - :keywords? true - :timeout 30000 - :params {:id 1}} - nil) - (KintoneResponse + {:headers {"X-Cybozu-API-Token" "TestApiToken" + "X-Requested-With" "XMLHttpRequest"} + :format :json + :response-format :json + :keywords? true + :timeout 30000 + :params {:id 1}} + nil) + (KintoneResponse - {:id 1} - nil) - (KintoneResponse + {:id 1} + nil) + (KintoneResponse - nil - {:status 400 - :status-text "400" - :response {:message "Something bad happen"}}) - (KintoneResponse + nil + {:status 400 + :status-text "400" + :response {:message "Something bad happen"}}) + (KintoneResponse - nil - 400) - (KintoneResponse + nil + 400) + (KintoneResponse - {:headers {"X-Cybozu-API-Token" "TestApiToken" - "X-Requested-With" "XMLHttpRequest"} - :format :json - :response-format :json - :keywords? true - :timeout 30000 - :params {:id 1}} - nil) - (KintoneResponse + {:headers {"X-Cybozu-API-Token" "TestApiToken" + "X-Requested-With" "XMLHttpRequest"} + :format :json + :response-format :json + :keywords? true + :timeout 30000 + :params {:id 1}} + nil) + (KintoneResponse - {:headers {"X-Cybozu-API-Token" "TestApiToken" - "X-Requested-With" "XMLHttpRequest"} - :format :json - :response-format :json - :keywords? true - :timeout 30000 - :params {:id 2}} - nil) - (KintoneResponse + {:headers {"X-Cybozu-API-Token" "TestApiToken" + "X-Requested-With" "XMLHttpRequest"} + :format :json + :response-format :json + :keywords? true + :timeout 30000 + :params {:id 2}} + nil) + (KintoneResponse - nil - {:status 400 - :status-text "400" - :response {:message "Something bad happen"}}) - (KintoneResponse + nil + {:status 400 + :status-text "400" + :response {:message "Something bad happen"}}) + (KintoneResponse - nil - "Something bad happen") - (KintoneResponse + nil + "Something bad happen") + (KintoneResponse - {:headers {"X-Cybozu-API-Token" "TestApiToken" - "X-Requested-With" "XMLHttpRequest"} - :format :json - :response-format :json - :keywords? true - :timeout 30000 - :params {:id 1}} - nil) - (KintoneResponse + {:headers {"X-Cybozu-API-Token" "TestApiToken" + "X-Requested-With" "XMLHttpRequest"} + :format :json + :response-format :json + :keywords? true + :timeout 30000 + :params {:id 1}} + nil) + (KintoneResponse - {:id 1} - nil) - (KintoneResponse + {:id 1} + nil) + (KintoneResponse - nil - {:status 400 - :status-text "400" - :response {:message "Something bad happen"}}) - (KintoneResponse + nil + {:status 400 + :status-text "400" + :response {:message "Something bad happen"}}) + (KintoneResponse - nil - {:message "Something bad happen"}) - (KintoneResponse + nil + {:message "Something bad happen"}) + (KintoneResponse - nil - {:status 400 - :status-text "400" - :response {:message "Something bad happen"}}) - (KintoneResponse + nil + {:status 400 + :status-text "400" + :response {:message "Something bad happen"}}) + (KintoneResponse - nil - {:message "Something bad happen"}) - (KintoneResponse + nil + {:message "Something bad happen"}) + (KintoneResponse - nil - {:status 400 - :status-text "400" - :response {:message "Something bad happen"}}) - (KintoneResponse + nil + {:status 400 + :status-text "400" + :response {:message "Something bad happen"}}) + (KintoneResponse - nil - {:message "Something bad happen"}) - (KintoneResponse + nil + {:message "Something bad happen"}) + (KintoneResponse {:url "https://test.kintone.com/k/v1/records/cursor.json" @@ -56,8 +57,8 @@ :size 123}}} nil) ( 100" - :size 123}))))) + :query "$id > 100" + :size 123}))))) (deftest get-records-by-cursor-test (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records/cursor.json" @@ -174,7 +175,7 @@ {:name {:value "bar"}}]}}} nil) (KintoneResponse nil {:status 400}) (KintoneResponse nil {:status 400}) (KintoneResponse {:url "https://test.kintone.com/k/v1/record/comment.json" @@ -458,8 +459,8 @@ :type :USER}]}}}} nil) (KintoneResponse {:url "https://test.kintone.com/k/v1/record/comment.json" @@ -505,9 +506,9 @@ :revision 11}}} nil) (BulkRequest :PUT "/v1/records/status.json" @@ -539,13 +540,13 @@ :assignee ["baz"]}]}}} nil) (KintoneResponse {:url "https://test.kintone.com/k/v1/file.json" diff --git a/test/kintone_client/record_test.cljs b/test/kintone_client/record_test.cljs index 39f4850..8249230 100644 --- a/test/kintone_client/record_test.cljs +++ b/test/kintone_client/record_test.cljs @@ -1,9 +1,10 @@ (ns kintone-client.record-test - (:require [cljs.test :refer-macros [deftest is testing async]] - [cljs.core.async :refer [KintoneResponse {:url "https://test.kintone.com/k/v1/record.json" - :req {:params {:app app :id id}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/record.json" + :req {:params {:app app :id id}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" - :req {:params {:app app - :totalCount true}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" - :req {:params {:app app - :totalCount true}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" - :req {:params {:app app - :totalCount true - :fields [:$id :name] - :query "order by $id limit 10"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" + :req {:params {:app app + :totalCount true}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" + :req {:params {:app app + :totalCount true}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" + :req {:params {:app app + :totalCount true :fields [:$id :name] - :query "order by $id limit 10"})))) - (done)))) + :query "order by $id limit 10"}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/records/cursor.json" - :req {:params {:app app :size 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/records/cursor.json" - :req {:params {:app app :size 100}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/records/cursor.json" - :req {:params {:app app - :fields [:$id :name] - :query "$id > 100" - :size 123}}} - nil) - ( 100" - :size 123})))) - (done)))) + (go + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records/cursor.json" + :req {:params {:app app :size 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/records/cursor.json" + :req {:params {:app app :size 100}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/records/cursor.json" + :req {:params {:app app + :fields [:$id :name] + :query "$id > 100" + :size 123}}} + nil) + ( 100" + :size 123})))) + (done)))) (deftest get-records-by-cursor-test (async done - (go - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records/cursor.json" - :req {:params {:id "123-456"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/records/cursor.json" + :req {:params {:id "123-456"}}} + nil) + (KintoneResponse nil {:status 500})) - c))] - (is (= (t/->KintoneResponse nil {:status 500}) - (KintoneResponse nil {:status 500})) + c))] + (is (= (t/->KintoneResponse nil {:status 500}) + (KintoneResponse {:id "123-123"} nil)) - c)) - r/get-records-by-cursor - (fn [conn cursor] - (let [c (chan)] - (put! c (t/->KintoneResponse nil {:status 400})) - c))] - (is (= (t/->KintoneResponse nil {:status 400}) - (KintoneResponse {:id "123-123"} nil)) + c)) + r/get-records-by-cursor + (fn [conn cursor] + (let [c (chan)] + (put! c (t/->KintoneResponse nil {:status 400})) + c))] + (is (= (t/->KintoneResponse nil {:status 400}) + (KintoneResponse {:id "123-123"} nil)) - c)) - r/get-records-by-cursor - (fn [conn cursor] - (let [c (chan)] - (if (< @ncall 2) - (do (swap! ncall inc) - (put! c (t/->KintoneResponse {:records [{:id 1} {:id 2}] - :next true} - nil))) - (put! c (t/->KintoneResponse nil {:status 400}))) - c))] - (is (= (t/->KintoneResponse nil {:status 400}) - (KintoneResponse {:id "123-123"} nil)) + c)) + r/get-records-by-cursor + (fn [conn cursor] + (let [c (chan)] + (if (< @ncall 2) + (do (swap! ncall inc) + (put! c (t/->KintoneResponse {:records [{:id 1} {:id 2}] + :next true} + nil))) + (put! c (t/->KintoneResponse nil {:status 400}))) + c))] + (is (= (t/->KintoneResponse nil {:status 400}) + (KintoneResponse {:id "123-123"} nil)) - c)) - r/get-records-by-cursor - (fn [conn cursor] - (let [c (chan)] - (if (< @ncall 2) - (do (swap! ncall inc) - (put! c (t/->KintoneResponse {:records [{:id 1} {:id 2}] - :next true} - nil))) - (put! c (t/->KintoneResponse {:records [{:id 3} {:id 4}] - :next false} - nil))) - c))] - (is (= (t/->KintoneResponse {:records [{:id 1} - {:id 2} - {:id 1} - {:id 2} - {:id 3} - {:id 4}]} nil) - (KintoneResponse {:id "123-123"} nil)) + c)) + r/get-records-by-cursor + (fn [conn cursor] + (let [c (chan)] + (if (< @ncall 2) + (do (swap! ncall inc) + (put! c (t/->KintoneResponse {:records [{:id 1} {:id 2}] + :next true} + nil))) + (put! c (t/->KintoneResponse {:records [{:id 3} {:id 4}] + :next false} + nil))) + c))] + (is (= (t/->KintoneResponse {:records [{:id 1} + {:id 2} + {:id 1} + {:id 2} + {:id 3} + {:id 4}]} nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/records/cursor.json" - :req {:params {:id "112-112"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/records/cursor.json" + :req {:params {:id "112-112"}}} + nil) + (BulkRequest :POST "/v1/record.json" - {:app app - :record {:name {:value "foo"}}}) - (r/add-record app {:name {:value "foo"}}))) - - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/record.json" - :req {:params {:app app}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/record.json" - :req {:params {:app app - :record {:name {:value "foo"}}}}} - nil) - (BulkRequest :POST "/v1/record.json" + {:app app + :record {:name {:value "foo"}}}) + (r/add-record app {:name {:value "foo"}}))) + + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/record.json" + :req {:params {:app app}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/record.json" + :req {:params {:app app + :record {:name {:value "foo"}}}}} + nil) + (BulkRequest :POST "/v1/records.json" - {:app app - :records [{:name {:value "foo"}} - {:name {:value "bar"}}]}) - (r/add-records app [{:name {:value "foo"}} - {:name {:value "bar"}}]))) - - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" - :req {:params {:app app - :records [{:name {:value "foo"}} - {:name {:value "bar"}}]}}} - nil) - (BulkRequest :POST "/v1/records.json" + {:app app + :records [{:name {:value "foo"}} + {:name {:value "bar"}}]}) + (r/add-records app [{:name {:value "foo"}} + {:name {:value "bar"}}]))) + + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" + :req {:params {:app app + :records [{:name {:value "foo"}} + {:name {:value "bar"}}]}}} + nil) + (KintoneResponse nil {:status 400})) - c))] - (is (= (t/->KintoneResponse nil {:status 400}) - (KintoneResponse nil {:status 400})) + c))] + (is (= (t/->KintoneResponse nil {:status 400}) + (KintoneResponse {:ids ["1" "2"] - :revisions ["1" "1"]} - nil))) - (put! c (t/->KintoneResponse nil {:status 500}))) - c))] - (is (= (t/->KintoneResponse {:ids ["1" "2"] - :revisions ["1" "1"]} - nil) - (KintoneResponse {:ids ["1" "2"] - :revisions ["1" "1"]} - {:status 500}) - (->> (range 110) - (mapv (fn [i] {:name {:value (str i)}})) - (r/add-all-records h/fake-conn app) - KintoneResponse {:ids ["1" "2"] + :revisions ["1" "1"]} + nil))) + (put! c (t/->KintoneResponse nil {:status 500}))) + c))] + (is (= (t/->KintoneResponse {:ids ["1" "2"] + :revisions ["1" "1"]} + nil) + (KintoneResponse {:ids ["1" "2"] + :revisions ["1" "1"]} + {:status 500}) + (->> (range 110) + (mapv (fn [i] {:name {:value (str i)}})) + (r/add-all-records h/fake-conn app) + BulkRequest :PUT "/v1/record.json" - {:app app - :id 1 - :record {:name {:value "foo"}}}) - (r/update-record app {:id 1 - :record {:name {:value "foo"}}}))) - - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/record.json" - :req {:params {:app app - :record {:name {:value "foo"}} - :updateKey {:field "XYZ" - :value "123"}}}} - nil) - (BulkRequest :PUT "/v1/record.json" + {:app app + :id 1 + :record {:name {:value "foo"}}}) + (r/update-record app {:id 1 + :record {:name {:value "foo"}}}))) + + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/record.json" + :req {:params {:app app + :record {:name {:value "foo"}} + :updateKey {:field "XYZ" + :value "123"}}}} + nil) + (BulkRequest :PUT "/v1/records.json" - {:app app - :records [{:id 1 - :record {:name {:value "foo"}}} - {:id 2 - :record {:name {:value "bar"}}}]}) - (r/update-records app [{:id 1 - :record {:name {:value "foo"}}} - {:id 2 - :record {:name {:value "bar"}}}]))) - - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" - :req {:params {:app app - :records [{:id 1 - :record {:name {:value "foo"}}} - {:id 2 - :record {:name {:value "bar"}}}]}}} - nil) - (BulkRequest :PUT "/v1/records.json" + {:app app + :records [{:id 1 + :record {:name {:value "foo"}}} + {:id 2 + :record {:name {:value "bar"}}}]}) + (r/update-records app [{:id 1 + :record {:name {:value "foo"}}} + {:id 2 + :record {:name {:value "bar"}}}]))) + + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" + :req {:params {:app app + :records [{:id 1 + :record {:name {:value "foo"}}} + {:id 2 + :record {:name {:value "bar"}}}]}}} + nil) + (KintoneResponse nil {:status 400})) - c))] - (is (= (t/->KintoneResponse nil {:status 400}) - (KintoneResponse nil {:status 400})) + c))] + (is (= (t/->KintoneResponse nil {:status 400}) + (KintoneResponse {:records [{:id "1" - :revision "2"} - {:id "2" - :revision "1"}]} - nil))) - (put! c (t/->KintoneResponse nil {:status 500}))) - c))] - (is (= (t/->KintoneResponse {:records [{:id "1" - :revision "2"} - {:id "2" - :revision "1"}]} - nil) - (KintoneResponse {:records [{:id "1" - :revision "2"} - {:id "2" - :revision "1"}]} - {:status 500}) - (->> (range 110) - (mapv (fn [i] {:name {:value (str i)}})) - (r/update-all-records h/fake-conn app) - KintoneResponse {:records [{:id "1" + :revision "2"} + {:id "2" + :revision "1"}]} + nil))) + (put! c (t/->KintoneResponse nil {:status 500}))) + c))] + (is (= (t/->KintoneResponse {:records [{:id "1" + :revision "2"} + {:id "2" + :revision "1"}]} + nil) + (KintoneResponse {:records [{:id "1" + :revision "2"} + {:id "2" + :revision "1"}]} + {:status 500}) + (->> (range 110) + (mapv (fn [i] {:name {:value (str i)}})) + (r/update-all-records h/fake-conn app) + BulkRequest :DELETE "/v1/records.json" - {:app app - :ids [1 2 3]}) - (r/delete-records app [1 2 3]))) - - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" - :req {:params {:app app - :ids [1 2 3]}}} - nil) - (BulkRequest :DELETE "/v1/records.json" + {:app app + :ids [1 2 3]}) + (r/delete-records app [1 2 3]))) + + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" + :req {:params {:app app + :ids [1 2 3]}}} + nil) + (BulkRequest :DELETE "/v1/records.json" - {:app app - :ids [1 2] - :revisions [1 1]}) - (r/delete-records-with-revision app [{:id 1 :revision 1} - {:id 2 :revision 1}]))) - - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" - :req {:params {:app app - :ids [1 2] - :revisions [1 1]}}} - nil) - (BulkRequest :DELETE "/v1/records.json" + {:app app + :ids [1 2] + :revisions [1 1]}) + (r/delete-records-with-revision app [{:id 1 :revision 1} + {:id 2 :revision 1}]))) + + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" + :req {:params {:app app + :ids [1 2] + :revisions [1 1]}}} + nil) + (KintoneResponse nil {:status 500})) - c))] - (is (= (t/->KintoneResponse nil {:status 500}) - (KintoneResponse nil {:status 500})) + c))] + (is (= (t/->KintoneResponse nil {:status 500}) + (KintoneResponse {:id "123-123"} nil)) - c)) - r/get-records-by-cursor - (fn [conn cursor] - (let [c (chan)] - (put! c (t/->KintoneResponse nil {:status 400})) - c))] - (is (= (t/->KintoneResponse nil {:status 400}) - (KintoneResponse {:id "123-123"} nil)) + c)) + r/get-records-by-cursor + (fn [conn cursor] + (let [c (chan)] + (put! c (t/->KintoneResponse nil {:status 400})) + c))] + (is (= (t/->KintoneResponse nil {:status 400}) + (KintoneResponse {:id "123-123"} nil)) - c)) - r/get-records-by-cursor - (fn [conn cursor] - (let [c (chan)] - (if (< @ncall 2) - (do (swap! ncall inc) - (put! c (t/->KintoneResponse {:records [{:id 1} {:id 2}] - :next true} - nil))) - (put! c (t/->KintoneResponse nil {:status 400}))) - c))] - (is (= (t/->KintoneResponse nil {:status 400}) - (KintoneResponse {:id "123-123"} nil)) + c)) + r/get-records-by-cursor + (fn [conn cursor] + (let [c (chan)] + (if (< @ncall 2) + (do (swap! ncall inc) + (put! c (t/->KintoneResponse {:records [{:id 1} {:id 2}] + :next true} + nil))) + (put! c (t/->KintoneResponse nil {:status 400}))) + c))] + (is (= (t/->KintoneResponse nil {:status 400}) + (KintoneResponse {:id "123-123"} nil)) - c)) - r/get-records-by-cursor - (fn [conn cursor] - (let [c (chan)] - (put! c (t/->KintoneResponse {:records []} nil)) - c))] - (is (= (t/->KintoneResponse {} nil) - (KintoneResponse {:id "123-123"} nil)) + c)) + r/get-records-by-cursor + (fn [conn cursor] + (let [c (chan)] + (put! c (t/->KintoneResponse {:records []} nil)) + c))] + (is (= (t/->KintoneResponse {} nil) + (KintoneResponse {:id "123-123"} nil)) - c)) - r/get-records-by-cursor - (fn [conn cursor] - (let [c (chan)] - (if (< @ncall 2) - (do (swap! ncall inc) - (put! c (t/->KintoneResponse {:records [{:$id {:value "1"}} - {:$id {:value "2"}}] - :next true} - nil))) - (put! c (t/->KintoneResponse {:records [{:$id {:value "3"}} - {:$id {:value "4"}}] - :next false} - nil))) - c))] - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" - :req {:params {:app app - :ids [3 4]}}} - nil) - (KintoneResponse {:id "123-123"} nil)) + c)) + r/get-records-by-cursor + (fn [conn cursor] + (let [c (chan)] + (if (< @ncall 2) + (do (swap! ncall inc) + (put! c (t/->KintoneResponse {:records [{:$id {:value "1"}} + {:$id {:value "2"}}] + :next true} + nil))) + (put! c (t/->KintoneResponse {:records [{:$id {:value "3"}} + {:$id {:value "4"}}] + :next false} + nil))) + c))] + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records.json" + :req {:params {:app app + :ids [3 4]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/record/comments.json" - :req {:params {:app app - :record id - :order "desc" - :offset 0 - :limit 10}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/record/comments.json" - :req {:params {:app app - :record id - :order "asc" - :offset 20 - :limit 50}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/record/comments.json" + :req {:params {:app app + :record id + :order "desc" + :offset 0 + :limit 10}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/record/comments.json" + :req {:params {:app app + :record id + :order "asc" + :offset 20 + :limit 50}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/record/comment.json" - :req {:params {:app app - :record id - :comment {:text "test comment" - :mentions nil}}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/record/comment.json" - :req {:params {:app app - :record id - :comment {:text "test comment" - :mentions [{:code "foo" - :type :USER}]}}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/record/comment.json" + :req {:params {:app app + :record id + :comment {:text "test comment" + :mentions nil}}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/record/comment.json" + :req {:params {:app app + :record id + :comment {:text "test comment" + :mentions [{:code "foo" + :type :USER}]}}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/record/comment.json" - :req {:params {:app app - :record id - :comment 2}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/record/comment.json" + :req {:params {:app app + :record id + :comment 2}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/record/assignees.json" - :req {:params {:app app - :record id - :assignees "foo"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/record/assignees.json" - :req {:params {:app app - :record id - :assignees "foo" - :revision 11}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/record/assignees.json" + :req {:params {:app app + :record id + :assignees "foo"}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/record/assignees.json" + :req {:params {:app app + :record id + :assignees "foo" + :revision 11}}} + nil) + (BulkRequest :PUT "/v1/record/status.json" - {:app app - :id id - :action "accept" - :assignee ["foo" "bar"] - :revision 11}) - (r/update-record-status app {:id id - :action "accept" - :assignee ["foo" "bar"] - :revision 11}))) - - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/record/status.json" - :req {:params {:app app - :id id - :action "accept" - :assignee ["foo" "bar"] - :revision 11}}} - nil) - (BulkRequest :PUT "/v1/record/status.json" + {:app app + :id id + :action "accept" + :assignee ["foo" "bar"] + :revision 11}) + (r/update-record-status app {:id id + :action "accept" + :assignee ["foo" "bar"] + :revision 11}))) + + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/record/status.json" + :req {:params {:app app + :id id :action "accept" :assignee ["foo" "bar"] - :revision 11})))) - (done)))) + :revision 11}}} + nil) + (BulkRequest :PUT "/v1/records/status.json" - {:app app - :records [{:id id - :action "accept" - :assignee ["foo" "bar"] - :revision 11} - {:id (inc id) - :action "reject" - :assignee ["baz"]}]}) - (r/update-records-status app [{:id id - :action "accept" - :assignee ["foo" "bar"] - :revision 11} - {:id (inc id) - :action "reject" - :assignee ["baz"] - :revision nil}]))) - - (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records/status.json" - :req {:params {:app app - :records [{:id id - :action "accept" - :assignee ["foo" "bar"] - :revision 11} - {:id (inc id) - :action "reject" - :assignee ["baz"]}]}}} - nil) - (BulkRequest :PUT "/v1/records/status.json" + {:app app + :records [{:id id + :action "accept" + :assignee ["foo" "bar"] + :revision 11} + {:id (inc id) + :action "reject" + :assignee ["baz"]}]}) + (r/update-records-status app [{:id id + :action "accept" + :assignee ["foo" "bar"] + :revision 11} + {:id (inc id) + :action "reject" + :assignee ["baz"] + :revision nil}]))) + + (is (= (t/->KintoneResponse {:url "https://test.kintone.com/k/v1/records/status.json" + :req {:params {:app app + :records [{:id id + :action "accept" + :assignee ["foo" "bar"] + :revision 11} + {:id (inc id) + :action "reject" + :assignee ["baz"]}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/k/v1/file.json" - :req {:params {:fileKey "a file key"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/k/v1/file.json" + :req {:params {:fileKey "a file key"}}} + nil) + (KintoneResponse - {:url "https://test.kintone.com/k/v1/bulkRequest.json" - :req {:params {:requests [{:api "/k/v1/record.json" - :method :POST - :payload {:app app - :record {:name {:value "foo"}}}} - {:api "/k/v1/record.json" - :method :PUT - :payload {:app app - :id id - :record {:name {:value "foo"}}}} - {:api "/k/v1/records.json" - :method :DELETE - :payload {:app app - :ids [1 2 3]}}]}}} - nil) - (KintoneResponse + {:url "https://test.kintone.com/k/v1/bulkRequest.json" + :req {:params {:requests [{:api "/k/v1/record.json" + :method :POST + :payload {:app app + :record {:name {:value "foo"}}}} + {:api "/k/v1/record.json" + :method :PUT + :payload {:app app + :id id + :record {:name {:value "foo"}}}} + {:api "/k/v1/records.json" + :method :DELETE + :payload {:app app + :ids [1 2 3]}}]}}} + nil) + (KintoneResponse {:url url :req req} nil)) diff --git a/test/kintone_client/url_test.cljc b/test/kintone_client/url_test.cljc index d5be1ca..231142b 100644 --- a/test/kintone_client/url_test.cljc +++ b/test/kintone_client/url_test.cljc @@ -20,615 +20,616 @@ ;OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ;SOFTWARE. (ns kintone-client.url-test - (:require #?(:clj [clojure.test :refer :all] - :cljs [cljs.test :refer-macros [deftest testing are run-tests]]) - [kintone-client.url :as sut])) + (:require + #?(:clj [clojure.test :refer :all] + :cljs [cljs.test :refer-macros [deftest testing are run-tests]]) + [kintone-client.url :as sut])) (deftest extract-base-url-test (are [url base-url] (= (sut/extract-base-url url) base-url) - "https://foo.cybozu.com" - "https://foo.cybozu.com" + "https://foo.cybozu.com" + "https://foo.cybozu.com" - "https://foo.cybozu.com/" - "https://foo.cybozu.com" + "https://foo.cybozu.com/" + "https://foo.cybozu.com" - "https://foo.cybozu.com/k" - "https://foo.cybozu.com" + "https://foo.cybozu.com/k" + "https://foo.cybozu.com" - "https://foo.cybozu.com/k/" - "https://foo.cybozu.com" + "https://foo.cybozu.com/k/" + "https://foo.cybozu.com" - "https://foo.cybozu.com/k/1" - "https://foo.cybozu.com" + "https://foo.cybozu.com/k/1" + "https://foo.cybozu.com" - "https://foo.cybozu.com/k/1/" - "https://foo.cybozu.com" + "https://foo.cybozu.com/k/1/" + "https://foo.cybozu.com" - "https://foo.cybozu.com/k/99999999" - "https://foo.cybozu.com" + "https://foo.cybozu.com/k/99999999" + "https://foo.cybozu.com" - "https://foo.cybozu.com/k/abc" - "https://foo.cybozu.com" + "https://foo.cybozu.com/k/abc" + "https://foo.cybozu.com" - "https://foo.s.cybozu.com/k/1" - "https://foo.s.cybozu.com" + "https://foo.s.cybozu.com/k/1" + "https://foo.s.cybozu.com" - "https://foo-bar.cybozu.com/k/1" - "https://foo-bar.cybozu.com" + "https://foo-bar.cybozu.com/k/1" + "https://foo-bar.cybozu.com" - "https://foo-bar-baz.cybozu.com/k/1" - "https://foo-bar-baz.cybozu.com" + "https://foo-bar-baz.cybozu.com/k/1" + "https://foo-bar-baz.cybozu.com" - "https://foo99.cybozu.com/k/1" - "https://foo99.cybozu.com" + "https://foo99.cybozu.com/k/1" + "https://foo99.cybozu.com" - "https://foo99.cybozu.com/k/1/show" - "https://foo99.cybozu.com" + "https://foo99.cybozu.com/k/1/show" + "https://foo99.cybozu.com" - "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" - "https://foo99.cybozu.com" + "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" + "https://foo99.cybozu.com" - "https://foo.cybozu.com/k/guest/11/1" - "https://foo.cybozu.com" + "https://foo.cybozu.com/k/guest/11/1" + "https://foo.cybozu.com" - "https://foo.cybozu-dev.com/k/1" - "https://foo.cybozu-dev.com" + "https://foo.cybozu-dev.com/k/1" + "https://foo.cybozu-dev.com" - "https://foo.kintone.com/k/1" - "https://foo.kintone.com" + "https://foo.kintone.com/k/1" + "https://foo.kintone.com" - "https://foo.kintone-dev.com/k/1" - "https://foo.kintone-dev.com" + "https://foo.kintone-dev.com/k/1" + "https://foo.kintone-dev.com" - "https://foo.cybozu.cn/k/1" - "https://foo.cybozu.cn" + "https://foo.cybozu.cn/k/1" + "https://foo.cybozu.cn" - "https://foo.cybozu-dev.cn/k/1" - "https://foo.cybozu-dev.cn" + "https://foo.cybozu-dev.cn/k/1" + "https://foo.cybozu-dev.cn" - "https://foo_bar.cybozu.com/k/1" - nil + "https://foo_bar.cybozu.com/k/1" + nil - "https://foo.bar.com/baz" - nil)) + "https://foo.bar.com/baz" + nil)) (deftest parse-base-url-test (are [url parsed] (= (sut/parse-base-url url) parsed) - "https://foo.cybozu.com" - {:domain "cybozu.com" - :subdomain "foo"} + "https://foo.cybozu.com" + {:domain "cybozu.com" + :subdomain "foo"} - "https://foo.cybozu.com/" - {:domain "cybozu.com" - :subdomain "foo"} + "https://foo.cybozu.com/" + {:domain "cybozu.com" + :subdomain "foo"} - "https://foo.cybozu.com/k" - {:domain "cybozu.com" - :subdomain "foo"} + "https://foo.cybozu.com/k" + {:domain "cybozu.com" + :subdomain "foo"} - "https://foo.cybozu.com/k/" - {:domain "cybozu.com" - :subdomain "foo"} + "https://foo.cybozu.com/k/" + {:domain "cybozu.com" + :subdomain "foo"} - "https://foo.cybozu.com/k/1" - {:domain "cybozu.com" - :subdomain "foo"} + "https://foo.cybozu.com/k/1" + {:domain "cybozu.com" + :subdomain "foo"} - "https://foo.cybozu.com/k/1/" - {:domain "cybozu.com" - :subdomain "foo"} + "https://foo.cybozu.com/k/1/" + {:domain "cybozu.com" + :subdomain "foo"} - "https://foo.cybozu.com/k/99999999" - {:domain "cybozu.com" - :subdomain "foo"} + "https://foo.cybozu.com/k/99999999" + {:domain "cybozu.com" + :subdomain "foo"} - "https://foo.cybozu.com/k/abc" - {:domain "cybozu.com" - :subdomain "foo"} + "https://foo.cybozu.com/k/abc" + {:domain "cybozu.com" + :subdomain "foo"} - "https://foo.s.cybozu.com/k/1" - {:domain "cybozu.com" - :subdomain "foo"} + "https://foo.s.cybozu.com/k/1" + {:domain "cybozu.com" + :subdomain "foo"} - "https://foo-bar.cybozu.com/k/1" - {:domain "cybozu.com" - :subdomain "foo-bar"} + "https://foo-bar.cybozu.com/k/1" + {:domain "cybozu.com" + :subdomain "foo-bar"} - "https://foo-bar-baz.cybozu.com/k/1" - {:domain "cybozu.com" - :subdomain "foo-bar-baz"} + "https://foo-bar-baz.cybozu.com/k/1" + {:domain "cybozu.com" + :subdomain "foo-bar-baz"} - "https://foo99.cybozu.com/k/1" - {:domain "cybozu.com" - :subdomain "foo99"} + "https://foo99.cybozu.com/k/1" + {:domain "cybozu.com" + :subdomain "foo99"} - "https://foo99.cybozu.com/k/1/show" - {:domain "cybozu.com" - :subdomain "foo99"} + "https://foo99.cybozu.com/k/1/show" + {:domain "cybozu.com" + :subdomain "foo99"} - "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" - {:domain "cybozu.com" - :subdomain "foo99"} + "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" + {:domain "cybozu.com" + :subdomain "foo99"} - "https://foo.cybozu.com/k/guest/11/1" - {:domain "cybozu.com" - :subdomain "foo"} + "https://foo.cybozu.com/k/guest/11/1" + {:domain "cybozu.com" + :subdomain "foo"} - "https://foo.cybozu-dev.com/k/1" - {:domain "cybozu-dev.com" - :subdomain "foo"} + "https://foo.cybozu-dev.com/k/1" + {:domain "cybozu-dev.com" + :subdomain "foo"} - "https://foo.kintone.com/k/1" - {:domain "kintone.com" - :subdomain "foo"} + "https://foo.kintone.com/k/1" + {:domain "kintone.com" + :subdomain "foo"} - "https://foo.kintone-dev.com/k/1" - {:domain "kintone-dev.com" - :subdomain "foo"} + "https://foo.kintone-dev.com/k/1" + {:domain "kintone-dev.com" + :subdomain "foo"} - "https://foo.cybozu.cn/k/1" - {:domain "cybozu.cn" - :subdomain "foo"} + "https://foo.cybozu.cn/k/1" + {:domain "cybozu.cn" + :subdomain "foo"} - "https://foo.cybozu-dev.cn/k/1" - {:domain "cybozu-dev.cn" - :subdomain "foo"} + "https://foo.cybozu-dev.cn/k/1" + {:domain "cybozu-dev.cn" + :subdomain "foo"} - "https://foo_bar.cybozu.com/k/1" - nil + "https://foo_bar.cybozu.com/k/1" + nil - "https://foo.bar.com/baz" - nil)) + "https://foo.bar.com/baz" + nil)) (deftest valid-base-url?-test (are [url res] (= (sut/valid-base-url? url) res) - "https://foo.cybozu.com" - true + "https://foo.cybozu.com" + true - "https://foo.cybozu.com/" - true + "https://foo.cybozu.com/" + true - "https://foo.cybozu.com/k" - true + "https://foo.cybozu.com/k" + true - "https://foo.cybozu.com/k/" - true + "https://foo.cybozu.com/k/" + true - "https://foo.cybozu.com/k/1" - true + "https://foo.cybozu.com/k/1" + true - "https://foo.cybozu.com/k/1/" - true + "https://foo.cybozu.com/k/1/" + true - "https://foo.cybozu.com/k/99999999" - true + "https://foo.cybozu.com/k/99999999" + true - "https://foo.cybozu.com/k/abc" - true + "https://foo.cybozu.com/k/abc" + true - "https://foo.s.cybozu.com/k/1" - true + "https://foo.s.cybozu.com/k/1" + true - "https://foo-bar.cybozu.com/k/1" - true + "https://foo-bar.cybozu.com/k/1" + true - "https://foo-bar-baz.cybozu.com/k/1" - true + "https://foo-bar-baz.cybozu.com/k/1" + true - "https://foo99.cybozu.com/k/1" - true + "https://foo99.cybozu.com/k/1" + true - "https://foo99.cybozu.com/k/1/show" - true + "https://foo99.cybozu.com/k/1/show" + true - "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" - true + "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" + true - "https://foo.cybozu.com/k/guest/11/1" - true + "https://foo.cybozu.com/k/guest/11/1" + true - "https://foo.cybozu-dev.com/k/1" - true + "https://foo.cybozu-dev.com/k/1" + true - "https://foo.kintone.com/k/1" - true + "https://foo.kintone.com/k/1" + true - "https://foo.kintone-dev.com/k/1" - true + "https://foo.kintone-dev.com/k/1" + true - "https://foo.cybozu.cn/k/1" - true + "https://foo.cybozu.cn/k/1" + true - "https://foo.cybozu-dev.cn/k/1" - true + "https://foo.cybozu-dev.cn/k/1" + true - "https://foo_bar.cybozu.com/k/1" - false + "https://foo_bar.cybozu.com/k/1" + false - "https://foo.bar.com/baz" - false)) + "https://foo.bar.com/baz" + false)) (deftest extract-app-url-test (testing "default space app" (are [url app-url] (= (sut/extract-app-url url) app-url) - "https://foo.cybozu.com" - nil + "https://foo.cybozu.com" + nil - "https://foo.cybozu.com/" - nil + "https://foo.cybozu.com/" + nil - "https://foo.cybozu.com/k" - nil + "https://foo.cybozu.com/k" + nil - "https://foo.cybozu.com/k/" - nil + "https://foo.cybozu.com/k/" + nil - "https://foo.cybozu.com/k/1" - "https://foo.cybozu.com/k/1" + "https://foo.cybozu.com/k/1" + "https://foo.cybozu.com/k/1" - "https://foo.cybozu.com/k/1/" - "https://foo.cybozu.com/k/1" + "https://foo.cybozu.com/k/1/" + "https://foo.cybozu.com/k/1" - "https://foo.cybozu.com/k/99999999" - "https://foo.cybozu.com/k/99999999" + "https://foo.cybozu.com/k/99999999" + "https://foo.cybozu.com/k/99999999" - "https://foo.cybozu.com/k/abc" - nil + "https://foo.cybozu.com/k/abc" + nil - "https://foo.s.cybozu.com/k/1" - "https://foo.s.cybozu.com/k/1" + "https://foo.s.cybozu.com/k/1" + "https://foo.s.cybozu.com/k/1" - "https://foo-bar.cybozu.com/k/1" - "https://foo-bar.cybozu.com/k/1" + "https://foo-bar.cybozu.com/k/1" + "https://foo-bar.cybozu.com/k/1" - "https://foo-bar-baz.cybozu.com/k/1" - "https://foo-bar-baz.cybozu.com/k/1" + "https://foo-bar-baz.cybozu.com/k/1" + "https://foo-bar-baz.cybozu.com/k/1" - "https://foo99.cybozu.com/k/1" - "https://foo99.cybozu.com/k/1" + "https://foo99.cybozu.com/k/1" + "https://foo99.cybozu.com/k/1" - "https://foo99.cybozu.com/k/1/show" - "https://foo99.cybozu.com/k/1" + "https://foo99.cybozu.com/k/1/show" + "https://foo99.cybozu.com/k/1" - "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" - "https://foo99.cybozu.com/k/1" + "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" + "https://foo99.cybozu.com/k/1" - "https://foo.cybozu-dev.com/k/1" - "https://foo.cybozu-dev.com/k/1" + "https://foo.cybozu-dev.com/k/1" + "https://foo.cybozu-dev.com/k/1" - "https://foo.kintone.com/k/1" - "https://foo.kintone.com/k/1" + "https://foo.kintone.com/k/1" + "https://foo.kintone.com/k/1" - "https://foo.kintone-dev.com/k/1" - "https://foo.kintone-dev.com/k/1" + "https://foo.kintone-dev.com/k/1" + "https://foo.kintone-dev.com/k/1" - "https://foo.cybozu.cn/k/1" - "https://foo.cybozu.cn/k/1" + "https://foo.cybozu.cn/k/1" + "https://foo.cybozu.cn/k/1" - "https://foo.cybozu-dev.cn/k/1" - "https://foo.cybozu-dev.cn/k/1" + "https://foo.cybozu-dev.cn/k/1" + "https://foo.cybozu-dev.cn/k/1" - "https://foo_bar.cybozu.com/k/1" - nil + "https://foo_bar.cybozu.com/k/1" + nil - "https://foo.bar.com/baz" - nil)) + "https://foo.bar.com/baz" + nil)) (testing "guest space app" (are [url app-url] (= (sut/extract-app-url url) app-url) - "https://foo.cybozu.com/k/guest/11/1" - "https://foo.cybozu.com/k/guest/11/1" + "https://foo.cybozu.com/k/guest/11/1" + "https://foo.cybozu.com/k/guest/11/1" - "https://foo.cybozu.com/k/guest/11/1/" - "https://foo.cybozu.com/k/guest/11/1" + "https://foo.cybozu.com/k/guest/11/1/" + "https://foo.cybozu.com/k/guest/11/1" - "https://foo.cybozu.com/k/guest/11/99999999" - "https://foo.cybozu.com/k/guest/11/99999999" + "https://foo.cybozu.com/k/guest/11/99999999" + "https://foo.cybozu.com/k/guest/11/99999999" - "https://foo.s.cybozu.com/k/guest/11/1" - "https://foo.s.cybozu.com/k/guest/11/1" + "https://foo.s.cybozu.com/k/guest/11/1" + "https://foo.s.cybozu.com/k/guest/11/1" - "https://foo-bar.cybozu.com/k/guest/11/1" - "https://foo-bar.cybozu.com/k/guest/11/1" + "https://foo-bar.cybozu.com/k/guest/11/1" + "https://foo-bar.cybozu.com/k/guest/11/1" - "https://foo-bar-baz.cybozu.com/k/guest/11/1" - "https://foo-bar-baz.cybozu.com/k/guest/11/1" + "https://foo-bar-baz.cybozu.com/k/guest/11/1" + "https://foo-bar-baz.cybozu.com/k/guest/11/1" - "https://foo99.cybozu.com/k/guest/11/1" - "https://foo99.cybozu.com/k/guest/11/1" + "https://foo99.cybozu.com/k/guest/11/1" + "https://foo99.cybozu.com/k/guest/11/1" - "https://foo99.cybozu.com/k/guest/11/1/show" - "https://foo99.cybozu.com/k/guest/11/1" + "https://foo99.cybozu.com/k/guest/11/1/show" + "https://foo99.cybozu.com/k/guest/11/1" - "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" - "https://foo99.cybozu.com/k/1" + "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" + "https://foo99.cybozu.com/k/1" - "https://foo99.cybozu.com/k/guest/11/1/?q=foo%20%3D%20\"1\"" - "https://foo99.cybozu.com/k/guest/11/1" + "https://foo99.cybozu.com/k/guest/11/1/?q=foo%20%3D%20\"1\"" + "https://foo99.cybozu.com/k/guest/11/1" - "https://foo.cybozu-dev.com/k/guest/11/1" - "https://foo.cybozu-dev.com/k/guest/11/1" + "https://foo.cybozu-dev.com/k/guest/11/1" + "https://foo.cybozu-dev.com/k/guest/11/1" - "https://foo.kintone.com/k/guest/11/1" - "https://foo.kintone.com/k/guest/11/1" + "https://foo.kintone.com/k/guest/11/1" + "https://foo.kintone.com/k/guest/11/1" - "https://foo.kintone-dev.com/k/guest/11/1" - "https://foo.kintone-dev.com/k/guest/11/1" + "https://foo.kintone-dev.com/k/guest/11/1" + "https://foo.kintone-dev.com/k/guest/11/1" - "https://foo.cybozu.cn/k/guest/11/1" - "https://foo.cybozu.cn/k/guest/11/1" + "https://foo.cybozu.cn/k/guest/11/1" + "https://foo.cybozu.cn/k/guest/11/1" - "https://foo.cybozu-dev.cn/k/guest/11/1" - "https://foo.cybozu-dev.cn/k/guest/11/1" + "https://foo.cybozu-dev.cn/k/guest/11/1" + "https://foo.cybozu-dev.cn/k/guest/11/1" - "https://foo_bar.cybozu.com/k/guest/11/1" - nil + "https://foo_bar.cybozu.com/k/guest/11/1" + nil - "https://foo.bar.com/k/guest/11/1" - nil + "https://foo.bar.com/k/guest/11/1" + nil - "https://foo.cybozu.com/k/guest" - nil + "https://foo.cybozu.com/k/guest" + nil - "https://foo.cybozu.com/k/guest/" - nil + "https://foo.cybozu.com/k/guest/" + nil - "https://foo.cybozu.com/k/guest/11" - nil + "https://foo.cybozu.com/k/guest/11" + nil - "https://foo.cybozu.com/k/guest/11/" - nil))) + "https://foo.cybozu.com/k/guest/11/" + nil))) (deftest parse-app-url-test (testing "default space app" (are [url parsed] (= (sut/parse-app-url url) parsed) - "https://foo.cybozu.com" - nil + "https://foo.cybozu.com" + nil - "https://foo.cybozu.com/" - nil + "https://foo.cybozu.com/" + nil - "https://foo.cybozu.com/k" - nil + "https://foo.cybozu.com/k" + nil - "https://foo.cybozu.com/k/" - nil + "https://foo.cybozu.com/k/" + nil - "https://foo.cybozu.com/k/1" - {:subdomain "foo" :domain "cybozu.com" :app-id "1"} + "https://foo.cybozu.com/k/1" + {:subdomain "foo" :domain "cybozu.com" :app-id "1"} - "https://foo.cybozu.com/k/1/" - {:subdomain "foo" :domain "cybozu.com" :app-id "1"} + "https://foo.cybozu.com/k/1/" + {:subdomain "foo" :domain "cybozu.com" :app-id "1"} - "https://foo.cybozu.com/k/99999999" - {:subdomain "foo" :domain "cybozu.com" :app-id "99999999"} + "https://foo.cybozu.com/k/99999999" + {:subdomain "foo" :domain "cybozu.com" :app-id "99999999"} - "https://foo.cybozu.com/k/abc" - nil + "https://foo.cybozu.com/k/abc" + nil - "https://foo.s.cybozu.com/k/1" - {:subdomain "foo" :domain "cybozu.com" :app-id "1"} + "https://foo.s.cybozu.com/k/1" + {:subdomain "foo" :domain "cybozu.com" :app-id "1"} - "https://foo-bar.cybozu.com/k/1" - {:subdomain "foo-bar" :domain "cybozu.com" :app-id "1"} + "https://foo-bar.cybozu.com/k/1" + {:subdomain "foo-bar" :domain "cybozu.com" :app-id "1"} - "https://foo-bar-baz.cybozu.com/k/1" - {:subdomain "foo-bar-baz" :domain "cybozu.com" :app-id "1"} + "https://foo-bar-baz.cybozu.com/k/1" + {:subdomain "foo-bar-baz" :domain "cybozu.com" :app-id "1"} - "https://foo99.cybozu.com/k/1" - {:subdomain "foo99" :domain "cybozu.com" :app-id "1"} + "https://foo99.cybozu.com/k/1" + {:subdomain "foo99" :domain "cybozu.com" :app-id "1"} - "https://foo99.cybozu.com/k/1/show" - {:subdomain "foo99" :domain "cybozu.com" :app-id "1"} + "https://foo99.cybozu.com/k/1/show" + {:subdomain "foo99" :domain "cybozu.com" :app-id "1"} - "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" - {:subdomain "foo99" :domain "cybozu.com" :app-id "1"} + "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" + {:subdomain "foo99" :domain "cybozu.com" :app-id "1"} - "https://foo.cybozu-dev.com/k/1" - {:subdomain "foo" :domain "cybozu-dev.com" :app-id "1"} + "https://foo.cybozu-dev.com/k/1" + {:subdomain "foo" :domain "cybozu-dev.com" :app-id "1"} - "https://foo.kintone.com/k/1" - {:subdomain "foo" :domain "kintone.com" :app-id "1"} + "https://foo.kintone.com/k/1" + {:subdomain "foo" :domain "kintone.com" :app-id "1"} - "https://foo.kintone-dev.com/k/1" - {:subdomain "foo" :domain "kintone-dev.com" :app-id "1"} + "https://foo.kintone-dev.com/k/1" + {:subdomain "foo" :domain "kintone-dev.com" :app-id "1"} - "https://foo.cybozu.cn/k/1" - {:subdomain "foo" :domain "cybozu.cn" :app-id "1"} + "https://foo.cybozu.cn/k/1" + {:subdomain "foo" :domain "cybozu.cn" :app-id "1"} - "https://foo.cybozu-dev.cn/k/1" - {:subdomain "foo" :domain "cybozu-dev.cn" :app-id "1"} + "https://foo.cybozu-dev.cn/k/1" + {:subdomain "foo" :domain "cybozu-dev.cn" :app-id "1"} - "https://foo_bar.cybozu.com/k/1" - nil + "https://foo_bar.cybozu.com/k/1" + nil - "https://foo.bar.com/baz" - nil)) + "https://foo.bar.com/baz" + nil)) (testing "guest space app" (are [url parsed] (= (sut/parse-app-url url) parsed) - "https://foo.cybozu.com/k/guest/11/1" - {:subdomain "foo" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} + "https://foo.cybozu.com/k/guest/11/1" + {:subdomain "foo" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} - "https://foo.cybozu.com/k/guest/11/1/" - {:subdomain "foo" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} + "https://foo.cybozu.com/k/guest/11/1/" + {:subdomain "foo" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} - "https://foo.cybozu.com/k/guest/11/99999999" - {:subdomain "foo" :domain "cybozu.com" :guest-space-id "11" :app-id "99999999"} + "https://foo.cybozu.com/k/guest/11/99999999" + {:subdomain "foo" :domain "cybozu.com" :guest-space-id "11" :app-id "99999999"} - "https://foo.s.cybozu.com/k/guest/11/1" - {:subdomain "foo" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} + "https://foo.s.cybozu.com/k/guest/11/1" + {:subdomain "foo" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} - "https://foo-bar.cybozu.com/k/guest/11/1" - {:subdomain "foo-bar" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} + "https://foo-bar.cybozu.com/k/guest/11/1" + {:subdomain "foo-bar" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} - "https://foo-bar-baz.cybozu.com/k/guest/11/1" - {:subdomain "foo-bar-baz" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} + "https://foo-bar-baz.cybozu.com/k/guest/11/1" + {:subdomain "foo-bar-baz" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} - "https://foo99.cybozu.com/k/guest/11/1" - {:subdomain "foo99" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} + "https://foo99.cybozu.com/k/guest/11/1" + {:subdomain "foo99" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} - "https://foo99.cybozu.com/k/guest/11/1/show" - {:subdomain "foo99" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} + "https://foo99.cybozu.com/k/guest/11/1/show" + {:subdomain "foo99" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} - "https://foo99.cybozu.com/k/guest/11/1/?q=foo%20%3D%20\"1\"" - {:subdomain "foo99" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} + "https://foo99.cybozu.com/k/guest/11/1/?q=foo%20%3D%20\"1\"" + {:subdomain "foo99" :domain "cybozu.com" :guest-space-id "11" :app-id "1"} - "https://foo.cybozu-dev.com/k/guest/11/1" - {:subdomain "foo" :domain "cybozu-dev.com" :guest-space-id "11" :app-id "1"} + "https://foo.cybozu-dev.com/k/guest/11/1" + {:subdomain "foo" :domain "cybozu-dev.com" :guest-space-id "11" :app-id "1"} - "https://foo.kintone.com/k/guest/11/1" - {:subdomain "foo" :domain "kintone.com" :guest-space-id "11" :app-id "1"} + "https://foo.kintone.com/k/guest/11/1" + {:subdomain "foo" :domain "kintone.com" :guest-space-id "11" :app-id "1"} - "https://foo.kintone-dev.com/k/guest/11/1" - {:subdomain "foo" :domain "kintone-dev.com" :guest-space-id "11" :app-id "1"} + "https://foo.kintone-dev.com/k/guest/11/1" + {:subdomain "foo" :domain "kintone-dev.com" :guest-space-id "11" :app-id "1"} - "https://foo.cybozu.cn/k/guest/11/1" - {:subdomain "foo" :domain "cybozu.cn" :guest-space-id "11" :app-id "1"} + "https://foo.cybozu.cn/k/guest/11/1" + {:subdomain "foo" :domain "cybozu.cn" :guest-space-id "11" :app-id "1"} - "https://foo.cybozu-dev.cn/k/guest/11/1" - {:subdomain "foo" :domain "cybozu-dev.cn" :guest-space-id "11" :app-id "1"} + "https://foo.cybozu-dev.cn/k/guest/11/1" + {:subdomain "foo" :domain "cybozu-dev.cn" :guest-space-id "11" :app-id "1"} - "https://foo_bar.cybozu.com/k/guest/11/1" - nil + "https://foo_bar.cybozu.com/k/guest/11/1" + nil - "https://foo.bar.com/k/guest/11/1" - nil))) + "https://foo.bar.com/k/guest/11/1" + nil))) (deftest valid-app-url?-test (testing "default space app" (are [url res] (= (sut/valid-app-url? url) res) - "https://foo.cybozu.com" - false + "https://foo.cybozu.com" + false - "https://foo.cybozu.com/" - false + "https://foo.cybozu.com/" + false - "https://foo.cybozu.com/k" - false + "https://foo.cybozu.com/k" + false - "https://foo.cybozu.com/k/" - false + "https://foo.cybozu.com/k/" + false - "https://foo.cybozu.com/k/1" - true + "https://foo.cybozu.com/k/1" + true - "https://foo.cybozu.com/k/99999999" - true + "https://foo.cybozu.com/k/99999999" + true - "https://foo.cybozu.com/k/abc" - false + "https://foo.cybozu.com/k/abc" + false - "https://foo.s.cybozu.com/k/1" - true + "https://foo.s.cybozu.com/k/1" + true - "https://foo-bar.cybozu.com/k/1" - true + "https://foo-bar.cybozu.com/k/1" + true - "https://foo-bar-baz.cybozu.com/k/1" - true + "https://foo-bar-baz.cybozu.com/k/1" + true - "https://foo99.cybozu.com/k/1" - true + "https://foo99.cybozu.com/k/1" + true - "https://foo99.cybozu.com/k/1/show" - true + "https://foo99.cybozu.com/k/1/show" + true - "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" - true + "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" + true - "https://foo.cybozu-dev.com/k/1" - true + "https://foo.cybozu-dev.com/k/1" + true - "https://foo.kintone.com/k/1" - true + "https://foo.kintone.com/k/1" + true - "https://foo.kintone-dev.com/k/1" - true + "https://foo.kintone-dev.com/k/1" + true - "https://foo.cybozu.cn/k/1" - true + "https://foo.cybozu.cn/k/1" + true - "https://foo.cybozu-dev.cn/k/1" - true + "https://foo.cybozu-dev.cn/k/1" + true - "https://foo_bar.cybozu.com/k/1" - false + "https://foo_bar.cybozu.com/k/1" + false - "https://foo.bar.com/baz" - false)) + "https://foo.bar.com/baz" + false)) (testing "guest space app" (are [url res] (= (sut/valid-app-url? url) res) - "https://foo.cybozu.com/k/guest/11/1" - true + "https://foo.cybozu.com/k/guest/11/1" + true - "https://foo.cybozu.com/k/guest/11/1" - true + "https://foo.cybozu.com/k/guest/11/1" + true - "https://foo.cybozu.com/k/guest/11/99999999" - true + "https://foo.cybozu.com/k/guest/11/99999999" + true - "https://foo.s.cybozu.com/k/guest/11/1" - true + "https://foo.s.cybozu.com/k/guest/11/1" + true - "https://foo-bar.cybozu.com/k/guest/11/1" - true + "https://foo-bar.cybozu.com/k/guest/11/1" + true - "https://foo-bar-baz.cybozu.com/k/guest/11/1" - true + "https://foo-bar-baz.cybozu.com/k/guest/11/1" + true - "https://foo99.cybozu.com/k/guest/11/1" - true + "https://foo99.cybozu.com/k/guest/11/1" + true - "https://foo99.cybozu.com/k/guest/11/1/show" - true + "https://foo99.cybozu.com/k/guest/11/1/show" + true - "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" - true + "https://foo99.cybozu.com/k/1/?q=foo%20%3D%20\"1\"" + true - "https://foo99.cybozu.com/k/guest/11/1/?q=foo%20%3D%20\"1\"" - true + "https://foo99.cybozu.com/k/guest/11/1/?q=foo%20%3D%20\"1\"" + true - "https://foo.cybozu-dev.com/k/guest/11/1" - true + "https://foo.cybozu-dev.com/k/guest/11/1" + true - "https://foo.kintone.com/k/guest/11/1" - true + "https://foo.kintone.com/k/guest/11/1" + true - "https://foo.kintone-dev.com/k/guest/11/1" - true + "https://foo.kintone-dev.com/k/guest/11/1" + true - "https://foo.cybozu.cn/k/guest/11/1" - true + "https://foo.cybozu.cn/k/guest/11/1" + true - "https://foo.cybozu-dev.cn/k/guest/11/1" - true + "https://foo.cybozu-dev.cn/k/guest/11/1" + true - "https://foo_bar.cybozu.com/k/guest/11/1" - false + "https://foo_bar.cybozu.com/k/guest/11/1" + false - "https://foo.bar.com/k/guest/11/1" - false + "https://foo.bar.com/k/guest/11/1" + false - "https://foo.cybozu.com/k/guest" - false + "https://foo.cybozu.com/k/guest" + false - "https://foo.cybozu.com/k/guest/" - false + "https://foo.cybozu.com/k/guest/" + false - "https://foo.cybozu.com/k/guest/11" - false + "https://foo.cybozu.com/k/guest/11" + false - "https://foo.cybozu.com/k/guest/11/" - false))) + "https://foo.cybozu.com/k/guest/11/" + false))) diff --git a/test/kintone_client/user_test.clj b/test/kintone_client/user_test.clj index 4bccf34..d382beb 100644 --- a/test/kintone_client/user_test.clj +++ b/test/kintone_client/user_test.clj @@ -1,9 +1,10 @@ (ns kintone-client.user-test - (:require [clojure.core.async :refer [KintoneResponse {:url "https://test.kintone.com/v1/users.json" @@ -585,7 +586,7 @@ (if (< @ncall 3) (put! c (t/->KintoneResponse {:userTitles (map #(assoc {} :id (+ (* 100 @ncall) %)) - (range 100))} + (range 100))} nil)) (put! c (t/->KintoneResponse {:userTitles [{:id 1000} {:id 1500}]} nil))) diff --git a/test/kintone_client/user_test.cljs b/test/kintone_client/user_test.cljs index f5c0d5b..c7f2c8c 100644 --- a/test/kintone_client/user_test.cljs +++ b/test/kintone_client/user_test.cljs @@ -1,754 +1,755 @@ (ns kintone-client.user-test - (:require [cljs.test :refer-macros [deftest is testing async]] - [cljs.core.async :refer [KintoneResponse {:url "https://test.kintone.com/v1/users.json" - :req {:params {}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/users.json" - :req {:params {:ids [1 2 3] - :offset 2 - :size 10}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/users.json" - :req {:params {:codes ["a" "b"] - :offset 2 - :size 10}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/users.json" + :req {:params {}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/users.json" + :req {:params {:ids [1 2 3] + :offset 2 + :size 10}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/users.json" + :req {:params {:codes ["a" "b"] + :offset 2 + :size 10}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/users.json" - :req {:params {:users [{:code "user1" - :name "first" - :password "PASSWORD"} - {:code "user2" - :name "second" - :password "SECRET" - :valid false - :description ""}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/users.json" + :req {:params {:users [{:code "user1" + :name "first" + :password "PASSWORD"} + {:code "user2" + :name "second" + :password "SECRET" + :valid false + :description ""}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/users.json" - :req {:params {:users [{:code "user1" - :password "PASSWORD"} - {:code "user2" - :name "second" - :valid false - :description ""}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/users.json" + :req {:params {:users [{:code "user1" + :password "PASSWORD"} + {:code "user2" + :name "second" + :valid false + :description ""}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/users.json" - :req {:params {:codes ["user1" "code"]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/users.json" + :req {:params {:codes ["user1" "code"]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/users/codes.json" - :req {:params {:codes [{:currentCode "old" - :newCode "new"} - {:currentCode "code1" - :newCode "code2"}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/users/codes.json" + :req {:params {:codes [{:currentCode "old" + :newCode "new"} + {:currentCode "code1" + :newCode "code2"}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/organizations.json" - :req {:params {}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/organizations.json" - :req {:params {:ids [1 10 20] - :offset 2 - :size 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/organizations.json" - :req {:params {:codes ["code1" "foo"] - :offset 2 - :size 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/organizations.json" + :req {:params {}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/organizations.json" + :req {:params {:ids [1 10 20] + :offset 2 + :size 5}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/organizations.json" + :req {:params {:codes ["code1" "foo"] + :offset 2 + :size 5}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/organizations.json" - :req {:params {:organizations [{:code "org1" - :name "ORG-A"} - {:code "new" - :name "new-organization" - :parentCode "org1" - :description ""} - {:code "ABC" - :name "abc"}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/organizations.json" + :req {:params {:organizations [{:code "org1" + :name "ORG-A"} + {:code "new" + :name "new-organization" + :parentCode "org1" + :description ""} + {:code "ABC" + :name "abc"}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/organizations.json" - :req {:params {:organizations [{:code "org1" - :name "ORG-A"} - {:code "new" - :name "new-organization" - :parentCode "org1" - :description ""} - {:code "ABC" - :description "abc"}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/organizations.json" + :req {:params {:organizations [{:code "org1" + :name "ORG-A"} + {:code "new" + :name "new-organization" + :parentCode "org1" + :description ""} + {:code "ABC" + :description "abc"}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/organizations.json" - :req {:params {:codes ["code1" "code2"]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/organizations.json" + :req {:params {:codes ["code1" "code2"]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/organizations/codes.json" - :req {:params {:codes [{:currentCode "old" - :newCode "new"} - {:currentCode "code1" - :newCode "code2"}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/organizations/codes.json" + :req {:params {:codes [{:currentCode "old" + :newCode "new"} + {:currentCode "code1" + :newCode "code2"}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/users/services.json" - :req {:params {:users [{:code "user1" - :services ["kintone" - "garoon" - "office" - "mailwise" - "secure_access"]} - {:code "user2" - :services []} - {:code "user3" - :services ["kintone"]}]}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/users/services.json" + :req {:params {:users [{:code "user1" + :services ["kintone" + "garoon" + "office" + "mailwise" + "secure_access"]} + {:code "user2" + :services []} + {:code "user3" + :services ["kintone"]}]}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/groups.json" - :req {:params {}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/groups.json" - :req {:params {:ids [1 2 3] - :offset 2 - :size 10}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/groups.json" - :req {:params {:codes ["a" "b"] - :offset 2 - :size 10}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/groups.json" + :req {:params {}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/groups.json" + :req {:params {:ids [1 2 3] + :offset 2 + :size 10}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/groups.json" + :req {:params {:codes ["a" "b"] + :offset 2 + :size 10}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/user/organizations.json" - :req {:params {:code "user1"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/user/organizations.json" + :req {:params {:code "user1"}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/user/groups.json" - :req {:params {:code "user1"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/user/groups.json" + :req {:params {:code "user1"}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/organization/users.json" - :req {:params {:code "org1"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/organization/users.json" - :req {:params {:code "org1" - :offset 10 - :size 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/organization/users.json" + :req {:params {:code "org1"}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/organization/users.json" + :req {:params {:code "org1" + :offset 10 + :size 5}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/group/users.json" - :req {:params {:code "group1"}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/group/users.json" - :req {:params {:code "group1" - :offset 10 - :size 5}}} - nil) - (KintoneResponse {:url "https://test.kintone.com/v1/group/users.json" + :req {:params {:code "group1"}}} + nil) + (KintoneResponse {:url "https://test.kintone.com/v1/group/users.json" + :req {:params {:code "group1" + :offset 10 + :size 5}}} + nil) + (KintoneResponse {:users [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:users [{:id 1} {:id 2}]} nil) - (KintoneResponse {:users [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:users [{:id 1} {:id 2}]} nil) + (KintoneResponse {:users [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} - nil)) - 3 (put! c (t/->KintoneResponse {:users [{:id 4}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:users [{:id 1} - {:id 2} - {:id 3}]} nil) - (KintoneResponse {:users [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} + nil)) + 3 (put! c (t/->KintoneResponse {:users [{:id 4}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:users [{:id 1} + {:id 2} + {:id 3}]} nil) + (KintoneResponse {:users [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:users [{:id 1} {:id 2}]} nil) - (KintoneResponse {:users [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:users [{:id 1} {:id 2}]} nil) + (KintoneResponse {:users [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} - nil)) - 3 (put! c (t/->KintoneResponse {:users [{:id 4}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:users [{:id 1} - {:id 2} - {:id 3}]} nil) - (KintoneResponse {:users [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} + nil)) + 3 (put! c (t/->KintoneResponse {:users [{:id 4}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:users [{:id 1} + {:id 2} + {:id 3}]} nil) + (KintoneResponse - {:users (map #(assoc {} :id %) (range 100))} - nil)) - 2 (put! c (t/->KintoneResponse {:users []} - nil))) - c))] - (is (= 100 - (-> (KintoneResponse + {:users (map #(assoc {} :id %) (range 100))} + nil)) + 2 (put! c (t/->KintoneResponse {:users []} + nil))) + c))] + (is (= 100 + (-> (KintoneResponse - {:users (map #(assoc {} :id (+ (* 100 @ncall) %)) - (range 100))} - nil)) - (put! c (t/->KintoneResponse {:users [{:id 1000} {:id 1500}]} - nil))) - c))] - (is (= 202 - (-> (KintoneResponse + {:users (map #(assoc {} :id (+ (* 100 @ncall) %)) + (range 100))} + nil)) + (put! c (t/->KintoneResponse {:users [{:id 1000} {:id 1500}]} + nil))) + c))] + (is (= 202 + (-> (KintoneResponse {:organizations [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:organizations [{:id 1} {:id 2}]} nil) - (KintoneResponse {:organizations [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:organizations [{:id 1} {:id 2}]} nil) + (KintoneResponse {:organizations [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} - nil)) - 3 (put! c (t/->KintoneResponse {:organizations [{:id 4}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:organizations [{:id 1} - {:id 2} - {:id 3}]} nil) - (KintoneResponse {:organizations [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} + nil)) + 3 (put! c (t/->KintoneResponse {:organizations [{:id 4}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:organizations [{:id 1} + {:id 2} + {:id 3}]} nil) + (KintoneResponse {:organizations [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:organizations [{:id 1} {:id 2}]} nil) - (KintoneResponse {:organizations [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:organizations [{:id 1} {:id 2}]} nil) + (KintoneResponse {:organizations [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} - nil)) - 3 (put! c (t/->KintoneResponse {:organizations [{:id 4}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:organizations [{:id 1} - {:id 2} - {:id 3}]} nil) - (KintoneResponse {:organizations [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} + nil)) + 3 (put! c (t/->KintoneResponse {:organizations [{:id 4}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:organizations [{:id 1} + {:id 2} + {:id 3}]} nil) + (KintoneResponse - {:organizations (map #(assoc {} :id %) (range 100))} - nil)) - 2 (put! c (t/->KintoneResponse {:organizations []} - nil))) - c))] - (is (= 100 - (-> (KintoneResponse + {:organizations (map #(assoc {} :id %) (range 100))} + nil)) + 2 (put! c (t/->KintoneResponse {:organizations []} + nil))) + c))] + (is (= 100 + (-> (KintoneResponse - {:organizations (map #(assoc {} :id (+ (* 100 @ncall) %)) - (range 100))} - nil)) - (put! c (t/->KintoneResponse {:organizations [{:id 1000} {:id 1500}]} - nil))) - c))] - (is (= 202 - (-> (KintoneResponse + {:organizations (map #(assoc {} :id (+ (* 100 @ncall) %)) + (range 100))} + nil)) + (put! c (t/->KintoneResponse {:organizations [{:id 1000} {:id 1500}]} + nil))) + c))] + (is (= 202 + (-> (KintoneResponse {:groups [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:groups [{:id 1} {:id 2}]} nil) - (KintoneResponse {:groups [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:groups [{:id 1} {:id 2}]} nil) + (KintoneResponse {:groups [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} - nil)) - 3 (put! c (t/->KintoneResponse {:groups [{:id 4}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:groups [{:id 1} - {:id 2} - {:id 3}]} nil) - (KintoneResponse {:groups [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} + nil)) + 3 (put! c (t/->KintoneResponse {:groups [{:id 4}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:groups [{:id 1} + {:id 2} + {:id 3}]} nil) + (KintoneResponse {:groups [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:groups [{:id 1} {:id 2}]} nil) - (KintoneResponse {:groups [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:groups [{:id 1} {:id 2}]} nil) + (KintoneResponse {:groups [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} - nil)) - 3 (put! c (t/->KintoneResponse {:groups [{:id 4}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:groups [{:id 1} - {:id 2} - {:id 3}]} nil) - (KintoneResponse {:groups [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} + nil)) + 3 (put! c (t/->KintoneResponse {:groups [{:id 4}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:groups [{:id 1} + {:id 2} + {:id 3}]} nil) + (KintoneResponse - {:groups (map #(assoc {} :id %) (range 100))} - nil)) - 2 (put! c (t/->KintoneResponse {:groups []} - nil))) - c))] - (is (= 100 - (-> (KintoneResponse + {:groups (map #(assoc {} :id %) (range 100))} + nil)) + 2 (put! c (t/->KintoneResponse {:groups []} + nil))) + c))] + (is (= 100 + (-> (KintoneResponse - {:groups (map #(assoc {} :id (+ (* 100 @ncall) %)) - (range 100))} - nil)) - (put! c (t/->KintoneResponse {:groups [{:id 1000} {:id 1500}]} - nil))) - c))] - (is (= 202 - (-> (KintoneResponse + {:groups (map #(assoc {} :id (+ (* 100 @ncall) %)) + (range 100))} + nil)) + (put! c (t/->KintoneResponse {:groups [{:id 1000} {:id 1500}]} + nil))) + c))] + (is (= 202 + (-> (KintoneResponse - {:userTitles (map #(assoc {} :id %) (range 100))} - nil)) - 2 (put! c (t/->KintoneResponse {:userTitles []} - nil))) - c))] - (is (= 100 - (-> (KintoneResponse + {:userTitles (map #(assoc {} :id %) (range 100))} + nil)) + 2 (put! c (t/->KintoneResponse {:userTitles []} + nil))) + c))] + (is (= 100 + (-> (KintoneResponse - {:userTitles (map #(assoc {} :id (+ (* 100 @ncall) %)) - (range 100))} - nil)) - (put! c (t/->KintoneResponse {:userTitles [{:id 1000} {:id 1500}]} - nil))) - c))] - (is (= 202 - (-> (KintoneResponse + {:userTitles (map #(assoc {} :id (+ (* 100 @ncall) %)) + (range 100))} + nil)) + (put! c (t/->KintoneResponse {:userTitles [{:id 1000} {:id 1500}]} + nil))) + c))] + (is (= 202 + (-> (KintoneResponse - {:users (map #(assoc {} :id %) (range 100))} - nil)) - 2 (put! c (t/->KintoneResponse {:users []} - nil))) - c))] - (is (= 100 - (-> (KintoneResponse + {:users (map #(assoc {} :id %) (range 100))} + nil)) + 2 (put! c (t/->KintoneResponse {:users []} + nil))) + c))] + (is (= 100 + (-> (KintoneResponse - {:users (map #(assoc {} :id (+ (* 100 @ncall) %)) - (range 100))} - nil)) - (put! c (t/->KintoneResponse {:users [{:id 1000} {:id 1500}]} - nil))) - c))] - (is (= 202 - (-> (KintoneResponse + {:users (map #(assoc {} :id (+ (* 100 @ncall) %)) + (range 100))} + nil)) + (put! c (t/->KintoneResponse {:users [{:id 1000} {:id 1500}]} + nil))) + c))] + (is (= 202 + (-> ( Date: Mon, 1 Apr 2024 15:26:13 +0900 Subject: [PATCH 6/9] refactor: Update to fix clj-kondo warnings --- src/kintone_client/connection.cljc | 18 +- src/kintone_client/record.cljc | 22 +- src/kintone_client/user.cljc | 4 +- test/kintone_client/app_test.clj | 2 +- test/kintone_client/app_test.cljs | 1 - test/kintone_client/authentication_test.cljc | 2 +- test/kintone_client/connection_test.cljc | 146 ++-- test/kintone_client/record_test.clj | 42 +- test/kintone_client/record_test.cljs | 40 +- test/kintone_client/test_helper.cljc | 4 +- test/kintone_client/url_test.cljc | 4 +- test/kintone_client/user_test.clj | 46 +- test/kintone_client/user_test.cljs | 754 ++++++++++--------- 13 files changed, 546 insertions(+), 539 deletions(-) diff --git a/src/kintone_client/connection.cljc b/src/kintone_client/connection.cljc index 43a26ac..a4c4553 100644 --- a/src/kintone_client/connection.cljc +++ b/src/kintone_client/connection.cljc @@ -186,16 +186,16 @@ (assoc :multipart (:multipart req))) :cljs (-> (build-req this req c) (dissoc :format) - (assoc :body (:multipart req)))) - handler (->handler handler c) - error-handler (->error-handler error-handler c)] + (assoc :body (:multipart req))))] #?(:clj (thread - (try - (handler (client/post url req)) - (catch ExceptionInfo e - (error-handler e)) - (catch Exception e - (error-handler e)))) + (let [handler (->handler handler c) + error-handler (->error-handler error-handler c)] + (try + (handler (client/post url req)) + (catch ExceptionInfo e + (error-handler e)) + (catch Exception e + (error-handler e))))) :cljs (ajax/POST (add-csrf-token-to-url url) req)) c))) diff --git a/src/kintone_client/record.cljc b/src/kintone_client/record.cljc index 8ce9e19..04f08c6 100644 --- a/src/kintone_client/record.cljc +++ b/src/kintone_client/record.cljc @@ -81,7 +81,7 @@ :id - Cursor id string" - [conn {:as cursor :keys [id]}] + [conn {:keys [id]}] (let [url (pt/-url conn path/cursor) params {:id id}] (pt/-get conn url {:params params}))) @@ -108,7 +108,7 @@ Maximum: 500" ([conn app] (get-all-records conn app nil)) - ([conn app {:as opts :keys [fields query size]}] + ([conn app opts] (go (let [res (BulkRequest {:method :PUT :path path/record :payload (assoc (->update-params params) :app app)})) - ([conn app {:as params :keys [id update-key record revision]}] + ([conn app params] (let [url (pt/-url conn path/record) params (assoc (->update-params params) :app app)] @@ -426,7 +426,7 @@ The default and maximum is 10 comments." ([conn app id] (get-comments conn app id nil)) - ([conn app id {:as opts :keys [order offset limit]}] + ([conn app id {:keys [order offset limit]}] (let [url (pt/-url conn path/comments) params {:app app :record id @@ -457,7 +457,7 @@ :type - The type of the mentioned target. USER or GROUP or ORGANIZATION" - [conn app id {:as comment :keys [text mentions]}] + [conn app id {:keys [text mentions]}] (let [url (pt/-url conn path/comment) params {:app app :record id @@ -537,12 +537,12 @@ :revision - The revision number of the record. integer, optional" - ([app {:as params :keys [id action assignee revision]}] + ([app params] (t/map->BulkRequest {:method :PUT :path path/status :payload (assoc (->status-record params) :app app)})) - ([conn app {:as params :keys [id action assignee revision]}] + ([conn app params] (let [url (pt/-url conn path/status) params (assoc (->status-record params) :app app)] @@ -576,12 +576,12 @@ :revision - The revision number of the record. integer, optional" - ([app [{:keys [id action assignee revision]} :as records]] + ([app records] (t/map->BulkRequest {:method :PUT :path path/statuses :payload {:app app :records (mapv ->status-record records)}})) - ([conn app [{:keys [id action assignee revision]} :as records]] + ([conn app records] (let [url (pt/-url conn path/statuses) params {:app app :records (mapv ->status-record records)}] diff --git a/src/kintone_client/user.cljc b/src/kintone_client/user.cljc index 75beaf5..0613d5f 100644 --- a/src/kintone_client/user.cljc +++ b/src/kintone_client/user.cljc @@ -1,7 +1,7 @@ (ns kintone-client.user (:require - #?(:clj [clojure.core.async :refer [go go-loop KintoneResponse {:headers {"X-Cybozu-API-Token" "TestApiToken" @@ -118,7 +118,7 @@ (KintoneResponse {:headers {"X-Cybozu-API-Token" "TestApiToken"} @@ -133,7 +133,7 @@ (KintoneResponse {:body {:headers {"X-Cybozu-API-Token" "TestApiToken" @@ -152,7 +152,7 @@ {:params {:id 1}})))))) (testing "custom handler user api" - (with-redefs [client/get (fn [url req h eh] + (with-redefs [client/get (fn [_url req h _eh] (h {:body req}))] (is (= (t/->KintoneResponse {:body {:headers {"X-Cybozu-API-Token" "TestApiToken"} @@ -172,7 +172,7 @@ (testing "ExceptionInfo" (testing "JSON response" (with-redefs [client/post - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "application/json; charset=utf-8"} @@ -186,7 +186,7 @@ (testing "JSON response user api" (with-redefs [client/get - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "application/json; charset=utf-8"} @@ -200,7 +200,7 @@ (testing "HTML response" (with-redefs [client/post - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "text/html; charset=utf-8"} @@ -214,7 +214,7 @@ (testing "HTML response user api" (with-redefs [client/get - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "text/html; charset=utf-8"} @@ -228,7 +228,7 @@ (testing "custom error-handler" (with-redefs [client/post - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "application/json; charset=utf-8"} @@ -242,7 +242,7 @@ (testing "custom error-handler user api" (with-redefs [client/get - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "application/json; charset=utf-8"} @@ -256,7 +256,7 @@ (testing "Exception" (with-redefs [client/post - (fn [url req h eh] + (fn [_url _req _h eh] (eh (Exception. "Test error")))] (let [{:keys [status status-text response]} (:err (KintoneResponse {:headers {"X-Cybozu-API-Token" "TestApiToken"} @@ -453,7 +453,7 @@ (KintoneResponse {:id 1} @@ -466,7 +466,7 @@ (testing "ExceptionInfo" (testing "JSON response" (with-redefs [client/post - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "application/json; charset=utf-8"} @@ -480,7 +480,7 @@ (testing "HTML response" (with-redefs [client/post - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "text/html; charset=utf-8"} @@ -494,7 +494,7 @@ (testing "custom error-handler" (with-redefs [client/post - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "text/html; charset=utf-8"} @@ -508,7 +508,7 @@ (testing "Exception" (with-redefs [client/post - (fn [url req h eh] + (fn [_url _req _h eh] (eh (Exception. "Test error")))] (let [{:keys [status status-text response]} (:err (KintoneResponse {:headers {"X-Cybozu-API-Token" "TestApiToken"} @@ -613,7 +613,7 @@ (KintoneResponse {:id 1} @@ -626,7 +626,7 @@ (testing "ExceptionInfo" (testing "JSON response" (with-redefs [client/put - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "application/json; charset=utf-8"} @@ -640,7 +640,7 @@ (testing "HTML response" (with-redefs [client/put - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "text/html; charset=utf-8"} @@ -654,7 +654,7 @@ (testing "custom error-handler" (with-redefs [client/put - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "application/json; charset=utf-8"} @@ -668,7 +668,7 @@ (testing "Exception" (with-redefs [client/put - (fn [url req h eh] + (fn [_url _req _h eh] (eh (Exception. "Test error")))] (let [{:keys [status status-text response]} (:err (KintoneResponse {:headers {"X-Cybozu-API-Token" "TestApiToken"} @@ -779,7 +779,7 @@ (KintoneResponse {:id 1} @@ -792,7 +792,7 @@ (testing "ExceptionInfo" (testing "JSON response" (with-redefs [client/delete - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "application/json; charset=utf-8"} @@ -806,7 +806,7 @@ (testing "HTML response" (with-redefs [client/delete - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "text/html; charset=utf-8"} @@ -820,7 +820,7 @@ (testing "custom error-handler" (with-redefs [client/delete - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "application/json; charset=utf-8"} @@ -834,7 +834,7 @@ (testing "Exception" (with-redefs [client/delete - (fn [url req h eh] + (fn [_url _req _h eh] (eh (Exception. "Test error")))] (let [{:keys [status status-text response]} (:err (KintoneResponse {:headers {"X-Cybozu-API-Token" "TestApiToken" @@ -951,7 +951,7 @@ :as :stream})))))) (testing "Positive but custom handler" - (with-redefs [client/post (fn [url req h eh] + (with-redefs [client/post (fn [_url req h _eh] (h {:body req}))] (is (= (t/->KintoneResponse {:id 1} @@ -964,7 +964,7 @@ (testing "ExceptionInfo" (testing "JSON response" (with-redefs [client/post - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "application/json; charset=utf-8"} @@ -978,7 +978,7 @@ (testing "HTML response" (with-redefs [client/post - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "text/html; charset=utf-8"} @@ -992,7 +992,7 @@ (testing "custom error-handler" (with-redefs [client/post - (fn [url req h eh] + (fn [_url _req _h eh] (eh (ex-info "Test error" {:status 400 :headers {"Content-Type" "application/json; charset=utf-8"} @@ -1006,7 +1006,7 @@ (testing "Exception" (with-redefs [client/post - (fn [url req h eh] + (fn [_url _req _h eh] (eh (Exception. "Test error")))] (let [{:keys [status status-text response]} (:err (KintoneResponse {:headers {"X-Cybozu-API-Token" "TestApiToken"} @@ -1111,7 +1111,7 @@ (KintoneResponse [{:id 1}] @@ -1124,7 +1124,7 @@ (testing "ExceptionInfo" (testing "JSON response" (with-redefs [client/post - (fn [url req] + (fn [_url _req] (throw (ex-info "Test error" {:status 400 @@ -1139,7 +1139,7 @@ (testing "HTML response" (with-redefs [client/post - (fn [url req] + (fn [_url _req] (throw (ex-info "Test error" {:status 400 @@ -1154,7 +1154,7 @@ (testing "custom error-handler" (with-redefs [client/post - (fn [url req] + (fn [_url _req] (throw (ex-info "Test error" {:status 400 @@ -1169,7 +1169,7 @@ (testing "Exception" (with-redefs [client/post - (fn [url req] + (fn [_url _req] (throw (Exception. "Test error")))] (let [{:keys [status status-text response]} (:err (KintoneResponse nil {:status 500})) c))] @@ -78,12 +78,12 @@ (testing "Fail to get record on the first request" (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse nil {:status 400})) c))] @@ -93,12 +93,12 @@ (testing "Fail to get record on the second request" (let [ncall (atom 0)] (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (if (< @ncall 2) (do (swap! ncall inc) @@ -113,12 +113,12 @@ (testing "Success" (let [ncall (atom 0)] (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (if (< @ncall 2) (do (swap! ncall inc) @@ -180,7 +180,7 @@ (deftest add-all-records-test (testing "Fail to add on the first request" (with-redefs [r/add-records - (fn [conn app records] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse nil {:status 400})) c))] @@ -191,7 +191,7 @@ (testing "Fail to add on the second request" (let [ncall (atom 0)] (with-redefs [r/add-records - (fn [conn app records] + (fn [& _] (let [c (chan)] (if (< @ncall 1) (do (swap! ncall inc) @@ -262,7 +262,7 @@ (deftest update-all-records-test (testing "Fail to update on the first request" (with-redefs [r/update-records - (fn [conn app records] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse nil {:status 400})) c))] @@ -275,7 +275,7 @@ (testing "Fail to update on the second request" (let [ncall (atom 0)] (with-redefs [r/update-records - (fn [conn app records] + (fn [& _] (let [c (chan)] (if (< @ncall 1) (do (swap! ncall inc) @@ -339,7 +339,7 @@ (deftest delete-all-records-by-query-test (testing "Fail to create cursor" (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse nil {:status 500})) c))] @@ -348,12 +348,12 @@ (testing "Fail to get record on the first request" (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse nil {:status 400})) c))] @@ -363,12 +363,12 @@ (testing "Fail to get record on the second request" (let [ncall (atom 0)] (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (if (< @ncall 2) (do (swap! ncall inc) @@ -382,12 +382,12 @@ (testing "Get empty records" (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:records []} nil)) c))] @@ -397,12 +397,12 @@ (testing "Success" (let [ncall (atom 0)] (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (if (< @ncall 2) (do (swap! ncall inc) diff --git a/test/kintone_client/record_test.cljs b/test/kintone_client/record_test.cljs index 8249230..ba1fefc 100644 --- a/test/kintone_client/record_test.cljs +++ b/test/kintone_client/record_test.cljs @@ -83,7 +83,7 @@ (async done (go (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse nil {:status 500})) c))] @@ -96,12 +96,12 @@ (async done (go (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse nil {:status 400})) c))] @@ -115,12 +115,12 @@ (go (let [ncall (atom 0)] (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (if (< @ncall 2) (do (swap! ncall inc) @@ -139,12 +139,12 @@ (go (let [ncall (atom 0)] (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (if (< @ncall 2) (do (swap! ncall inc) @@ -217,7 +217,7 @@ (async done (go (with-redefs [r/add-records - (fn [conn app records] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse nil {:status 400})) c))] @@ -232,7 +232,7 @@ (go (let [ncall (atom 0)] (with-redefs [r/add-records - (fn [conn app records] + (fn [& _] (let [c (chan)] (if (< @ncall 1) (do (swap! ncall inc) @@ -311,7 +311,7 @@ (async done (go (with-redefs [r/update-records - (fn [conn app records] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse nil {:status 400})) c))] @@ -328,7 +328,7 @@ (go (let [ncall (atom 0)] (with-redefs [r/update-records - (fn [conn app records] + (fn [& _] (let [c (chan)] (if (< @ncall 1) (do (swap! ncall inc) @@ -401,7 +401,7 @@ (async done (go (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse nil {:status 500})) c))] @@ -414,12 +414,12 @@ (async done (go (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse nil {:status 400})) c))] @@ -433,12 +433,12 @@ (go (let [ncall (atom 0)] (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (if (< @ncall 2) (do (swap! ncall inc) @@ -456,12 +456,12 @@ (async done (go (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:records []} nil)) c))] @@ -475,12 +475,12 @@ (go (let [ncall (atom 0)] (with-redefs [r/create-cursor - (fn [conn app otps] + (fn [& _] (let [c (chan)] (put! c (t/->KintoneResponse {:id "123-123"} nil)) c)) r/get-records-by-cursor - (fn [conn cursor] + (fn [& _] (let [c (chan)] (if (< @ncall 2) (do (swap! ncall inc) diff --git a/test/kintone_client/test_helper.cljc b/test/kintone_client/test_helper.cljc index ea9c3ed..8660c5c 100644 --- a/test/kintone_client/test_helper.cljc +++ b/test/kintone_client/test_helper.cljc @@ -1,7 +1,7 @@ (ns kintone-client.test-helper (:require - #?@(:clj [[clojure.core.async :refer [KintoneResponse {:users [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:users [{:id 1} {:id 2}]} nil) - (KintoneResponse {:users [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} - nil)) - 3 (put! c (t/->KintoneResponse {:users [{:id 4}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:users [{:id 1} - {:id 2} - {:id 3}]} nil) - (KintoneResponse {:users [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:users [{:id 1} {:id 2}]} nil) - (KintoneResponse {:users [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} - nil)) - 3 (put! c (t/->KintoneResponse {:users [{:id 4}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:users [{:id 1} - {:id 2} - {:id 3}]} nil) - (KintoneResponse - {:users (map #(assoc {} :id %) (range 100))} - nil)) - 2 (put! c (t/->KintoneResponse {:users []} - nil))) - c))] - (is (= 100 - (-> (KintoneResponse - {:users (map #(assoc {} :id (+ (* 100 @ncall) %)) - (range 100))} +(deftest get-all-users-with-query-by-user-code + (async done + (go + (let [ncall (atom 0)] + (with-redefs [user/get-users + (fn [& _] + (let [c (chan)] + (swap! ncall inc) + (case @ncall + 1 (put! c (t/->KintoneResponse {:users [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:users [{:id 1} {:id 2}]} nil) + (KintoneResponse {:users [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} + nil)) + 3 (put! c (t/->KintoneResponse {:users [{:id 4}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:users [{:id 1} + {:id 2} + {:id 3}]} nil) + (KintoneResponse {:users [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:users [{:id 1} {:id 2}]} nil) + (KintoneResponse {:users [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:users [{:id 3}]} + nil)) + 3 (put! c (t/->KintoneResponse {:users [{:id 4}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:users [{:id 1} + {:id 2} + {:id 3}]} nil) + (KintoneResponse + {:users (map #(assoc {} :id %) (range 100))} nil)) - (put! c (t/->KintoneResponse {:users [{:id 1000} {:id 1500}]} + 2 (put! c (t/->KintoneResponse {:users []} + nil))) + c))] + (is (= 100 + (-> (KintoneResponse + {:users (map #(assoc {} :id (+ (* 100 @ncall) %)) + (range 100))} + nil)) + (put! c (t/->KintoneResponse {:users [{:id 1000} {:id 1500}]} + nil))) + c))] + (is (= 202 + (-> (KintoneResponse {:organizations [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:organizations [{:id 1} {:id 2}]} nil) + (KintoneResponse {:organizations [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} + nil)) + 3 (put! c (t/->KintoneResponse {:organizations [{:id 4}]} nil))) - c))] - (is (= 202 - (-> (KintoneResponse {:organizations [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:organizations [{:id 1} {:id 2}]} nil) - (KintoneResponse {:organizations [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} - nil)) - 3 (put! c (t/->KintoneResponse {:organizations [{:id 4}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:organizations [{:id 1} - {:id 2} - {:id 3}]} nil) - (KintoneResponse {:organizations [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:organizations [{:id 1} {:id 2}]} nil) - (KintoneResponse {:organizations [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} - nil)) - 3 (put! c (t/->KintoneResponse {:organizations [{:id 4}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:organizations [{:id 1} - {:id 2} - {:id 3}]} nil) - (KintoneResponse - {:organizations (map #(assoc {} :id %) (range 100))} - nil)) - 2 (put! c (t/->KintoneResponse {:organizations []} - nil))) - c))] - (is (= 100 - (-> (KintoneResponse - {:organizations (map #(assoc {} :id (+ (* 100 @ncall) %)) - (range 100))} + c))] + (is (= (t/->KintoneResponse {:organizations [{:id 1} + {:id 2} + {:id 3}]} nil) + (KintoneResponse {:organizations [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:organizations [{:id 1} {:id 2}]} nil) + (KintoneResponse {:organizations [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:organizations [{:id 3}]} + nil)) + 3 (put! c (t/->KintoneResponse {:organizations [{:id 4}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:organizations [{:id 1} + {:id 2} + {:id 3}]} nil) + (KintoneResponse + {:organizations (map #(assoc {} :id %) (range 100))} nil)) - (put! c (t/->KintoneResponse {:organizations [{:id 1000} {:id 1500}]} + 2 (put! c (t/->KintoneResponse {:organizations []} + nil))) + c))] + (is (= 100 + (-> (KintoneResponse + {:organizations (map #(assoc {} :id (+ (* 100 @ncall) %)) + (range 100))} + nil)) + (put! c (t/->KintoneResponse {:organizations [{:id 1000} {:id 1500}]} + nil))) + c))] + (is (= 202 + (-> (KintoneResponse {:groups [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} nil))) - c))] - (is (= 202 - (-> (KintoneResponse {:groups [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:groups [{:id 1} {:id 2}]} nil) - (KintoneResponse {:groups [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} - nil)) - 3 (put! c (t/->KintoneResponse {:groups [{:id 4}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:groups [{:id 1} - {:id 2} - {:id 3}]} nil) - (KintoneResponse {:groups [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:groups [{:id 1} {:id 2}]} nil) - (KintoneResponse {:groups [{:id 1} {:id 2}]} - nil)) - 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} - nil)) - 3 (put! c (t/->KintoneResponse {:groups [{:id 4}]} - nil))) - c))] - (is (= (t/->KintoneResponse {:groups [{:id 1} - {:id 2} - {:id 3}]} nil) - (KintoneResponse - {:groups (map #(assoc {} :id %) (range 100))} - nil)) - 2 (put! c (t/->KintoneResponse {:groups []} - nil))) - c))] - (is (= 100 - (-> (KintoneResponse - {:groups (map #(assoc {} :id (+ (* 100 @ncall) %)) - (range 100))} + c))] + (is (= (t/->KintoneResponse {:groups [{:id 1} {:id 2}]} nil) + (KintoneResponse {:groups [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} + nil)) + 3 (put! c (t/->KintoneResponse {:groups [{:id 4}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:groups [{:id 1} + {:id 2} + {:id 3}]} nil) + (KintoneResponse {:groups [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:groups [{:id 1} {:id 2}]} nil) + (KintoneResponse {:groups [{:id 1} {:id 2}]} + nil)) + 2 (put! c (t/->KintoneResponse {:groups [{:id 3}]} + nil)) + 3 (put! c (t/->KintoneResponse {:groups [{:id 4}]} + nil))) + c))] + (is (= (t/->KintoneResponse {:groups [{:id 1} + {:id 2} + {:id 3}]} nil) + (KintoneResponse + {:groups (map #(assoc {} :id %) (range 100))} nil)) - (put! c (t/->KintoneResponse {:groups [{:id 1000} {:id 1500}]} + 2 (put! c (t/->KintoneResponse {:groups []} nil))) - c))] - (is (= 202 - (-> ( (KintoneResponse + {:groups (map #(assoc {} :id (+ (* 100 @ncall) %)) + (range 100))} + nil)) + (put! c (t/->KintoneResponse {:groups [{:id 1000} {:id 1500}]} + nil))) + c))] + (is (= 202 + (-> ( Date: Mon, 1 Apr 2024 15:40:47 +0900 Subject: [PATCH 7/9] chore: Add lint and format-check targets to Makefile --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 34139ed..882d526 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,11 @@ .PHONY: test +lint: + clj-kondo --lint src:test + +format-check: + cljstyle check --report -v + clean: lein clean From a45ff2ab3b12c0cde1550ce652941a341f405de8 Mon Sep 17 00:00:00 2001 From: liquidz Date: Mon, 1 Apr 2024 15:41:29 +0900 Subject: [PATCH 8/9] test: Add GitHub Actions workflow instead of CircleCI --- .circleci/config.yml | 39 ---------------- .github/workflows/lint-and-test.yml | 72 +++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 39 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/lint-and-test.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 01f25a1..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,39 +0,0 @@ -version: 2 - -jobs: - build: - docker: - - image: circleci/clojure:openjdk-8-lein-2.9.1-node-browsers-legacy - user: circleci - environment: - JVM_OPTS: -Xms1g -Xmx1g - working_directory: ~/repo - steps: - - checkout - - restore_cache: - keys: - - v2-dependencies-{{ checksum "project.clj" }} - - v2-dependencies- - - run: - name: Fetch dependencies - command: lein deps - - run: - name: Install karma dependencies - command: yarn add karma karma-cljs-test karma-chrome-launcher --dev - - run: - name: Install karma-cli - command: sudo yarn global add karma-cli - - save_cache: - key: v2-dependencies-{{ checksum "project.clj" }} - paths: - - ~/.m2 - - ~/repo/node_modules - - run: - name: Test - command: make test - -workflows: - version: 2 - build_and_test: - jobs: - - build diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml new file mode 100644 index 0000000..ad85e46 --- /dev/null +++ b/.github/workflows/lint-and-test.yml @@ -0,0 +1,72 @@ +name: Lint and Test + +on: push + +jobs: + clj_style: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: DeLaGuardo/setup-clojure@master + with: + cljstyle: latest + - run: make format-check + + clj_kondo: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: DeLaGuardo/setup-clojure@master + with: + clj-kondo: latest + - run: make lint + + test: + needs: [clj_style, clj_kondo] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '11' + java-package: jdk + architecture: x64 + + - uses: DeLaGuardo/setup-clojure@master + with: + lein: '2.11.2' + + - uses: pnpm/action-setup@v2 + name: Install pnpm + id: pnpm-install + with: + version: 8 + + - uses: actions/setup-node@v4 + with: + node-version: '18.16.1' + cache: pnpm + + - name: Show versions + run: | + java -version + lein version + pnpm -v + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: | + ~/.m2 + ~/.lein + key: clj-cache-test-${{ hashFiles('project.clj') }} + restore-keys: | + clj-cache-test- + + - run: pnpm i --frozen-lockfile + + - name: Run tests + run: make test From eff97d7290c89cc911b04b53676823603cec0d1f Mon Sep 17 00:00:00 2001 From: liquidz Date: Wed, 3 Apr 2024 12:44:41 +0900 Subject: [PATCH 9/9] chore: Rename .cljstyle to .cljstyle.edn --- .cljstyle => .cljstyle.edn | 2 -- 1 file changed, 2 deletions(-) rename .cljstyle => .cljstyle.edn (96%) diff --git a/.cljstyle b/.cljstyle.edn similarity index 96% rename from .cljstyle rename to .cljstyle.edn index bdedb99..fa93a38 100644 --- a/.cljstyle +++ b/.cljstyle.edn @@ -11,5 +11,3 @@ :types {:enabled? false} :namespaces {:indent-size 1}} :files {:ignore #{"out" "target"}}} - -;; vim: ft=clojure