diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1583d9..e709db0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,11 +15,11 @@ jobs: strategy: matrix: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - node-version: [12, 14, 16] + node-version: [14, 16] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - uses: ankane/setup-mysql@v1 diff --git a/.gitignore b/.gitignore index 8011db9..6c63277 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ coverage *.xml .loopbackrc .idea - +.vscode diff --git a/deps/juggler-v3/package.json b/deps/juggler-v3/package.json deleted file mode 100644 index b8b1147..0000000 --- a/deps/juggler-v3/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "juggler-v3", - "version": "3.0.0", - "dependencies": { - "loopback-datasource-juggler":"3.x", - "should": "^8.4.0" - } -} diff --git a/deps/juggler-v3/test.js b/deps/juggler-v3/test.js deleted file mode 100644 index 2ecb1da..0000000 --- a/deps/juggler-v3/test.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: loopback-connector-mysql -// This file is licensed under the MIT License. -// License text available at https://opensource.org/licenses/MIT - -'use strict'; - -const should = require('should'); -const juggler = require('loopback-datasource-juggler'); -const name = require('./package.json').name; - -require('../../test/init'); - -describe(name, function() { - before(function() { - return global.resetDataSourceClass(juggler.DataSource); - }); - - after(function() { - return global.resetDataSourceClass(); - }); - - require('loopback-datasource-juggler/test/common.batch.js'); - require('loopback-datasource-juggler/test/include.test.js'); - - // === Operation hooks ==== // - - const suite = require('loopback-datasource-juggler/test/persistence-hooks.suite.js'); - const customConfig = Object.assign({}, global.config); - suite(global.getDataSource(customConfig, juggler.DataSource), should, {replaceOrCreateReportsNewInstance: false}); -}); diff --git a/deps/juggler-v4/package.json b/deps/juggler-v4/package.json deleted file mode 100644 index e73724e..0000000 --- a/deps/juggler-v4/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "juggler-v4", - "version": "4.0.0", - "dependencies": { - "loopback-datasource-juggler":"4.x", - "should": "^13.2.3" - } -} diff --git a/deps/juggler-v4/test.js b/deps/juggler-v4/test.js deleted file mode 100644 index ff2c450..0000000 --- a/deps/juggler-v4/test.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: loopback-connector-mysql -// This file is licensed under the MIT License. -// License text available at https://opensource.org/licenses/MIT - -'use strict'; - -const semver = require('semver'); -const should = require('should'); -const juggler = require('loopback-datasource-juggler'); -const name = require('./package.json').name; - -require('../../test/init'); - -describe(name, function() { - before(function() { - return global.resetDataSourceClass(juggler.DataSource); - }); - - after(function() { - return global.resetDataSourceClass(); - }); - - require('loopback-datasource-juggler/test/common.batch.js'); - require('loopback-datasource-juggler/test/include.test.js'); - - // === Operation hooks ==== // - - const suite = require('loopback-datasource-juggler/test/persistence-hooks.suite.js'); - const customConfig = Object.assign({}, global.config); - suite(global.getDataSource(customConfig, juggler.DataSource), should, {replaceOrCreateReportsNewInstance: false}); -}); diff --git a/lib/mysql.js b/lib/mysql.js index 9dd4330..bf10905 100644 --- a/lib/mysql.js +++ b/lib/mysql.js @@ -74,6 +74,8 @@ function MySQL(settings) { require('util').inherits(MySQL, SqlConnector); +MySQL.prototype.multiInsertSupported = true; + MySQL.prototype.connect = function(callback) { const self = this; const options = generateOptions(this.settings); @@ -324,6 +326,20 @@ MySQL.prototype.getInsertedId = function(model, info) { return insertedId; }; +MySQL.prototype.getInsertedIds = function(model, info) { + let insertedIds = []; + const idProp = this.getDataSource(model).idProperty(model); + if (info && info.affectedRows > 0) { + insertedIds = new Array(info.affectedRows); + for (let i = 0; i < info.affectedRows; i++) { + insertedIds[i] = idProp.generated && typeof idProp.type() === 'number' && + typeof info.insertId === 'number' && info.insertId > 0 ? + info.insertId + i : undefined; + } + } + return insertedIds; +}; + /*! * Convert property name/value to an escaped DB column value * @param {Object} prop Property descriptor diff --git a/package-lock.json b/package-lock.json index f63f18d..9910c92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,422 +5,42 @@ "requires": true, "packages": { "": { - "version": "6.0.1", + "name": "loopback-connector-mysql", + "version": "6.1.0", "license": "MIT", "dependencies": { "async": "^3.2.0", "debug": "^4.1.1", "lodash": "^4.17.11", - "loopback-connector": "^5.0.0", + "loopback-connector": "^5.2.0", "mysql": "^2.11.1", "strong-globalize": "^6.0.4" }, "devDependencies": { - "@commitlint/config-conventional": "12.1.4", + "@commitlint/config-conventional": "^12.1.4", "eslint": "^7.7.0", "eslint-config-loopback": "^13.1.0", - "juggler-v3": "file:./deps/juggler-v3", - "juggler-v4": "file:./deps/juggler-v4", - "loopback-datasource-juggler": "^3.0.0 || ^4.0.0", + "loopback-datasource-juggler": "^4.28.0", "mocha": "^8.1.2", "rc": "^1.0.0", "should": "^13.2.3", "sinon": "^9.0.3" }, "engines": { - "node": ">=10" + "node": "14 || 16" } }, "deps/juggler-v3": { "version": "3.0.0", - "dev": true, + "extraneous": true, "dependencies": { "loopback-datasource-juggler": "3.x", "should": "^8.4.0" } }, - "deps/juggler-v3/node_modules/async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "dev": true, - "dependencies": { - "lodash": "^4.17.14" - } - }, - "deps/juggler-v3/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "engines": { - "node": ">=4.8" - } - }, - "deps/juggler-v3/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "deps/juggler-v3/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "deps/juggler-v3/node_modules/execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "dependencies": { - "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" - }, - "engines": { - "node": ">=6" - } - }, - "deps/juggler-v3/node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "deps/juggler-v3/node_modules/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==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "deps/juggler-v3/node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "deps/juggler-v3/node_modules/lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "dependencies": { - "invert-kv": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "deps/juggler-v3/node_modules/loopback-connector": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/loopback-connector/-/loopback-connector-4.11.1.tgz", - "integrity": "sha512-EA31zur3xIhP4UW+P2rWEcSbqpk4jPddpTBZSSw8KCszM7T0/Pe4HvEmG0MndAWJctRPtrwKDEu/8rWuMDLf+A==", - "dev": true, - "dependencies": { - "async": "^3.2.0", - "bluebird": "^3.7.2", - "debug": "^4.1.1", - "msgpack5": "^4.2.0", - "strong-globalize": "^5.1.0", - "uuid": "^7.0.3" - }, - "engines": { - "node": ">=8.9" - } - }, - "deps/juggler-v3/node_modules/loopback-connector/node_modules/async": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", - "dev": true - }, - "deps/juggler-v3/node_modules/loopback-connector/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "deps/juggler-v3/node_modules/loopback-connector/node_modules/strong-globalize": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/strong-globalize/-/strong-globalize-5.1.0.tgz", - "integrity": "sha512-9cooAb6kNMDFmTDybkkch1x7b+LuzZNva8oIr+MxXnvx9jcvw4/4DTSXPc53mG68G0Q9YOTYZkhDkWe/DiJ1Qg==", - "dev": true, - "dependencies": { - "accept-language": "^3.0.18", - "debug": "^4.1.1", - "globalize": "^1.5.0", - "lodash": "^4.17.15", - "md5": "^2.2.1", - "mkdirp": "^0.5.5", - "os-locale": "^5.0.0", - "yamljs": "^0.3.0" - }, - "engines": { - "node": ">=8.9" - } - }, - "deps/juggler-v3/node_modules/loopback-connector/node_modules/uuid": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", - "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "deps/juggler-v3/node_modules/loopback-datasource-juggler": { - "version": "3.36.1", - "resolved": "https://registry.npmjs.org/loopback-datasource-juggler/-/loopback-datasource-juggler-3.36.1.tgz", - "integrity": "sha512-6eop3qxFyN3AkPBPUte2DHcsW1DopJwXXA20x3vwYsBSo4hLSv4gIeXo0+yqdQoXpHfbKRB9cv1hHEHAQSiWUA==", - "dev": true, - "dependencies": { - "async": "^2.6.0", - "bluebird": "^3.1.1", - "debug": "^3.1.0", - "depd": "^1.0.0", - "inflection": "^1.6.0", - "lodash": "^4.17.4", - "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" - }, - "engines": { - "node": ">=8" - } - }, - "deps/juggler-v3/node_modules/mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "dependencies": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "deps/juggler-v3/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "deps/juggler-v3/node_modules/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=", - "dev": true, - "dependencies": { - "path-key": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "deps/juggler-v3/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "deps/juggler-v3/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "deps/juggler-v3/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "deps/juggler-v3/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "deps/juggler-v3/node_modules/should": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/should/-/should-8.4.0.tgz", - "integrity": "sha1-XmCInT5kS73Tl6MM00+tKPz5C8A=", - "dev": true, - "dependencies": { - "should-equal": "0.8.0", - "should-format": "0.3.2", - "should-type": "0.2.0" - } - }, - "deps/juggler-v3/node_modules/should-equal": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-0.8.0.tgz", - "integrity": "sha1-o/BXMv9FusG3ukEvhAiFaBlkEpk=", - "dev": true, - "dependencies": { - "should-type": "0.2.0" - } - }, - "deps/juggler-v3/node_modules/should-format": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/should-format/-/should-format-0.3.2.tgz", - "integrity": "sha1-pZgx4Bot3uFJkRvHFIvlyAMZ4f8=", - "dev": true, - "dependencies": { - "should-type": "0.2.0" - } - }, - "deps/juggler-v3/node_modules/should-type": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/should-type/-/should-type-0.2.0.tgz", - "integrity": "sha1-ZwfvlVKdmJ3MCY/gdTqx+RNrt/Y=", - "dev": true - }, - "deps/juggler-v3/node_modules/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==", - "dev": true, - "dependencies": { - "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" - }, - "engines": { - "node": ">=6" - } - }, - "deps/juggler-v3/node_modules/strong-globalize/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "deps/juggler-v3/node_modules/strong-globalize/node_modules/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==", - "dev": true, - "dependencies": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "deps/juggler-v3/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, - "deps/juggler-v3/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, "deps/juggler-v4": { "version": "4.0.0", - "dev": true, + "extraneous": true, "dependencies": { "loopback-datasource-juggler": "4.x", "should": "^13.2.3" @@ -676,9 +296,9 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" @@ -736,9 +356,9 @@ } }, "node_modules/async": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==" + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" }, "node_modules/balanced-match": { "version": "1.0.2", @@ -1727,9 +1347,9 @@ } }, "node_modules/inflection": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.1.tgz", - "integrity": "sha512-dldYtl2WlN0QDkIDtg8+xFwOS2Tbmp12t1cHa5/YClU6ZQjTFm7B66UcVbh9NQB+HvT5BAd2t5+yKsBkw5pcqA==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.4.tgz", + "integrity": "sha512-6I/HUDeYFfuNCVS3td055BaXBwKYuzw7K3ExVMStBowKo9oOAMJIXIHvdyR3iboTCp1b+1i5DSkIZTcwIktuDw==", "dev": true, "engines": [ "node >= 0.4.0" @@ -1889,14 +1509,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "node_modules/juggler-v3": { - "resolved": "deps/juggler-v3", - "link": true - }, - "node_modules/juggler-v4": { - "resolved": "deps/juggler-v4", - "link": true - }, "node_modules/just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", @@ -1978,45 +1590,111 @@ } }, "node_modules/loopback-connector": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/loopback-connector/-/loopback-connector-5.0.1.tgz", - "integrity": "sha512-aSPT6x5WZdoW9ylyNE4CxGqFbIqC9cSEZJwWkCincso27PXlZPj52POoF6pgxug9mkH7MrbXuP3SSDLkLq5oQQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/loopback-connector/-/loopback-connector-5.2.0.tgz", + "integrity": "sha512-v4USSFPI/8tVurOuUFTV04+StkhsAapQVfByLAZkSMqnqop4NCq7ILQlVtMEO/cEiA1wJz/q30mihuUz4/Hd8w==", "dependencies": { - "async": "^3.2.0", + "async": "^3.2.4", "bluebird": "^3.7.2", - "debug": "^4.1.1", - "msgpack5": "^4.2.0", - "strong-globalize": "^6.0.4", - "uuid": "^8.3.0" + "debug": "^4.3.4", + "msgpack5": "^4.5.1", + "strong-globalize": "^6.0.5", + "uuid": "^8.3.2" }, "engines": { "node": ">=10" } }, + "node_modules/loopback-connector/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/loopback-datasource-juggler": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/loopback-datasource-juggler/-/loopback-datasource-juggler-4.26.0.tgz", - "integrity": "sha512-/R40jUGDrnRBgTh121L4Y7sHDF0KxbgSAN4gLJKp8xGNQ6KpkSQyqZkmap98eN7B75RES78DS3MGghsYMvAJ3Q==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/loopback-datasource-juggler/-/loopback-datasource-juggler-4.28.0.tgz", + "integrity": "sha512-Y1kwnms327FRnRBYVBLv7sckRSijHSZ+NXshEAOuzoEgBkBXfOLj8wXaBStydN/DOWwchUxmrs+YrbglTkZz+w==", "dev": true, "dependencies": { - "async": "^3.1.0", - "change-case": "^4.1.1", - "debug": "^4.1.0", + "async": "^3.2.4", + "change-case": "^4.1.2", + "debug": "^4.3.4", "depd": "^2.0.0", - "inflection": "^1.6.0", - "lodash": "^4.17.11", - "loopback-connector": "^5.0.0", - "minimatch": "^3.0.3", - "qs": "^6.5.0", - "shortid": "^2.2.6", + "inflection": "^1.13.4", + "lodash": "^4.17.21", + "loopback-connector": "^5.1.0", + "minimatch": "^5.1.0", + "nanoid": "^3.3.4", + "qs": "^6.10.5", "strong-globalize": "^6.0.5", - "traverse": "^0.6.6", - "uuid": "^8.3.1" + "traverse": "^0.6.7", + "uuid": "^8.3.2" }, "engines": { "node": ">=10" } }, + "node_modules/loopback-datasource-juggler/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/loopback-datasource-juggler/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/loopback-datasource-juggler/node_modules/minimatch": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", + "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/loopback-datasource-juggler/node_modules/nanoid": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -2097,10 +1775,13 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/mkdirp": { "version": "1.0.4", @@ -2249,12 +1930,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, "node_modules/nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -2370,15 +2045,6 @@ "node": ">=4" } }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/p-is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", @@ -2563,9 +2229,9 @@ } }, "node_modules/qs": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", - "integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "dev": true, "dependencies": { "side-channel": "^1.0.4" @@ -2774,21 +2440,6 @@ "node": ">=8" } }, - "node_modules/shortid": { - "version": "2.2.16", - "resolved": "https://registry.npmjs.org/shortid/-/shortid-2.2.16.tgz", - "integrity": "sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g==", - "dev": true, - "dependencies": { - "nanoid": "^2.1.0" - } - }, - "node_modules/shortid/node_modules/nanoid": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-2.1.11.tgz", - "integrity": "sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==", - "dev": true - }, "node_modules/should": { "version": "13.2.3", "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", @@ -2973,15 +2624,6 @@ "node": ">=8" } }, - "node_modules/strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -3090,10 +2732,13 @@ } }, "node_modules/traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=", - "dev": true + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.7.tgz", + "integrity": "sha512-/y956gpUo9ZNCb99YjxG7OaslxZWHfCHAUUfshwqOXmxUIvqLjVO581BT+gM59+QV9tFe6/CGG53tsA1Y7RSdg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/tslib": { "version": "2.2.0", @@ -3204,9 +2849,9 @@ } }, "node_modules/wide-align/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "dev": true, "engines": { "node": ">=4" @@ -3576,9 +3221,9 @@ "dev": true }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -3621,9 +3266,9 @@ "dev": true }, "async": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==" + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" }, "balanced-match": { "version": "1.0.2", @@ -4377,9 +4022,9 @@ "dev": true }, "inflection": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.1.tgz", - "integrity": "sha512-dldYtl2WlN0QDkIDtg8+xFwOS2Tbmp12t1cHa5/YClU6ZQjTFm7B66UcVbh9NQB+HvT5BAd2t5+yKsBkw5pcqA==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.4.tgz", + "integrity": "sha512-6I/HUDeYFfuNCVS3td055BaXBwKYuzw7K3ExVMStBowKo9oOAMJIXIHvdyR3iboTCp1b+1i5DSkIZTcwIktuDw==", "dev": true }, "inflight": { @@ -4503,322 +4148,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "juggler-v3": { - "version": "file:deps/juggler-v3", - "requires": { - "loopback-datasource-juggler": "3.x", - "should": "^8.4.0" - }, - "dependencies": { - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "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" - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "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==", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "loopback-connector": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/loopback-connector/-/loopback-connector-4.11.1.tgz", - "integrity": "sha512-EA31zur3xIhP4UW+P2rWEcSbqpk4jPddpTBZSSw8KCszM7T0/Pe4HvEmG0MndAWJctRPtrwKDEu/8rWuMDLf+A==", - "dev": true, - "requires": { - "async": "^3.2.0", - "bluebird": "^3.7.2", - "debug": "^4.1.1", - "msgpack5": "^4.2.0", - "strong-globalize": "^5.1.0", - "uuid": "^7.0.3" - }, - "dependencies": { - "async": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", - "dev": true - }, - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "strong-globalize": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/strong-globalize/-/strong-globalize-5.1.0.tgz", - "integrity": "sha512-9cooAb6kNMDFmTDybkkch1x7b+LuzZNva8oIr+MxXnvx9jcvw4/4DTSXPc53mG68G0Q9YOTYZkhDkWe/DiJ1Qg==", - "dev": true, - "requires": { - "accept-language": "^3.0.18", - "debug": "^4.1.1", - "globalize": "^1.5.0", - "lodash": "^4.17.15", - "md5": "^2.2.1", - "mkdirp": "^0.5.5", - "os-locale": "^5.0.0", - "yamljs": "^0.3.0" - } - }, - "uuid": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", - "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==", - "dev": true - } - } - }, - "loopback-datasource-juggler": { - "version": "3.36.1", - "resolved": "https://registry.npmjs.org/loopback-datasource-juggler/-/loopback-datasource-juggler-3.36.1.tgz", - "integrity": "sha512-6eop3qxFyN3AkPBPUte2DHcsW1DopJwXXA20x3vwYsBSo4hLSv4gIeXo0+yqdQoXpHfbKRB9cv1hHEHAQSiWUA==", - "dev": true, - "requires": { - "async": "^2.6.0", - "bluebird": "^3.1.1", - "debug": "^3.1.0", - "depd": "^1.0.0", - "inflection": "^1.6.0", - "lodash": "^4.17.4", - "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" - } - }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "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=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "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=", - "dev": true - }, - "should": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/should/-/should-8.4.0.tgz", - "integrity": "sha1-XmCInT5kS73Tl6MM00+tKPz5C8A=", - "dev": true, - "requires": { - "should-equal": "0.8.0", - "should-format": "0.3.2", - "should-type": "0.2.0" - } - }, - "should-equal": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-0.8.0.tgz", - "integrity": "sha1-o/BXMv9FusG3ukEvhAiFaBlkEpk=", - "dev": true, - "requires": { - "should-type": "0.2.0" - } - }, - "should-format": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/should-format/-/should-format-0.3.2.tgz", - "integrity": "sha1-pZgx4Bot3uFJkRvHFIvlyAMZ4f8=", - "dev": true, - "requires": { - "should-type": "0.2.0" - } - }, - "should-type": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/should-type/-/should-type-0.2.0.tgz", - "integrity": "sha1-ZwfvlVKdmJ3MCY/gdTqx+RNrt/Y=", - "dev": true - }, - "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==", - "dev": true, - "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" - }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "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==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - } - } - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "juggler-v4": { - "version": "file:deps/juggler-v4", - "requires": { - "loopback-datasource-juggler": "4.x", - "should": "^13.2.3" - } - }, "just-extend": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", @@ -4885,37 +4214,82 @@ } }, "loopback-connector": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/loopback-connector/-/loopback-connector-5.0.1.tgz", - "integrity": "sha512-aSPT6x5WZdoW9ylyNE4CxGqFbIqC9cSEZJwWkCincso27PXlZPj52POoF6pgxug9mkH7MrbXuP3SSDLkLq5oQQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/loopback-connector/-/loopback-connector-5.2.0.tgz", + "integrity": "sha512-v4USSFPI/8tVurOuUFTV04+StkhsAapQVfByLAZkSMqnqop4NCq7ILQlVtMEO/cEiA1wJz/q30mihuUz4/Hd8w==", "requires": { - "async": "^3.2.0", + "async": "^3.2.4", "bluebird": "^3.7.2", - "debug": "^4.1.1", - "msgpack5": "^4.2.0", - "strong-globalize": "^6.0.4", - "uuid": "^8.3.0" + "debug": "^4.3.4", + "msgpack5": "^4.5.1", + "strong-globalize": "^6.0.5", + "uuid": "^8.3.2" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + } } }, "loopback-datasource-juggler": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/loopback-datasource-juggler/-/loopback-datasource-juggler-4.26.0.tgz", - "integrity": "sha512-/R40jUGDrnRBgTh121L4Y7sHDF0KxbgSAN4gLJKp8xGNQ6KpkSQyqZkmap98eN7B75RES78DS3MGghsYMvAJ3Q==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/loopback-datasource-juggler/-/loopback-datasource-juggler-4.28.0.tgz", + "integrity": "sha512-Y1kwnms327FRnRBYVBLv7sckRSijHSZ+NXshEAOuzoEgBkBXfOLj8wXaBStydN/DOWwchUxmrs+YrbglTkZz+w==", "dev": true, "requires": { - "async": "^3.1.0", - "change-case": "^4.1.1", - "debug": "^4.1.0", + "async": "^3.2.4", + "change-case": "^4.1.2", + "debug": "^4.3.4", "depd": "^2.0.0", - "inflection": "^1.6.0", - "lodash": "^4.17.11", - "loopback-connector": "^5.0.0", - "minimatch": "^3.0.3", - "qs": "^6.5.0", - "shortid": "^2.2.6", + "inflection": "^1.13.4", + "lodash": "^4.17.21", + "loopback-connector": "^5.1.0", + "minimatch": "^5.1.0", + "nanoid": "^3.3.4", + "qs": "^6.10.5", "strong-globalize": "^6.0.5", - "traverse": "^0.6.6", - "uuid": "^8.3.1" + "traverse": "^0.6.7", + "uuid": "^8.3.2" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "minimatch": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", + "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "nanoid": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "dev": true + } } }, "lower-case": { @@ -4983,9 +4357,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", "dev": true }, "mkdirp": { @@ -5104,12 +4478,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, "nise": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", @@ -5198,12 +4566,6 @@ "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=", - "dev": true - }, "p-is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", @@ -5344,9 +4706,9 @@ "dev": true }, "qs": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", - "integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "dev": true, "requires": { "side-channel": "^1.0.4" @@ -5497,23 +4859,6 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, - "shortid": { - "version": "2.2.16", - "resolved": "https://registry.npmjs.org/shortid/-/shortid-2.2.16.tgz", - "integrity": "sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g==", - "dev": true, - "requires": { - "nanoid": "^2.1.0" - }, - "dependencies": { - "nanoid": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-2.1.11.tgz", - "integrity": "sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==", - "dev": true - } - } - }, "should": { "version": "13.2.3", "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", @@ -5677,12 +5022,6 @@ "ansi-regex": "^5.0.0" } }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, "strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -5768,9 +5107,9 @@ } }, "traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=", + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.7.tgz", + "integrity": "sha512-/y956gpUo9ZNCb99YjxG7OaslxZWHfCHAUUfshwqOXmxUIvqLjVO581BT+gM59+QV9tFe6/CGG53tsA1Y7RSdg==", "dev": true }, "tslib": { @@ -5861,9 +5200,9 @@ }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "dev": true }, "is-fullwidth-code-point": { diff --git a/package.json b/package.json index 7e36451..1e8a8bf 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,13 @@ "version": "6.1.0", "description": "MySQL connector for loopback-datasource-juggler", "engines": { - "node": ">=10" + "node": "14 || 16" }, "main": "index.js", "scripts": { "pretest": "node pretest.js", "lint": "eslint .", - "test": "mocha test/*.test.js node_modules/juggler-v3/test.js node_modules/juggler-v4/test.js", + "test": "mocha test/*.test.js", "posttest": "npm run lint" }, "files": [ @@ -23,21 +23,19 @@ "async": "^3.2.0", "debug": "^4.1.1", "lodash": "^4.17.11", - "loopback-connector": "^5.0.0", + "loopback-connector": "^5.2.0", "mysql": "^2.11.1", "strong-globalize": "^6.0.4" }, "devDependencies": { + "@commitlint/config-conventional": "^12.1.4", "eslint": "^7.7.0", "eslint-config-loopback": "^13.1.0", - "juggler-v3": "file:./deps/juggler-v3", - "juggler-v4": "file:./deps/juggler-v4", - "loopback-datasource-juggler": "^3.0.0 || ^4.0.0", + "loopback-datasource-juggler": "^4.28.0", "mocha": "^8.1.2", "rc": "^1.0.0", "should": "^13.2.3", - "sinon": "^9.0.3", - "@commitlint/config-conventional": "^12.1.4" + "sinon": "^9.0.3" }, "repository": { "type": "git", diff --git a/test/mysql.test.js b/test/mysql.test.js index 6632973..44c0280 100644 --- a/test/mysql.test.js +++ b/test/mysql.test.js @@ -126,6 +126,60 @@ describe('mysql', function() { }); }); + it('createAll should create an array of instances', function(done) { + Post.createAll([ + {title: 'Title 1', content: 'Content 1'}, + {title: 'Title 2', content: 'Content 2'}, + ], + function(err, posts) { + should.not.exist(err); + posts.should.be.an.Array; + posts.should.have.lengthOf(2); + posts[0].should.have.property('id'); + posts[0].id.should.be.a.Number; + posts[0].title.should.be.equal('Title 1'); + posts[0].content.should.be.equal('Content 1'); + posts[1].should.have.property('id'); + posts[1].id.should.be.a.Number; + posts[1].title.should.be.equal('Title 2'); + posts[1].content.should.be.equal('Content 2'); + + Post.findById(posts[0].id, function(er, p) { + should.not.exist(er); + p.id.should.be.equal(posts[0].id); + p.content.should.be.equal(posts[0].content); + done(); + }); + }); + }); + + it('createAll should create an array of instances even when id is not auto generated', function(done) { + PostWithStringId.createAll([ + {id: '10', title: 'Title 1', content: 'Content 1'}, + {id: '20', title: 'Title 2', content: 'Content 2'}, + ], + function(err, posts) { + should.not.exist(err); + posts.should.be.an.Array; + posts.should.have.lengthOf(2); + posts[0].should.have.property('id'); + posts[0].id.should.be.a.String; + posts[0].title.should.be.equal('Title 1'); + posts[0].content.should.be.equal('Content 1'); + posts[1].should.have.property('id'); + posts[1].id.should.be.a.String; + posts[1].title.should.be.equal('Title 2'); + posts[1].content.should.be.equal('Content 2'); + + PostWithStringId.findById(posts[0].id, function(er, p) { + should.not.exist(er); + p.id.should.be.equal(posts[0].id); + p.content.should.be.equal(posts[0].content); + done(); + }); + }); + }); + it('updateOrCreate should update the instance', function(done) { Post.create({title: 'a', content: 'AAA'}, function(err, post) { post.title = 'b'; @@ -716,7 +770,7 @@ describe('mysql', function() { Post.destroyAll(done); }); beforeEach(function createTestFixtures(done) { - Post.create([ + Post.createAll([ {title: 'a', content: 'AAA'}, {title: 'b', content: 'BBB'}, ], done); @@ -928,7 +982,7 @@ describe('mysql', function() { Post.destroyAll(done); }); beforeEach(function createTestFixtures(done) { - Post.create([ + Post.createAll([ {title: 'About Redis', content: 'Redis is a Database'}, {title: 'Usage', content: 'How To Use MySQL database Well'}, {title: 'About Mysql', content: 'Mysql is a database'},