diff --git a/packages/repository-tests/package-lock.json b/packages/repository-tests/package-lock.json index 4452905864db..63dd511e3d71 100644 --- a/packages/repository-tests/package-lock.json +++ b/packages/repository-tests/package-lock.json @@ -9,12 +9,113 @@ "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==" }, + "@types/lodash": { + "version": "4.14.136", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.136.tgz", + "integrity": "sha512-0GJhzBdvsW2RUccNHOBkabI8HZVdOXmXbXhuKlDEd5Vv12P7oAVGfomGp3Ne21o5D/qu1WmthlNKFaoZJJeErA==", + "dev": true + }, "@types/node": { "version": "10.14.15", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.15.tgz", "integrity": "sha512-CBR5avlLcu0YCILJiDIXeU2pTw7UK/NIxfC63m7d7CVamho1qDEzXKkOtEauQRPMy6MI8mLozth+JJkas7HY6g==", "dev": true }, + "accept-language": { + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/accept-language/-/accept-language-3.0.18.tgz", + "integrity": "sha1-9QJfF79lpGaoRYOMz5jNuHfYM4Q=", + "requires": { + "bcp47": "^1.1.2", + "stable": "^0.1.6" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "bcp47": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/bcp47/-/bcp47-1.1.2.tgz", + "integrity": "sha1-NUvjMH/9CEM6ePXh4glYRfifx/4=" + }, + "bl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.0.tgz", + "integrity": "sha512-wbgvOpqopSr7uq6fJrLH8EsvYMJf9gzfo2jCsL2eTy75qXPukA4pCgHamOQkZtY5vmfVtjB+P3LNlMHW5CEZXA==", + "requires": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "bluebird": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", + "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=" + }, + "cldrjs": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/cldrjs/-/cldrjs-0.5.1.tgz", + "integrity": "sha512-xyiP8uAm8K1IhmpDndZLraloW1yqu0L+HYdQ7O1aGPxx9Cr+BMnPANlNhSt++UKfxytL2hd2NPXgTjiy7k43Ew==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=" + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -23,10 +124,444 @@ "ms": "^2.1.1" } }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "^1.4.0" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + } + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globalize": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/globalize/-/globalize-1.4.2.tgz", + "integrity": "sha512-IfKeYI5mAITBmT5EnH8kSQB5uGson4Fkj2XtTpyEbIS7IHNfLHoeTyLJ6tfjiKC6cJXng3IhVurDk5C7ORqFhQ==", + "requires": { + "cldrjs": "^0.5.0" + } + }, + "inflection": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.12.0.tgz", + "integrity": "sha1-ogCTVlbW9fa8TcdQLhrstwMihBY=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "requires": { + "invert-kv": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "loopback-connector": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/loopback-connector/-/loopback-connector-4.8.0.tgz", + "integrity": "sha512-X5A4YaS6iifomym97ll/J/V+iPZ3Av69J6gmG3QXkq2JtzDtAOh6g2ITgo9aYJ/rzRf9HESH3Ys7aqeppDkpZQ==", + "requires": { + "async": "^2.1.5", + "bluebird": "^3.4.6", + "debug": "^3.1.0", + "msgpack5": "^4.2.0", + "strong-globalize": "^4.1.1", + "uuid": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "loopback-datasource-juggler": { + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/loopback-datasource-juggler/-/loopback-datasource-juggler-4.11.0.tgz", + "integrity": "sha512-yy4Nau1qDROKgreFwaSDOtTg/74sDO34GUnfFe4vORLByaDTlG4auN6NBOQE7b4ab3vcI8Jbe81MR5OdaB9AXw==", + "requires": { + "async": "^2.6.0", + "debug": "^4.1.0", + "depd": "^2.0.0", + "inflection": "^1.6.0", + "lodash": "^4.17.11", + "loopback-connector": "^4.4.0", + "minimatch": "^3.0.3", + "qs": "^6.5.0", + "shortid": "^2.2.6", + "strong-globalize": "^4.1.1", + "traverse": "^0.6.6", + "uuid": "^3.0.1" + }, + "dependencies": { + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + } + } + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "requires": { + "p-defer": "^1.0.0" + } + }, + "md5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", + "integrity": "sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=", + "requires": { + "charenc": "~0.0.1", + "crypt": "~0.0.1", + "is-buffer": "~1.1.1" + } + }, + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "msgpack5": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/msgpack5/-/msgpack5-4.2.1.tgz", + "integrity": "sha512-Xo7nE9ZfBVonQi1rSopNAqPdts/QHyuSEUwIEzAkB+V2FtmkkLUbP6MyVqVVQxsZYI65FpvW3Bb8Z9ZWEjbgHQ==", + "requires": { + "bl": "^2.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.3.6", + "safe-buffer": "^5.1.2" + } + }, + "nanoid": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-2.0.3.tgz", + "integrity": "sha512-NbaoqdhIYmY6FXDRB4eYtDVC9Z9eCbn8TyaiC16LNKtpPv/aqa0tOPD8y6gNE4yUNnaZ7LLhYtXOev/6+cBtfw==" + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "^2.0.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + } + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "shortid": { + "version": "2.2.14", + "resolved": "https://registry.npmjs.org/shortid/-/shortid-2.2.14.tgz", + "integrity": "sha512-4UnZgr9gDdA1kaKj/38IiudfC3KHKhDc1zi/HSxd9FQDR0VLwH3/y79tZJLsVYPsJgIjeHjqIWaWVRJUj9qZOQ==", + "requires": { + "nanoid": "^2.0.0" + } + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "stable": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "strong-globalize": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/strong-globalize/-/strong-globalize-4.1.3.tgz", + "integrity": "sha512-SJegV7w5D4AodEspZJtJ7rls3fmi+Zc0PdyJCqBsg4RN9B8TC80/uAI2fikC+s1Jp9FLvr2vDX8f0Fqc62M4OA==", + "requires": { + "accept-language": "^3.0.18", + "debug": "^4.1.1", + "globalize": "^1.4.2", + "lodash": "^4.17.4", + "md5": "^2.2.1", + "mkdirp": "^0.5.1", + "os-locale": "^3.1.0", + "yamljs": "^0.3.0" + } + }, + "traverse": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", + "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "yamljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.3.0.tgz", + "integrity": "sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ==", + "requires": { + "argparse": "^1.0.7", + "glob": "^7.0.5" + } } } } diff --git a/packages/repository-tests/package.json b/packages/repository-tests/package.json index 62861ddba3cc..46c052b9adec 100644 --- a/packages/repository-tests/package.json +++ b/packages/repository-tests/package.json @@ -23,14 +23,17 @@ "@loopback/build": "^1.7.1", "@loopback/repository": "^1.10.1", "@types/debug": "^4.1.5", - "@types/node": "^10.14.15" + "@types/node": "^10.14.15", + "@types/lodash": "^4.14.136" }, "dependencies": { + "loopback-datasource-juggler": "^4.11.0", + "lodash": "^4.17.15", "@loopback/testlab": "^1.7.2", "@types/debug": "^4.1.5", "debug": "^4.1.1", - "@loopback/context": "1.21.1", - "@loopback/core": "1.9.0" + "@loopback/context": "^1.21.1", + "@loopback/core": "^1.9.0" }, "peerDependencies": { "@loopback/repository": "^1.6.1" diff --git a/packages/repository-tests/src/__tests__/acceptance/belongs-to.relation.acceptance.ts b/packages/repository-tests/src/__tests__/acceptance/belongs-to.relation.acceptance.ts index cc076884cc66..cf5bf84e390d 100644 --- a/packages/repository-tests/src/__tests__/acceptance/belongs-to.relation.acceptance.ts +++ b/packages/repository-tests/src/__tests__/acceptance/belongs-to.relation.acceptance.ts @@ -3,10 +3,19 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import { Application } from '@loopback/core'; -import { expect } from '@loopback/testlab'; -import { ApplicationWithRepositories, juggler, repository, RepositoryMixin } from '../..'; -import { CustomerRepository, OrderRepository, ShipmentRepository } from '../fixtures/repositories'; +import {Application} from '@loopback/core'; +import { + ApplicationWithRepositories, + juggler, + repository, + RepositoryMixin, +} from '@loopback/repository'; +import {expect} from '@loopback/testlab'; +import { + CustomerRepository, + OrderRepository, + ShipmentRepository, +} from '../fixtures/repositories'; describe('BelongsTo relation', () => { // Given a Customer and Order models - see definitions at the bottom @@ -26,7 +35,7 @@ describe('BelongsTo relation', () => { }); it('can find customer of order', async () => { - const customer = await customerRepo.create({ name: 'Order McForder' }); + const customer = await customerRepo.create({name: 'Order McForder'}); const order = await orderRepo.create({ customerId: customer.id, description: 'Order from Order McForder, the hoarder of Mordor', @@ -53,7 +62,7 @@ describe('BelongsTo relation', () => { class OrderController { constructor( @repository(OrderRepository) protected orderRepository: OrderRepository, - ) { } + ) {} async findOwnerOfOrder(orderId: string) { return this.orderRepository.customer(orderId); @@ -65,9 +74,9 @@ describe('BelongsTo relation', () => { } function givenApplicationWithMemoryDB() { - class TestApp extends RepositoryMixin(Application) { } + class TestApp extends RepositoryMixin(Application) {} app = new TestApp(); - app.dataSource(new juggler.DataSource({ name: 'db', connector: 'memory' })); + app.dataSource(new juggler.DataSource({name: 'db', connector: 'memory'})); } async function givenBoundCrudRepositories() { diff --git a/packages/repository-tests/src/__tests__/acceptance/has-many-without-id.relation.acceptance.ts b/packages/repository-tests/src/__tests__/acceptance/has-many-without-di.relation.acceptance.ts similarity index 89% rename from packages/repository-tests/src/__tests__/acceptance/has-many-without-id.relation.acceptance.ts rename to packages/repository-tests/src/__tests__/acceptance/has-many-without-di.relation.acceptance.ts index 74629b853bd0..098a3a1a95a0 100644 --- a/packages/repository-tests/src/__tests__/acceptance/has-many-without-id.relation.acceptance.ts +++ b/packages/repository-tests/src/__tests__/acceptance/has-many-without-di.relation.acceptance.ts @@ -3,9 +3,18 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import { expect } from '@loopback/testlab'; -import { DefaultCrudRepository, Entity, EntityCrudRepository, Getter, hasMany, HasManyRepositoryFactory, juggler, model, property } from '../..'; - +import {Getter} from '@loopback/context'; +import { + DefaultCrudRepository, + Entity, + EntityCrudRepository, + hasMany, + HasManyRepositoryFactory, + juggler, + model, + property, +} from '@loopback/repository'; +import {expect} from '@loopback/testlab'; describe('HasMany relation', () => { // Given a Customer and Order models - see definitions at the bottom @@ -64,7 +73,7 @@ describe('HasMany relation', () => { expect(orders).to.not.containEql(notMyOrder); const persisted = await orderRepo.find({ - where: { customerId: existingCustomerId }, + where: {customerId: existingCustomerId}, }); expect(persisted).to.deepEqual(orders); }); @@ -112,7 +121,7 @@ describe('HasMany relation', () => { class OrderRepository extends DefaultCrudRepository< Order, typeof Order.prototype.id - > { + > { constructor(db: juggler.DataSource) { super(Order, db); } @@ -121,7 +130,7 @@ describe('HasMany relation', () => { class CustomerRepository extends DefaultCrudRepository< Customer, typeof Customer.prototype.id - > { + > { public readonly orders: HasManyRepositoryFactory< Order, typeof Customer.prototype.id @@ -142,7 +151,7 @@ describe('HasMany relation', () => { } function givenDataSource() { - ds = new juggler.DataSource({ connector: 'memory' }); + ds = new juggler.DataSource({connector: 'memory'}); } function givenOrderRepository() { @@ -154,6 +163,6 @@ describe('HasMany relation', () => { } async function givenPersistedCustomerInstance() { - return customerRepo.create({ name: 'a customer' }); + return customerRepo.create({name: 'a customer'}); } }); diff --git a/packages/repository-tests/src/__tests__/acceptance/has-many.relation.acceptance.ts b/packages/repository-tests/src/__tests__/acceptance/has-many.relation.acceptance.ts index 7fad56240801..253db6a1ba68 100644 --- a/packages/repository-tests/src/__tests__/acceptance/has-many.relation.acceptance.ts +++ b/packages/repository-tests/src/__tests__/acceptance/has-many.relation.acceptance.ts @@ -3,12 +3,17 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import { Application } from '@loopback/core'; -import { expect } from '@loopback/testlab'; +import {Application} from '@loopback/core'; +import { + ApplicationWithRepositories, + juggler, + repository, + RepositoryMixin, +} from '@loopback/repository'; +import {expect} from '@loopback/testlab'; import * as _ from 'lodash'; -import { ApplicationWithRepositories, juggler, repository, RepositoryMixin } from '../..'; -import { Customer, Order } from '../fixtures/models'; -import { CustomerRepository, OrderRepository } from '../fixtures/repositories'; +import {Customer, Order} from '../fixtures/models'; +import {CustomerRepository, OrderRepository} from '../fixtures/repositories'; describe('HasMany relation', () => { // Given a Customer and Order models - see definitions at the bottom @@ -59,7 +64,7 @@ describe('HasMany relation', () => { expect(foundOrders).to.not.containEql(notMyOrder); const persisted = await orderRepo.find({ - where: { customerId: existingCustomerId }, + where: {customerId: existingCustomerId}, }); expect(persisted).to.deepEqual(foundOrders); }); @@ -73,7 +78,7 @@ describe('HasMany relation', () => { description: 'order 2', isShipped: false, }); - const patchObject = { isShipped: true }; + const patchObject = {isShipped: true}; const arePatched = await controller.patchCustomerOrders( existingCustomerId, patchObject, @@ -149,7 +154,7 @@ describe('HasMany relation', () => { context('when targeting the source model', () => { it('gets the parent entity through the child entity', async () => { - const parent = await customerRepo.create({ name: 'parent customer' }); + const parent = await customerRepo.create({name: 'parent customer'}); const child = await customerRepo.create({ name: 'child customer', parentId: parent.id, @@ -183,7 +188,7 @@ describe('HasMany relation', () => { constructor( @repository(CustomerRepository) protected customerRepository: CustomerRepository, - ) { } + ) {} async createCustomerOrders( customerId: number, @@ -221,10 +226,10 @@ describe('HasMany relation', () => { } function givenApplicationWithMemoryDB() { - class TestApp extends RepositoryMixin(Application) { } + class TestApp extends RepositoryMixin(Application) {} app = new TestApp(); - app.dataSource(new juggler.DataSource({ name: 'db', connector: 'memory' })); + app.dataSource(new juggler.DataSource({name: 'db', connector: 'memory'})); } async function givenBoundCrudRepositoriesForCustomerAndOrder() { @@ -242,6 +247,6 @@ describe('HasMany relation', () => { } async function givenPersistedCustomerInstance() { - return customerRepo.create({ name: 'a customer' }); + return customerRepo.create({name: 'a customer'}); } }); diff --git a/packages/repository-tests/src/__tests__/acceptance/has-one.relation.acceptance.ts b/packages/repository-tests/src/__tests__/acceptance/has-one.relation.acceptance.ts index 4374e1e891b8..a0b73652b349 100644 --- a/packages/repository-tests/src/__tests__/acceptance/has-one.relation.acceptance.ts +++ b/packages/repository-tests/src/__tests__/acceptance/has-one.relation.acceptance.ts @@ -3,11 +3,18 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import { Application } from '@loopback/core'; -import { expect, toJSON } from '@loopback/testlab'; -import { ApplicationWithRepositories, EntityNotFoundError, Filter, juggler, repository, RepositoryMixin } from '../..'; -import { Address } from '../fixtures/models'; -import { AddressRepository, CustomerRepository } from '../fixtures/repositories'; +import {Application} from '@loopback/core'; +import { + ApplicationWithRepositories, + EntityNotFoundError, + Filter, + juggler, + repository, + RepositoryMixin, +} from '@loopback/repository'; +import {expect, toJSON} from '@loopback/testlab'; +import {Address} from '../fixtures/models'; +import {AddressRepository, CustomerRepository} from '../fixtures/repositories'; describe('hasOne relation', () => { // Given a Customer and Address models - see definitions at the bottom @@ -72,7 +79,7 @@ describe('hasOne relation', () => { expect(toJSON(foundAddress)).to.deepEqual(toJSON(address)); const persisted = await addressRepo.find({ - where: { customerId: existingCustomerId }, + where: {customerId: existingCustomerId}, }); expect(persisted[0]).to.deepEqual(foundAddress); }); @@ -85,12 +92,12 @@ describe('hasOne relation', () => { // not accepted in the filter object for the get() method // if the following line is uncommented { - where: { street: '456 test road' }, + where: {street: '456 test road'}, }, ); const persisted = await addressRepo.find({ - where: { customerId: existingCustomerId }, + where: {customerId: existingCustomerId}, }); // TODO: make sure this test fails when where condition is supplied // compiler should have errored out (?) @@ -116,13 +123,13 @@ describe('hasOne relation', () => { province: 'Rhone', }); - const patchObject = { city: 'Lyon-Genas' }; + const patchObject = {city: 'Lyon-Genas'}; const arePatched = await controller.patchCustomerAddress( existingCustomerId, patchObject, ); - expect(arePatched).to.deepEqual({ count: 1 }); + expect(arePatched).to.deepEqual({count: 1}); const patchedData = await addressRepo.findById(address.zipcode); expect(toJSON(patchedData)).to.deepEqual({ customerId: existingCustomerId, @@ -134,20 +141,20 @@ describe('hasOne relation', () => { }); it('patches the related instance only', async () => { - const bob = await customerRepo.create({ name: 'Bob' }); - await customerRepo.address(bob.id).create({ city: 'Paris' }); + const bob = await customerRepo.create({name: 'Bob'}); + await customerRepo.address(bob.id).create({city: 'Paris'}); - const alice = await customerRepo.create({ name: 'Alice' }); - await customerRepo.address(alice.id).create({ city: 'London' }); + const alice = await customerRepo.create({name: 'Alice'}); + await customerRepo.address(alice.id).create({city: 'London'}); const result = await controller.patchCustomerAddress(alice.id, { city: 'New York', }); - expect(result).to.deepEqual({ count: 1 }); + expect(result).to.deepEqual({count: 1}); const found = await customerRepo.address(bob.id).get(); - expect(toJSON(found)).to.containDeep({ city: 'Paris' }); + expect(toJSON(found)).to.containDeep({city: 'Paris'}); }); it('throws an error when PATCH tries to change the foreignKey', async () => { @@ -169,7 +176,7 @@ describe('hasOne relation', () => { const areDeleted = await controller.deleteCustomerAddress( existingCustomerId, ); - expect(areDeleted).to.deepEqual({ count: 1 }); + expect(areDeleted).to.deepEqual({count: 1}); await expect( controller.findCustomerAddress(existingCustomerId), @@ -177,15 +184,15 @@ describe('hasOne relation', () => { }); it('deletes the related model instance only', async () => { - const bob = await customerRepo.create({ name: 'Bob' }); - await customerRepo.address(bob.id).create({ city: 'Paris' }); + const bob = await customerRepo.create({name: 'Bob'}); + await customerRepo.address(bob.id).create({city: 'Paris'}); - const alice = await customerRepo.create({ name: 'Alice' }); - await customerRepo.address(alice.id).create({ city: 'London' }); + const alice = await customerRepo.create({name: 'Alice'}); + await customerRepo.address(alice.id).create({city: 'London'}); const result = await controller.deleteCustomerAddress(alice.id); - expect(result).to.deepEqual({ count: 1 }); + expect(result).to.deepEqual({count: 1}); const found = await addressRepo.find(); expect(found).to.have.length(1); @@ -197,7 +204,7 @@ describe('hasOne relation', () => { constructor( @repository(CustomerRepository) protected customerRepository: CustomerRepository, - ) { } + ) {} async createCustomerAddress( customerId: number, @@ -229,9 +236,9 @@ describe('hasOne relation', () => { } function givenApplicationWithMemoryDB() { - class TestApp extends RepositoryMixin(Application) { } + class TestApp extends RepositoryMixin(Application) {} app = new TestApp(); - app.dataSource(new juggler.DataSource({ name: 'db', connector: 'memory' })); + app.dataSource(new juggler.DataSource({name: 'db', connector: 'memory'})); } async function givenBoundCrudRepositoriesForCustomerAndAddress() { @@ -249,6 +256,6 @@ describe('hasOne relation', () => { } async function givenPersistedCustomerInstance() { - return customerRepo.create({ name: 'a customer' }); + return customerRepo.create({name: 'a customer'}); } }); diff --git a/packages/repository-tests/src/__tests__/acceptance/repository.acceptance.ts b/packages/repository-tests/src/__tests__/acceptance/repository.acceptance.ts index d795fa17f348..7d87ec93af7b 100644 --- a/packages/repository-tests/src/__tests__/acceptance/repository.acceptance.ts +++ b/packages/repository-tests/src/__tests__/acceptance/repository.acceptance.ts @@ -3,11 +3,17 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import { expect } from '@loopback/testlab'; -import { DataSource } from 'loopback-datasource-juggler'; -import { AnyObject, DefaultCrudRepository, Entity, model, property } from '../..'; -import { Product } from '../fixtures/models/product.model'; -import { ProductRepository } from '../fixtures/repositories/product.repository'; +import { + AnyObject, + DefaultCrudRepository, + Entity, + model, + property, +} from '@loopback/repository'; +import {expect} from '@loopback/testlab'; +import {DataSource} from 'loopback-datasource-juggler'; +import {Product} from '../fixtures/models/product.model'; +import {ProductRepository} from '../fixtures/repositories/product.repository'; // This test shows the recommended way how to use @loopback/repository // together with existing connectors when building LoopBack applications @@ -16,17 +22,17 @@ describe('Repository in Thinking in LoopBack', () => { beforeEach(givenProductRepository); it('counts models in empty database', async () => { - expect(await repo.count()).to.deepEqual({ count: 0 }); + expect(await repo.count()).to.deepEqual({count: 0}); }); it('creates a new model', async () => { - const p: Product = await repo.create({ name: 'Ink Pen', slug: 'pen' }); + const p: Product = await repo.create({name: 'Ink Pen', slug: 'pen'}); expect(p).instanceof(Product); expect.exists(p.id); }); it('can save a model', async () => { - const p = await repo.create({ slug: 'pencil' }); + const p = await repo.create({slug: 'pencil'}); p.name = 'Red Pencil'; await repo.save(p); @@ -40,29 +46,29 @@ describe('Repository in Thinking in LoopBack', () => { it('rejects extra model properties (defaults to strict mode)', async () => { await expect( - repo.create({ name: 'custom', extra: 'additional-data' } as AnyObject), + repo.create({name: 'custom', extra: 'additional-data'} as AnyObject), ).to.be.rejectedWith(/extra.*not defined/); }); it('allows models to allow additional properties', async () => { // TODO(bajtos) Add syntactic sugar to allow the following usage: // @model({strict: false}) - @model({ settings: { strict: false } }) + @model({settings: {strict: false}}) class Flexible extends Entity { - @property({ id: true }) + @property({id: true}) id: number; } const flexibleRepo = new DefaultCrudRepository< Flexible, typeof Flexible.prototype.id - >(Flexible, new DataSource({ connector: 'memory' })); + >(Flexible, new DataSource({connector: 'memory'})); const created = await flexibleRepo.create({ extra: 'additional data', } as AnyObject); const stored = await flexibleRepo.findById(created.id); - expect(stored).to.containDeep({ extra: 'additional data' }); + expect(stored).to.containDeep({extra: 'additional data'}); }); it('allows models to allow nested model properties', async () => { @@ -86,7 +92,7 @@ describe('Repository in Thinking in LoopBack', () => { }) id: number; - @property({ type: 'string' }) + @property({type: 'string'}) name: string; @property.array(Role) @@ -98,14 +104,14 @@ describe('Repository in Thinking in LoopBack', () => { const userRepo = new DefaultCrudRepository( User, - new DataSource({ connector: 'memory' }), + new DataSource({connector: 'memory'}), ); const user = { id: 1, name: 'foo', - roles: [{ name: 'admin' }, { name: 'user' }], - address: { street: 'backstreet' }, + roles: [{name: 'admin'}, {name: 'user'}], + address: {street: 'backstreet'}, }; const created = await userRepo.create(user); diff --git a/packages/repository-tests/src/__tests__/fixtures/models/address.model.ts b/packages/repository-tests/src/__tests__/fixtures/models/address.model.ts index c886c6d76214..996169f26b1d 100644 --- a/packages/repository-tests/src/__tests__/fixtures/models/address.model.ts +++ b/packages/repository-tests/src/__tests__/fixtures/models/address.model.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {belongsTo, Entity, model, property} from '../../..'; +import {belongsTo, Entity, model, property} from '@loopback/repository'; import {Customer, CustomerWithRelations} from './customer.model'; @model() diff --git a/packages/repository-tests/src/__tests__/fixtures/models/customer.model.ts b/packages/repository-tests/src/__tests__/fixtures/models/customer.model.ts index fd18dc9e82dd..4033d15a4267 100644 --- a/packages/repository-tests/src/__tests__/fixtures/models/customer.model.ts +++ b/packages/repository-tests/src/__tests__/fixtures/models/customer.model.ts @@ -3,7 +3,14 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {belongsTo, Entity, hasMany, hasOne, model, property} from '../../..'; +import { + belongsTo, + Entity, + hasMany, + hasOne, + model, + property, +} from '@loopback/repository'; import {Address, AddressWithRelations} from './address.model'; import {Order, OrderWithRelations} from './order.model'; diff --git a/packages/repository-tests/src/__tests__/fixtures/models/order.model.ts b/packages/repository-tests/src/__tests__/fixtures/models/order.model.ts index f4256925d89a..996467d72b35 100644 --- a/packages/repository-tests/src/__tests__/fixtures/models/order.model.ts +++ b/packages/repository-tests/src/__tests__/fixtures/models/order.model.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {belongsTo, Entity, model, property} from '../../..'; +import {belongsTo, Entity, model, property} from '@loopback/repository'; import {Customer, CustomerWithRelations} from './customer.model'; import {Shipment, ShipmentWithRelations} from './shipment.model'; diff --git a/packages/repository-tests/src/__tests__/fixtures/models/product.model.ts b/packages/repository-tests/src/__tests__/fixtures/models/product.model.ts index 7612e577e8e1..2341d173528f 100644 --- a/packages/repository-tests/src/__tests__/fixtures/models/product.model.ts +++ b/packages/repository-tests/src/__tests__/fixtures/models/product.model.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Entity, model, property} from '../../..'; +import {Entity, model, property} from '@loopback/repository'; @model() export class Product extends Entity { diff --git a/packages/repository-tests/src/__tests__/fixtures/models/shipment.model.ts b/packages/repository-tests/src/__tests__/fixtures/models/shipment.model.ts index cf9787af8448..9235451bfc1a 100644 --- a/packages/repository-tests/src/__tests__/fixtures/models/shipment.model.ts +++ b/packages/repository-tests/src/__tests__/fixtures/models/shipment.model.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Entity, hasMany, model, property} from '../../..'; +import {Entity, hasMany, model, property} from '@loopback/repository'; import {Order, OrderWithRelations} from './order.model'; @model() diff --git a/packages/repository-tests/src/__tests__/fixtures/repositories/address.repository.ts b/packages/repository-tests/src/__tests__/fixtures/repositories/address.repository.ts index 3be973cef13c..d2333880743c 100644 --- a/packages/repository-tests/src/__tests__/fixtures/repositories/address.repository.ts +++ b/packages/repository-tests/src/__tests__/fixtures/repositories/address.repository.ts @@ -9,7 +9,7 @@ import { DefaultCrudRepository, juggler, repository, -} from '../../..'; +} from '@loopback/repository'; import {Address, AddressRelations, Customer} from '../models'; import {CustomerRepository} from '../repositories'; diff --git a/packages/repository-tests/src/__tests__/fixtures/repositories/customer.repository.ts b/packages/repository-tests/src/__tests__/fixtures/repositories/customer.repository.ts index 9a2dcb302c98..7030fe78f5c4 100644 --- a/packages/repository-tests/src/__tests__/fixtures/repositories/customer.repository.ts +++ b/packages/repository-tests/src/__tests__/fixtures/repositories/customer.repository.ts @@ -8,10 +8,10 @@ import { BelongsToAccessor, DefaultCrudRepository, HasManyRepositoryFactory, + HasOneRepositoryFactory, juggler, repository, -} from '../../..'; -import {HasOneRepositoryFactory} from '../../../'; +} from '@loopback/repository'; import {Address, Customer, CustomerRelations, Order} from '../models'; import {AddressRepository} from './address.repository'; import {OrderRepository} from './order.repository'; diff --git a/packages/repository-tests/src/__tests__/fixtures/repositories/order.repository.ts b/packages/repository-tests/src/__tests__/fixtures/repositories/order.repository.ts index bd7bf0a7b32f..8abd6c946775 100644 --- a/packages/repository-tests/src/__tests__/fixtures/repositories/order.repository.ts +++ b/packages/repository-tests/src/__tests__/fixtures/repositories/order.repository.ts @@ -9,7 +9,7 @@ import { DefaultCrudRepository, juggler, repository, -} from '../../..'; +} from '@loopback/repository'; import {Customer, Order, OrderRelations, Shipment} from '../models'; import {CustomerRepository, ShipmentRepository} from '../repositories'; diff --git a/packages/repository-tests/src/__tests__/fixtures/repositories/product.repository.ts b/packages/repository-tests/src/__tests__/fixtures/repositories/product.repository.ts index 2ab4b0408e7d..d8de7a8a2143 100644 --- a/packages/repository-tests/src/__tests__/fixtures/repositories/product.repository.ts +++ b/packages/repository-tests/src/__tests__/fixtures/repositories/product.repository.ts @@ -3,9 +3,8 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {DefaultCrudRepository, juggler} from '../../..'; +import {DefaultCrudRepository, juggler} from '@loopback/repository'; import {Product, ProductRelations} from '../models/product.model'; -export {Product}; export class ProductRepository extends DefaultCrudRepository< Product, diff --git a/packages/repository-tests/src/__tests__/fixtures/repositories/shipment.repository.ts b/packages/repository-tests/src/__tests__/fixtures/repositories/shipment.repository.ts index 9b7aea3b768a..3f66da7c594c 100644 --- a/packages/repository-tests/src/__tests__/fixtures/repositories/shipment.repository.ts +++ b/packages/repository-tests/src/__tests__/fixtures/repositories/shipment.repository.ts @@ -4,13 +4,13 @@ // License text available at https://opensource.org/licenses/MIT import {Getter, inject} from '@loopback/context'; -import {OrderRepository} from '.'; import { DefaultCrudRepository, HasManyRepositoryFactory, juggler, repository, -} from '../../..'; +} from '@loopback/repository'; +import {OrderRepository} from '.'; import {Order, Shipment, ShipmentRelations} from '../models'; export class ShipmentRepository extends DefaultCrudRepository< diff --git a/packages/repository-tests/src/__tests__/integration/repositories/relation.factory.integration.ts b/packages/repository-tests/src/__tests__/integration/repositories/relation.factory.integration.ts index a5f76ca04bf4..ec0784452bfa 100644 --- a/packages/repository-tests/src/__tests__/integration/repositories/relation.factory.integration.ts +++ b/packages/repository-tests/src/__tests__/integration/repositories/relation.factory.integration.ts @@ -3,8 +3,24 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import { expect } from '@loopback/testlab'; -import { BelongsToAccessor, BelongsToDefinition, createBelongsToAccessor, createHasManyRepositoryFactory, DefaultCrudRepository, Entity, EntityCrudRepository, EntityNotFoundError, Getter, HasManyDefinition, HasManyRepository, HasManyRepositoryFactory, juggler, ModelDefinition, RelationType } from '../../..'; +import { + BelongsToAccessor, + BelongsToDefinition, + createBelongsToAccessor, + createHasManyRepositoryFactory, + DefaultCrudRepository, + Entity, + EntityCrudRepository, + EntityNotFoundError, + Getter, + HasManyDefinition, + HasManyRepository, + HasManyRepositoryFactory, + juggler, + ModelDefinition, + RelationType, +} from '@loopback/repository'; +import {expect} from '@loopback/testlab'; // Given a Customer and Order models - see definitions at the bottom let db: juggler.DataSource; @@ -108,7 +124,7 @@ describe('HasMany relation', () => { //--- HELPERS ---// async function givenPersistedCustomerInstance() { - const customer = await customerRepo.create({ name: 'a customer' }); + const customer = await customerRepo.create({name: 'a customer'}); existingCustomerId = customer.id; } @@ -154,7 +170,7 @@ describe('BelongsTo relation', () => { }); it('finds an instance of the related model', async () => { - const customer = await customerRepo.create({ name: 'Order McForder' }); + const customer = await customerRepo.create({name: 'Order McForder'}); const order = await orderRepo.create({ customerId: customer.id, description: 'Order from Order McForder, the hoarder of Mordor', @@ -195,9 +211,9 @@ class Order extends Entity { customerId: number; static definition = new ModelDefinition('Order') - .addProperty('id', { type: 'number', id: true }) - .addProperty('description', { type: 'string', required: true }) - .addProperty('customerId', { type: 'number', required: true }) + .addProperty('id', {type: 'number', id: true}) + .addProperty('description', {type: 'string', required: true}) + .addProperty('customerId', {type: 'number', required: true}) .addRelation({ name: 'customer', type: RelationType.belongsTo, @@ -215,10 +231,10 @@ class Review extends Entity { approvedId: number; static definition = new ModelDefinition('Review') - .addProperty('id', { type: 'number', id: true }) - .addProperty('description', { type: 'string', required: true }) - .addProperty('authorId', { type: 'number', required: false }) - .addProperty('approvedId', { type: 'number', required: false }); + .addProperty('id', {type: 'number', id: true}) + .addProperty('description', {type: 'string', required: true}) + .addProperty('authorId', {type: 'number', required: false}) + .addProperty('approvedId', {type: 'number', required: false}); } class Customer extends Entity { @@ -229,11 +245,11 @@ class Customer extends Entity { reviewsApproved: Review[]; static definition: ModelDefinition = new ModelDefinition('Customer') - .addProperty('id', { type: 'number', id: true }) - .addProperty('name', { type: 'string', required: true }) - .addProperty('orders', { type: Order, array: true }) - .addProperty('reviewsAuthored', { type: Review, array: true }) - .addProperty('reviewsApproved', { type: Review, array: true }) + .addProperty('id', {type: 'number', id: true}) + .addProperty('name', {type: 'string', required: true}) + .addProperty('orders', {type: Order, array: true}) + .addProperty('reviewsAuthored', {type: Review, array: true}) + .addProperty('reviewsApproved', {type: Review, array: true}) .addRelation({ name: 'orders', type: RelationType.hasMany, @@ -261,7 +277,7 @@ class Customer extends Entity { } function givenCrudRepositories() { - db = new juggler.DataSource({ connector: 'memory' }); + db = new juggler.DataSource({connector: 'memory'}); customerRepo = new DefaultCrudRepository(Customer, db); orderRepo = new DefaultCrudRepository(Order, db);