diff --git a/.codeclimate.yml b/.codeclimate.yml
index 86368f79c1..f8942ae456 100644
--- a/.codeclimate.yml
+++ b/.codeclimate.yml
@@ -35,8 +35,9 @@ plugins:
enabled: true
config:
count_threshold: 3
-exclude_patterns:
+exclude_patterns:
- "**/test/*"
+ - "**/adapter-tests/*"
- "**/dist/*"
- "**/*.dist.js"
- "**/templates/*"
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 92ae34318d..6309fa8f09 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,6 +40,8 @@ dist/
.mocha-puppeteer
# TypeScript compiled files
+packages/adapter-commons/lib
+packages/adapter-tests/lib
packages/authentication/lib
packages/authentication-local/lib
packages/authentication-client/lib
diff --git a/changelog.md b/changelog.md
index 475a4372b2..c9bd32de3e 100644
--- a/changelog.md
+++ b/changelog.md
@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
+
+
+### Bug Fixes
+
+* **authentication:** consistent response return between local and jwt strategy ([#2042](https://github.com/feathersjs/feathers/issues/2042)) ([8d25be1](https://github.com/feathersjs/feathers/commit/8d25be101a2593a9e789375c928a07780b9e28cf))
+* **authentication-oauth:** session.destroy is undefined when use cookie-session package ([#2100](https://github.com/feathersjs/feathers/issues/2100)) ([46e84b8](https://github.com/feathersjs/feathers/commit/46e84b83f2acce985380243fc6d08c64e96f0068))
+* **package:** Fix clean script in non Unix environments ([#2110](https://github.com/feathersjs/feathers/issues/2110)) ([09b62c0](https://github.com/feathersjs/feathers/commit/09b62c0c7e636caf620904ba87d61f168a020f05))
+* **typescript:** Add user property to the Params. ([#2090](https://github.com/feathersjs/feathers/issues/2090)) ([1e94265](https://github.com/feathersjs/feathers/commit/1e942651fbaaf07fc66c159225fbc992a0174bf4))
+
+
+
+
+
## [4.5.9](https://github.com/feathersjs/feathers/compare/v4.5.8...v4.5.9) (2020-10-09)
diff --git a/lerna.json b/lerna.json
index acb5f7804c..25f0764bff 100644
--- a/lerna.json
+++ b/lerna.json
@@ -3,7 +3,7 @@
"packages": [
"packages/*"
],
- "version": "4.5.10",
+ "version": "4.5.11",
"command": {
"bootstrap": {
"hoist": true
diff --git a/package-lock.json b/package-lock.json
index bc04af9efc..0dd5af13cd 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,19 +13,19 @@
}
},
"@babel/core": {
- "version": "7.12.3",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz",
- "integrity": "sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g==",
+ "version": "7.12.9",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.9.tgz",
+ "integrity": "sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.10.4",
- "@babel/generator": "^7.12.1",
+ "@babel/generator": "^7.12.5",
"@babel/helper-module-transforms": "^7.12.1",
- "@babel/helpers": "^7.12.1",
- "@babel/parser": "^7.12.3",
- "@babel/template": "^7.10.4",
- "@babel/traverse": "^7.12.1",
- "@babel/types": "^7.12.1",
+ "@babel/helpers": "^7.12.5",
+ "@babel/parser": "^7.12.7",
+ "@babel/template": "^7.12.7",
+ "@babel/traverse": "^7.12.9",
+ "@babel/types": "^7.12.7",
"convert-source-map": "^1.7.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.1",
@@ -37,9 +37,9 @@
},
"dependencies": {
"debug": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
- "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
+ "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"
@@ -85,12 +85,12 @@
}
},
"@babel/helper-member-expression-to-functions": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz",
- "integrity": "sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ==",
+ "version": "7.12.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz",
+ "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==",
"dev": true,
"requires": {
- "@babel/types": "^7.12.1"
+ "@babel/types": "^7.12.7"
}
},
"@babel/helper-module-imports": {
@@ -120,12 +120,12 @@
}
},
"@babel/helper-optimise-call-expression": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz",
- "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==",
+ "version": "7.12.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.7.tgz",
+ "integrity": "sha512-I5xc9oSJ2h59OwyUqjv95HRyzxj53DAubUERgQMrpcCEYQyToeHA+NEcUEsVWB4j53RDeskeBJ0SgRAYHDBckw==",
"dev": true,
"requires": {
- "@babel/types": "^7.10.4"
+ "@babel/types": "^7.12.7"
}
},
"@babel/helper-replace-supers": {
@@ -187,43 +187,43 @@
}
},
"@babel/parser": {
- "version": "7.12.5",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz",
- "integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ==",
+ "version": "7.12.7",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.7.tgz",
+ "integrity": "sha512-oWR02Ubp4xTLCAqPRiNIuMVgNO5Aif/xpXtabhzW2HWUD47XJsAB4Zd/Rg30+XeQA3juXigV7hlquOTmwqLiwg==",
"dev": true
},
"@babel/template": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz",
- "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==",
+ "version": "7.12.7",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz",
+ "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.10.4",
- "@babel/parser": "^7.10.4",
- "@babel/types": "^7.10.4"
+ "@babel/parser": "^7.12.7",
+ "@babel/types": "^7.12.7"
}
},
"@babel/traverse": {
- "version": "7.12.5",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.5.tgz",
- "integrity": "sha512-xa15FbQnias7z9a62LwYAA5SZZPkHIXpd42C6uW68o8uTuua96FHZy1y61Va5P/i83FAAcMpW8+A/QayntzuqA==",
+ "version": "7.12.9",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.9.tgz",
+ "integrity": "sha512-iX9ajqnLdoU1s1nHt36JDI9KG4k+vmI8WgjK5d+aDTwQbL2fUnzedNedssA645Ede3PM2ma1n8Q4h2ohwXgMXw==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.5",
"@babel/helper-function-name": "^7.10.4",
"@babel/helper-split-export-declaration": "^7.11.0",
- "@babel/parser": "^7.12.5",
- "@babel/types": "^7.12.5",
+ "@babel/parser": "^7.12.7",
+ "@babel/types": "^7.12.7",
"debug": "^4.1.0",
"globals": "^11.1.0",
"lodash": "^4.17.19"
},
"dependencies": {
"debug": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
- "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
+ "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"
@@ -232,9 +232,9 @@
}
},
"@babel/types": {
- "version": "7.12.6",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.6.tgz",
- "integrity": "sha512-hwyjw6GvjBLiyy3W0YQf0Z5Zf4NpYejUnKFcfcUhZCSffoBBp30w6wP2Wn6pk31jMYZvcOrB/1b7cGXvEoKogA==",
+ "version": "7.12.7",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.7.tgz",
+ "integrity": "sha512-MNyI92qZq6jrQkXvtIiykvl4WtoRrVV9MPn+ZfsoEENjiWcBQ3ZSHrkxnJWgWtLX3XXqX5hrSQ+X69wkmesXuQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
@@ -1233,21 +1233,21 @@
"dev": true
},
"@octokit/auth-token": {
- "version": "2.4.3",
- "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.3.tgz",
- "integrity": "sha512-fdGoOQ3kQJh+hrilc0Plg50xSfaCKOeYN9t6dpJKXN9BxhhfquL0OzoQXg3spLYymL5rm29uPeI3KEXRaZQ9zg==",
+ "version": "2.4.4",
+ "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.4.tgz",
+ "integrity": "sha512-LNfGu3Ro9uFAYh10MUZVaT7X2CnNm2C8IDQmabx+3DygYIQjs9FwzFAHN/0t6mu5HEPhxcb1XOuxdpY82vCg2Q==",
"dev": true,
"requires": {
- "@octokit/types": "^5.0.0"
+ "@octokit/types": "^6.0.0"
}
},
"@octokit/endpoint": {
- "version": "6.0.9",
- "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.9.tgz",
- "integrity": "sha512-3VPLbcCuqji4IFTclNUtGdp9v7g+nspWdiCUbK3+iPMjJCZ6LEhn1ts626bWLOn0GiDb6j+uqGvPpqLnY7pBgw==",
+ "version": "6.0.10",
+ "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.10.tgz",
+ "integrity": "sha512-9+Xef8nT7OKZglfkOMm7IL6VwxXUQyR7DUSU0LH/F7VNqs8vyd7es5pTfz9E7DwUIx7R3pGscxu1EBhYljyu7Q==",
"dev": true,
"requires": {
- "@octokit/types": "^5.0.0",
+ "@octokit/types": "^6.0.0",
"is-plain-object": "^5.0.0",
"universal-user-agent": "^6.0.0"
},
@@ -1266,6 +1266,12 @@
}
}
},
+ "@octokit/openapi-types": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-2.0.0.tgz",
+ "integrity": "sha512-J4bfM7lf8oZvEAdpS71oTvC1ofKxfEZgU5vKVwzZKi4QPiL82udjpseJwxPid9Pu2FNmyRQOX4iEj6W1iOSnPw==",
+ "dev": true
+ },
"@octokit/plugin-enterprise-rest": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz",
@@ -1320,14 +1326,14 @@
}
},
"@octokit/request": {
- "version": "5.4.10",
- "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.10.tgz",
- "integrity": "sha512-egA49HkqEORVGDZGav1mh+VD+7uLgOxtn5oODj6guJk0HCy+YBSYapFkSLFgeYj3Fr18ZULKGURkjyhkAChylw==",
+ "version": "5.4.12",
+ "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.12.tgz",
+ "integrity": "sha512-MvWYdxengUWTGFpfpefBBpVmmEYfkwMoxonIB3sUGp5rhdgwjXL1ejo6JbgzG/QD9B/NYt/9cJX1pxXeSIUCkg==",
"dev": true,
"requires": {
"@octokit/endpoint": "^6.0.1",
"@octokit/request-error": "^2.0.0",
- "@octokit/types": "^5.0.0",
+ "@octokit/types": "^6.0.3",
"deprecation": "^2.0.0",
"is-plain-object": "^5.0.0",
"node-fetch": "^2.6.1",
@@ -1336,12 +1342,12 @@
},
"dependencies": {
"@octokit/request-error": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.3.tgz",
- "integrity": "sha512-GgD5z8Btm301i2zfvJLk/mkhvGCdjQ7wT8xF9ov5noQY8WbKZDH9cOBqXzoeKd1mLr1xH2FwbtGso135zGBgTA==",
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.4.tgz",
+ "integrity": "sha512-LjkSiTbsxIErBiRh5wSZvpZqT4t0/c9+4dOe0PII+6jXR+oj/h66s7E4a/MghV7iT8W9ffoQ5Skoxzs96+gBPA==",
"dev": true,
"requires": {
- "@octokit/types": "^5.0.1",
+ "@octokit/types": "^6.0.0",
"deprecation": "^2.0.0",
"once": "^1.4.0"
}
@@ -1407,11 +1413,12 @@
}
},
"@octokit/types": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz",
- "integrity": "sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==",
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.1.1.tgz",
+ "integrity": "sha512-btm3D6S7VkRrgyYF31etUtVY/eQ1KzrNRqhFt25KSe2mKlXuLXJilglRC6eDA2P6ou94BUnk/Kz5MPEolXgoiw==",
"dev": true,
"requires": {
+ "@octokit/openapi-types": "^2.0.0",
"@types/node": ">= 8"
}
},
@@ -1432,15 +1439,15 @@
"dev": true
},
"@types/minimist": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz",
- "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=",
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz",
+ "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==",
"dev": true
},
"@types/node": {
- "version": "14.14.6",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz",
- "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw==",
+ "version": "14.14.10",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.10.tgz",
+ "integrity": "sha512-J32dgx2hw8vXrSbu4ZlVhn1Nm3GbeCFNw2FWL8S5QKucHGY0cyNwjdQdO+KMBZ4wpmC7KhLCiNsdk1RFRIYUQQ==",
"dev": true
},
"@types/normalize-package-data": {
@@ -2911,9 +2918,9 @@
}
},
"es-abstract": {
- "version": "1.17.7",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz",
- "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==",
+ "version": "1.18.0-next.1",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
+ "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
"dev": true,
"requires": {
"es-to-primitive": "^1.2.1",
@@ -2921,6 +2928,7 @@
"has": "^1.0.3",
"has-symbols": "^1.0.1",
"is-callable": "^1.2.2",
+ "is-negative-zero": "^2.0.0",
"is-regex": "^1.1.1",
"object-inspect": "^1.8.0",
"object-keys": "^1.1.1",
@@ -4475,9 +4483,9 @@
}
},
"is-core-module": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz",
- "integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==",
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz",
+ "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==",
"dev": true,
"requires": {
"has": "^1.0.3"
@@ -4571,9 +4579,9 @@
}
},
"is-negative-zero": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz",
- "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz",
+ "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==",
"dev": true
},
"is-number": {
@@ -4862,9 +4870,9 @@
},
"dependencies": {
"debug": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
- "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
+ "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"
@@ -5357,15 +5365,18 @@
}
},
"semver": {
- "version": "7.3.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
- "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
- "dev": true
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
+ "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
},
"type-fest": {
- "version": "0.18.0",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.0.tgz",
- "integrity": "sha512-fbDukFPnJBdn2eZ3RR+5mK2slHLFd6gYHY7jna1KWWy4Yr4XysHuCdXRzy+RiG/HwG4WJat00vdC2UHky5eKiQ==",
+ "version": "0.18.1",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz",
+ "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==",
"dev": true
},
"yallist": {
@@ -5375,9 +5386,9 @@
"dev": true
},
"yargs-parser": {
- "version": "20.2.3",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.3.tgz",
- "integrity": "sha512-emOFRT9WVHw03QSvN5qor9QQT9+sw5vwxfYweivSMHTcAXPefwVae2FjO7JJjj8hCE4CzPOPeFM83VwT29HCww==",
+ "version": "20.2.4",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
+ "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==",
"dev": true
}
}
@@ -6082,9 +6093,9 @@
}
},
"object-inspect": {
- "version": "1.8.0",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz",
- "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==",
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz",
+ "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==",
"dev": true
},
"object-keys": {
@@ -6115,13 +6126,14 @@
}
},
"object.getownpropertydescriptors": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz",
- "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==",
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.1.tgz",
+ "integrity": "sha512-6DtXgZ/lIZ9hqx4GtZETobXLR/ZLaa0aqV0kzbn80Rf8Z2e/XFnhA0I7p07N2wH8bBBltr2xQPi6sbKWAY2Eng==",
"dev": true,
"requires": {
+ "call-bind": "^1.0.0",
"define-properties": "^1.1.3",
- "es-abstract": "^1.17.0-next.1"
+ "es-abstract": "^1.18.0-next.1"
}
},
"object.pick": {
@@ -6797,12 +6809,12 @@
"dev": true
},
"resolve": {
- "version": "1.18.1",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.18.1.tgz",
- "integrity": "sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA==",
+ "version": "1.19.0",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
+ "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
"dev": true,
"requires": {
- "is-core-module": "^2.0.0",
+ "is-core-module": "^2.1.0",
"path-parse": "^1.0.6"
}
},
@@ -7251,9 +7263,9 @@
}
},
"spdx-license-ids": {
- "version": "3.0.6",
- "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz",
- "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==",
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz",
+ "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==",
"dev": true
},
"split": {
@@ -7364,67 +7376,23 @@
}
},
"string.prototype.trimend": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.2.tgz",
- "integrity": "sha512-8oAG/hi14Z4nOVP0z6mdiVZ/wqjDtWSLygMigTzAb+7aPEDTleeFf+WrF+alzecxIRkckkJVn+dTlwzJXORATw==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz",
+ "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==",
"dev": true,
"requires": {
- "define-properties": "^1.1.3",
- "es-abstract": "^1.18.0-next.1"
- },
- "dependencies": {
- "es-abstract": {
- "version": "1.18.0-next.1",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
- "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
- "dev": true,
- "requires": {
- "es-to-primitive": "^1.2.1",
- "function-bind": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.1",
- "is-callable": "^1.2.2",
- "is-negative-zero": "^2.0.0",
- "is-regex": "^1.1.1",
- "object-inspect": "^1.8.0",
- "object-keys": "^1.1.1",
- "object.assign": "^4.1.1",
- "string.prototype.trimend": "^1.0.1",
- "string.prototype.trimstart": "^1.0.1"
- }
- }
+ "call-bind": "^1.0.0",
+ "define-properties": "^1.1.3"
}
},
"string.prototype.trimstart": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.2.tgz",
- "integrity": "sha512-7F6CdBTl5zyu30BJFdzSTlSlLPwODC23Od+iLoVH8X6+3fvDPPuBVVj9iaB1GOsSTSIgVfsfm27R2FGrAPznWg==",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz",
+ "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==",
"dev": true,
"requires": {
- "define-properties": "^1.1.3",
- "es-abstract": "^1.18.0-next.1"
- },
- "dependencies": {
- "es-abstract": {
- "version": "1.18.0-next.1",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
- "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
- "dev": true,
- "requires": {
- "es-to-primitive": "^1.2.1",
- "function-bind": "^1.1.1",
- "has": "^1.0.3",
- "has-symbols": "^1.0.1",
- "is-callable": "^1.2.2",
- "is-negative-zero": "^2.0.0",
- "is-regex": "^1.1.1",
- "object-inspect": "^1.8.0",
- "object-keys": "^1.1.1",
- "object.assign": "^4.1.1",
- "string.prototype.trimend": "^1.0.1",
- "string.prototype.trimstart": "^1.0.1"
- }
- }
+ "call-bind": "^1.0.0",
+ "define-properties": "^1.1.3"
}
},
"string_decoder": {
@@ -7757,9 +7725,9 @@
}
},
"uglify-js": {
- "version": "3.11.5",
- "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.5.tgz",
- "integrity": "sha512-btvv/baMqe7HxP7zJSF7Uc16h1mSfuuSplT0/qdjxseesDU+yYzH33eHBH+eMdeRXwujXspaCTooWHQVVBh09w==",
+ "version": "3.12.1",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.12.1.tgz",
+ "integrity": "sha512-o8lHP20KjIiQe5b/67Rh68xEGRrc2SRsCuuoYclXXoC74AfSRGblU1HKzJWH3HxPZ+Ort85fWHpSX7KwBUC9CQ==",
"dev": true,
"optional": true
},
@@ -8136,9 +8104,9 @@
"dev": true
},
"y18n": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
- "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
+ "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==",
"dev": true
},
"yallist": {
diff --git a/packages/adapter-commons/CHANGELOG.md b/packages/adapter-commons/CHANGELOG.md
new file mode 100644
index 0000000000..cc44f5b2a6
--- /dev/null
+++ b/packages/adapter-commons/CHANGELOG.md
@@ -0,0 +1,449 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [4.5.11](https://github.com/feathersjs/databases/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+## [4.5.7](https://github.com/feathersjs/databases/compare/@feathersjs/adapter-commons@4.5.6...@feathersjs/adapter-commons@4.5.7) (2020-10-21)
+
+
+### Bug Fixes
+
+* **typescript:** Remove remaining overloads ([a29fabc](https://github.com/feathersjs/databases/commit/a29fabc9cf6050793a5e93948507ce3e19a235dd))
+
+
+
+
+
+## [4.5.6](https://github.com/feathersjs/databases/compare/@feathersjs/adapter-commons@4.5.5...@feathersjs/adapter-commons@4.5.6) (2020-10-21)
+
+
+### Bug Fixes
+
+* Revert "fix(adapter-commons): Add missing overloads ([#4](https://github.com/feathersjs/databases/issues/4))" ([dfaa850](https://github.com/feathersjs/databases/commit/dfaa8500644021f78d6234a79358f1b26ce2c8d3))
+
+
+
+
+
+## [4.5.5](https://github.com/feathersjs/databases/compare/@feathersjs/adapter-commons@4.5.4...@feathersjs/adapter-commons@4.5.5) (2020-10-21)
+
+
+### Bug Fixes
+
+* **typescript:** Revert "fix: add overloads for `find` ([#9](https://github.com/feathersjs/databases/issues/9))" ([85c20b2](https://github.com/feathersjs/databases/commit/85c20b267e67192169ded97dd5056f116a5ad7b5))
+
+
+
+
+
+## [4.5.4](https://github.com/feathersjs/databases/compare/@feathersjs/adapter-commons@4.5.3...@feathersjs/adapter-commons@4.5.4) (2020-09-27)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+## 4.5.3 (2020-09-24)
+
+
+### Bug Fixes
+
+* add overloads for `find` ([#9](https://github.com/feathersjs/databases/issues/9)) ([87c7c29](https://github.com/feathersjs/databases/commit/87c7c29ef017b3cae135e7b7597a7e63fb7d0961))
+* **adapter-commons:** Add missing overloads ([#4](https://github.com/feathersjs/databases/issues/4)) ([b6c80ff](https://github.com/feathersjs/databases/commit/b6c80ff39a32c1b023178f06cffbcaa6d08c554d))
+* Improve Service typings for DB Common API ([#1](https://github.com/feathersjs/databases/issues/1)) ([fd3b949](https://github.com/feathersjs/databases/commit/fd3b9496b0a46f8fd9779c2603faeeb92bd1afc1))
+
+
+
+
+
+## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+# [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06)
+
+
+### Bug Fixes
+
+* **adapter-commons:** Filter arrays in queries ([#1724](https://github.com/feathersjs/feathers/issues/1724)) ([872b669](https://github.com/feathersjs/feathers/commit/872b66906a806ab92ca41b5f6f504ff0af1ce79e))
+
+
+
+
+
+## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+# [4.4.0](https://github.com/feathersjs/feathers/compare/v4.3.11...v4.4.0) (2019-11-27)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+## [4.3.11](https://github.com/feathersjs/feathers/compare/v4.3.10...v4.3.11) (2019-11-11)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+## [4.3.10](https://github.com/feathersjs/feathers/compare/v4.3.9...v4.3.10) (2019-10-26)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+## [4.3.9](https://github.com/feathersjs/feathers/compare/v4.3.8...v4.3.9) (2019-10-26)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+## [4.3.8](https://github.com/feathersjs/feathers/compare/v4.3.7...v4.3.8) (2019-10-14)
+
+
+### Bug Fixes
+
+* Remove adapter commons type alternatives ([#1620](https://github.com/feathersjs/feathers/issues/1620)) ([c9f3086](https://github.com/feathersjs/feathers/commit/c9f3086344420b57dbce7c4169cf550c97509f0d))
+
+
+
+
+
+## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14)
+
+
+### Bug Fixes
+
+* improve Service and AdapterService types ([#1567](https://github.com/feathersjs/feathers/issues/1567)) ([baad6a2](https://github.com/feathersjs/feathers/commit/baad6a26f0f543b712ccb40359b3933ad3a21392))
+
+
+
+
+
+## [4.3.6](https://github.com/feathersjs/feathers/compare/v4.3.5...v4.3.6) (2019-10-07)
+
+
+### Bug Fixes
+
+* Check query for NaN ([#1607](https://github.com/feathersjs/feathers/issues/1607)) ([f1a781f](https://github.com/feathersjs/feathers/commit/f1a781f))
+
+
+
+
+
+## [4.3.4](https://github.com/feathersjs/feathers/compare/v4.3.3...v4.3.4) (2019-10-03)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+## [4.3.3](https://github.com/feathersjs/feathers/compare/v4.3.2...v4.3.3) (2019-09-21)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+## [4.3.2](https://github.com/feathersjs/feathers/compare/v4.3.1...v4.3.2) (2019-09-16)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+## [4.3.1](https://github.com/feathersjs/feathers/compare/v4.3.0...v4.3.1) (2019-09-09)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+# [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+# [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19)
+
+
+### Bug Fixes
+
+* Update all dependencies ([7d53a00](https://github.com/feathersjs/feathers/commit/7d53a00))
+
+
+
+
+
+# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02)
+
+
+### Bug Fixes
+
+* @feathersjs/adapter-commons: `update` id is non-nullable ([#1468](https://github.com/feathersjs/feathers/issues/1468)) ([43ec802](https://github.com/feathersjs/feathers/commit/43ec802))
+
+
+
+
+
+# [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+# [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05)
+
+
+### Bug Fixes
+
+* @feathersjs/adapter-commons: remove data from `remove` arguments ([#1426](https://github.com/feathersjs/feathers/issues/1426)) ([fd54ae9](https://github.com/feathersjs/feathers/commit/fd54ae9))
+
+
+### Features
+
+* adapter-commons: add `allowsMulti(method)` to AdapterService ([#1431](https://github.com/feathersjs/feathers/issues/1431)) ([e688851](https://github.com/feathersjs/feathers/commit/e688851))
+* Add hook-less methods and service option types to adapter-commons ([#1433](https://github.com/feathersjs/feathers/issues/1433)) ([857f54a](https://github.com/feathersjs/feathers/commit/857f54a))
+
+
+
+
+
+# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01)
+
+
+### Bug Fixes
+
+* Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f))
+
+
+
+
+
+# [4.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.1...v4.0.0-pre.2) (2019-05-15)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+# [4.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.0...v4.0.0-pre.1) (2019-05-08)
+
+**Note:** Version bump only for package @feathersjs/adapter-commons
+
+
+
+
+
+# [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21)
+
+
+### Bug Fixes
+
+* Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6))
+* **adapter-commons:** Keep Symbols when filtering a query ([#1141](https://github.com/feathersjs/feathers/issues/1141)) ([c9f55d8](https://github.com/feathersjs/feathers/commit/c9f55d8))
+* **chore:** Add .npmignore to adapter-commons ([8e129d8](https://github.com/feathersjs/feathers/commit/8e129d8))
+* Add whitelist and filter support to common adapter service ([#1132](https://github.com/feathersjs/feathers/issues/1132)) ([df1daaa](https://github.com/feathersjs/feathers/commit/df1daaa))
+* Fix AdapterService multi option when set to true ([#1134](https://github.com/feathersjs/feathers/issues/1134)) ([40402fc](https://github.com/feathersjs/feathers/commit/40402fc))
+* Throw error in `filterQuery` when query parameter is unknown ([#1131](https://github.com/feathersjs/feathers/issues/1131)) ([cd1a183](https://github.com/feathersjs/feathers/commit/cd1a183))
+* Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda))
+* Update adapter common tests to check for falsy ([#1140](https://github.com/feathersjs/feathers/issues/1140)) ([2856722](https://github.com/feathersjs/feathers/commit/2856722))
+
+
+### chore
+
+* **package:** Move adapter tests into their own module ([#1164](https://github.com/feathersjs/feathers/issues/1164)) ([dcc1e6b](https://github.com/feathersjs/feathers/commit/dcc1e6b))
+
+
+### Features
+
+* Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713))
+* Authentication v3 core server implementation ([#1205](https://github.com/feathersjs/feathers/issues/1205)) ([1bd7591](https://github.com/feathersjs/feathers/commit/1bd7591))
+* Common database adapter utilities and test suite ([#1130](https://github.com/feathersjs/feathers/issues/1130)) ([17b3dc8](https://github.com/feathersjs/feathers/commit/17b3dc8))
+
+
+### BREAKING CHANGES
+
+* **package:** Removes adapter tests from @feathersjs/adapter-commons
+* Move database adapter utilities from @feathersjs/commons into its own module
+
+
+
+
+
+# [2.0.0](https://github.com/feathersjs/feathers/compare/@feathersjs/adapter-commons@1.0.7...@feathersjs/adapter-commons@2.0.0) (2019-01-10)
+
+
+### chore
+
+* **package:** Move adapter tests into their own module ([#1164](https://github.com/feathersjs/feathers/issues/1164)) ([dcc1e6b](https://github.com/feathersjs/feathers/commit/dcc1e6b))
+
+
+### BREAKING CHANGES
+
+* **package:** Removes adapter tests from @feathersjs/adapter-commons
+
+
+
+
+
+## [1.0.7](https://github.com/feathersjs/feathers/compare/@feathersjs/adapter-commons@1.0.6...@feathersjs/adapter-commons@1.0.7) (2019-01-02)
+
+
+### Bug Fixes
+
+* **chore:** Add .npmignore to adapter-commons ([8e129d8](https://github.com/feathersjs/feathers/commit/8e129d8))
+
+
+
+
+
+## [1.0.6](https://github.com/feathersjs/feathers/compare/@feathersjs/adapter-commons@1.0.5...@feathersjs/adapter-commons@1.0.6) (2018-12-21)
+
+
+### Bug Fixes
+
+* **adapter-commons:** Keep Symbols when filtering a query ([#1141](https://github.com/feathersjs/feathers/issues/1141)) ([c9f55d8](https://github.com/feathersjs/feathers/commit/c9f55d8))
+
+
+
+
+
+## [1.0.5](https://github.com/feathersjs/feathers/compare/@feathersjs/adapter-commons@1.0.4...@feathersjs/adapter-commons@1.0.5) (2018-12-20)
+
+
+### Bug Fixes
+
+* Update adapter common tests to check for falsy ([#1140](https://github.com/feathersjs/feathers/issues/1140)) ([2856722](https://github.com/feathersjs/feathers/commit/2856722))
+
+
+
+
+
+## [1.0.4](https://github.com/feathersjs/feathers/compare/@feathersjs/adapter-commons@1.0.3...@feathersjs/adapter-commons@1.0.4) (2018-12-17)
+
+
+### Bug Fixes
+
+* Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda))
+
+
+
+
+
+
+## [1.0.3](https://github.com/feathersjs/feathers/compare/@feathersjs/adapter-commons@1.0.2...@feathersjs/adapter-commons@1.0.3) (2018-12-17)
+
+
+### Bug Fixes
+
+* Fix AdapterService multi option when set to true ([#1134](https://github.com/feathersjs/feathers/issues/1134)) ([40402fc](https://github.com/feathersjs/feathers/commit/40402fc))
+
+
+
+
+
+
+## [1.0.2](https://github.com/feathersjs/feathers/compare/@feathersjs/adapter-commons@1.0.1...@feathersjs/adapter-commons@1.0.2) (2018-12-17)
+
+
+### Bug Fixes
+
+* Add whitelist and filter support to common adapter service ([#1132](https://github.com/feathersjs/feathers/issues/1132)) ([df1daaa](https://github.com/feathersjs/feathers/commit/df1daaa))
+
+
+
+
+
+
+## [1.0.1](https://github.com/feathersjs/feathers/compare/@feathersjs/adapter-commons@1.0.0...@feathersjs/adapter-commons@1.0.1) (2018-12-17)
+
+
+### Bug Fixes
+
+* Throw error in `filterQuery` when query parameter is unknown ([#1131](https://github.com/feathersjs/feathers/issues/1131)) ([cd1a183](https://github.com/feathersjs/feathers/commit/cd1a183))
+
+
+
+
+
+
+# 1.0.0 (2018-12-16)
+
+
+### Features
+
+* Common database adapter utilities and test suite ([#1130](https://github.com/feathersjs/feathers/issues/1130)) ([17b3dc8](https://github.com/feathersjs/feathers/commit/17b3dc8))
+
+
+### BREAKING CHANGES
+
+* Move database adapter utilities from @feathersjs/commons into its own module
diff --git a/packages/adapter-commons/LICENSE b/packages/adapter-commons/LICENSE
new file mode 100644
index 0000000000..7139cac0dd
--- /dev/null
+++ b/packages/adapter-commons/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2020 Feathers
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/packages/adapter-commons/README.md b/packages/adapter-commons/README.md
new file mode 100644
index 0000000000..868f063778
--- /dev/null
+++ b/packages/adapter-commons/README.md
@@ -0,0 +1,22 @@
+# Feathers Adapter Commons
+
+[](https://github.com/feathersjs/feathers/actions?query=workflow%3A%22Node.js+CI%22)
+[](https://david-dm.org/feathersjs/feathers?path=packages/adapter-commons)
+[](https://www.npmjs.com/package/@feathersjs/adapter-commons)
+
+> Shared utility functions for Feathers adatabase adapters
+
+## About
+
+This is a repository for handling Feathers common database syntax. See the [API documentation](https://docs.feathersjs.com/api/databases/common.html) for more information.
+
+
+## Authors
+
+[Feathers contributors](https://github.com/feathersjs/adapter-commons/graphs/contributors)
+
+## License
+
+Copyright (c) 2019 Feathers contributors
+
+Licensed under the [MIT license](LICENSE).
diff --git a/packages/adapter-commons/package.json b/packages/adapter-commons/package.json
new file mode 100644
index 0000000000..28d594f53a
--- /dev/null
+++ b/packages/adapter-commons/package.json
@@ -0,0 +1,66 @@
+{
+ "name": "@feathersjs/adapter-commons",
+ "version": "4.5.11",
+ "description": "Shared database adapter utility functions",
+ "homepage": "https://feathersjs.com",
+ "keywords": [
+ "feathers"
+ ],
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/feathers"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/feathersjs/databases.git"
+ },
+ "author": {
+ "name": "Feathers contributor",
+ "email": "hello@feathersjs.com",
+ "url": "https://feathersjs.com"
+ },
+ "contributors": [],
+ "bugs": {
+ "url": "https://github.com/feathersjs/databases/issues"
+ },
+ "engines": {
+ "node": ">= 10"
+ },
+ "main": "lib/",
+ "types": "lib/",
+ "scripts": {
+ "prepublish": "npm run compile",
+ "compile": "shx rm -rf lib/ && tsc",
+ "test": "mocha --config ../../.mocharc.ts.json --recursive test/**.test.ts test/**/*.test.ts"
+ },
+ "directories": {
+ "lib": "lib"
+ },
+ "files": [
+ "CHANGELOG.md",
+ "LICENSE",
+ "README.md",
+ "src/**",
+ "lib/**"
+ ],
+ "publishConfig": {
+ "access": "public"
+ },
+ "dependencies": {
+ "@feathersjs/commons": "^4.5.11",
+ "@feathersjs/errors": "^4.5.11",
+ "@feathersjs/feathers": "^4.5.11"
+ },
+ "devDependencies": {
+ "@types/mocha": "^8.0.4",
+ "@types/mongodb": "^3.6.1",
+ "@types/node": "^14.14.10",
+ "mocha": "^8.2.1",
+ "mongodb": "^3.6.3",
+ "shx": "^0.3.3",
+ "ts-node": "^9.1.0",
+ "typescript": "^4.1.2"
+ },
+ "gitHead": "9b9f0f13387341bdd320f1e66feda828fca2c9f2"
+}
diff --git a/packages/adapter-commons/src/filter-query.ts b/packages/adapter-commons/src/filter-query.ts
new file mode 100644
index 0000000000..a4588f2bdb
--- /dev/null
+++ b/packages/adapter-commons/src/filter-query.ts
@@ -0,0 +1,119 @@
+import { _ } from '@feathersjs/commons';
+import { BadRequest } from '@feathersjs/errors';
+
+function parse (number: any) {
+ if (typeof number !== 'undefined') {
+ return Math.abs(parseInt(number, 10));
+ }
+
+ return undefined;
+}
+
+// Returns the pagination limit and will take into account the
+// default and max pagination settings
+function getLimit (limit: any, paginate: any) {
+ if (paginate && paginate.default) {
+ const lower = typeof limit === 'number' && !isNaN(limit) ? limit : paginate.default;
+ const upper = typeof paginate.max === 'number' ? paginate.max : Number.MAX_VALUE;
+
+ return Math.min(lower, upper);
+ }
+
+ return limit;
+}
+
+// Makes sure that $sort order is always converted to an actual number
+function convertSort (sort: any) {
+ if (typeof sort !== 'object' || Array.isArray(sort)) {
+ return sort;
+ }
+
+ return Object.keys(sort).reduce((result, key) => {
+ result[key] = typeof sort[key] === 'object'
+ ? sort[key] : parseInt(sort[key], 10);
+
+ return result;
+ }, {} as { [key: string]: number });
+}
+
+function cleanQuery (query: any, operators: any, filters: any): any {
+ if (Array.isArray(query)) {
+ return query.map(value => cleanQuery(value, operators, filters));
+ } else if (_.isObject(query) && query.constructor === {}.constructor) {
+ const result: { [key: string]: any } = {};
+
+ _.each(query, (value, key) => {
+ if (key[0] === '$') {
+ if (filters[key] !== undefined) {
+ return;
+ }
+
+ if (!operators.includes(key)) {
+ throw new BadRequest(`Invalid query parameter ${key}`, query);
+ }
+ }
+
+ result[key] = cleanQuery(value, operators, filters);
+ });
+
+ Object.getOwnPropertySymbols(query).forEach(symbol => {
+ // @ts-ignore
+ result[symbol] = query[symbol];
+ });
+
+ return result;
+ }
+
+ return query;
+}
+
+function assignFilters (object: any, query: any, filters: any, options: any) {
+ if (Array.isArray(filters)) {
+ _.each(filters, (key) => {
+ if (query[key] !== undefined) {
+ object[key] = query[key];
+ }
+ });
+ } else {
+ _.each(filters, (converter, key) => {
+ const converted = converter(query[key], options);
+
+ if (converted !== undefined) {
+ object[key] = converted;
+ }
+ });
+ }
+
+ return object;
+}
+
+export const FILTERS = {
+ $sort: (value: any) => convertSort(value),
+ $limit: (value: any, options: any) => getLimit(parse(value), options.paginate),
+ $skip: (value: any) => parse(value),
+ $select: (value: any) => value
+};
+
+export const OPERATORS = ['$in', '$nin', '$lt', '$lte', '$gt', '$gte', '$ne', '$or'];
+
+// Converts Feathers special query parameters and pagination settings
+// and returns them separately a `filters` and the rest of the query
+// as `query`
+export default function filterQuery (query: any, options: any = {}) {
+ const {
+ filters: additionalFilters = {},
+ operators: additionalOperators = []
+ } = options;
+ const result: { [key: string]: any } = {};
+
+ result.filters = assignFilters({}, query, FILTERS, options);
+ result.filters = assignFilters(result.filters, query, additionalFilters, options);
+
+ result.query = cleanQuery(query, OPERATORS.concat(additionalOperators), result.filters);
+
+ return result;
+}
+
+if (typeof module !== 'undefined') {
+ module.exports = Object.assign(filterQuery, module.exports);
+}
diff --git a/packages/adapter-commons/src/index.ts b/packages/adapter-commons/src/index.ts
new file mode 100644
index 0000000000..d5ad7d0399
--- /dev/null
+++ b/packages/adapter-commons/src/index.ts
@@ -0,0 +1,32 @@
+import { _ } from '@feathersjs/commons';
+
+export { AdapterService, InternalServiceMethods, ServiceOptions } from './service';
+export { default as filterQuery, FILTERS, OPERATORS } from './filter-query';
+export * from './sort';
+
+// Return a function that filters a result object or array
+// and picks only the fields passed as `params.query.$select`
+// and additional `otherFields`
+export function select (params: any, ...otherFields: any[]) {
+ const fields = params && params.query && params.query.$select;
+
+ if (Array.isArray(fields) && otherFields.length) {
+ fields.push(...otherFields);
+ }
+
+ const convert = (result: any) => {
+ if (!Array.isArray(fields)) {
+ return result;
+ }
+
+ return _.pick(result, ...fields);
+ };
+
+ return (result: any) => {
+ if (Array.isArray(result)) {
+ return result.map(convert);
+ }
+
+ return convert(result);
+ };
+}
diff --git a/packages/adapter-commons/src/service.ts b/packages/adapter-commons/src/service.ts
new file mode 100644
index 0000000000..bc004ceef1
--- /dev/null
+++ b/packages/adapter-commons/src/service.ts
@@ -0,0 +1,200 @@
+import { NotImplemented, BadRequest, MethodNotAllowed } from '@feathersjs/errors';
+import { ServiceMethods, Params, Paginated, Id, NullableId } from '@feathersjs/feathers';
+import filterQuery from './filter-query';
+
+const callMethod = (self: any, name: any, ...args: any[]) => {
+ if (typeof self[name] !== 'function') {
+ return Promise.reject(new NotImplemented(`Method ${name} not available`));
+ }
+
+ return self[name](...args);
+};
+
+const alwaysMulti: { [key: string]: boolean } = {
+ find: true,
+ get: false,
+ update: false
+};
+
+export interface ServiceOptions {
+ events: string[];
+ multi: boolean|string[];
+ id: string;
+ paginate: {
+ default?: number;
+ max?: number;
+ }
+ whitelist: string[];
+ filters: string[];
+}
+
+/**
+ * Hook-less (internal) service methods. Directly call database adapter service methods
+ * without running any service-level hooks. This can be useful if you need the raw data
+ * from the service and don't want to trigger any of its hooks.
+ *
+ * Important: These methods are only available internally on the server, not on the client
+ * side and only for the Feathers database adapters.
+ *
+ * These methods do not trigger events.
+ *
+ * @see {@link https://docs.feathersjs.com/guides/migrating.html#hook-less-service-methods}
+ */
+export interface InternalServiceMethods {
+
+ /**
+ * Retrieve all resources from this service, skipping any service-level hooks.
+ *
+ * @param params - Service call parameters {@link Params}
+ * @see {@link HookLessServiceMethods}
+ * @see {@link https://docs.feathersjs.com/api/services.html#find-params|Feathers API Documentation: .find(params)}
+ */
+ _find (params?: Params): Promise>;
+
+ /**
+ * Retrieve a single resource matching the given ID, skipping any service-level hooks.
+ *
+ * @param id - ID of the resource to locate
+ * @param params - Service call parameters {@link Params}
+ * @see {@link HookLessServiceMethods}
+ * @see {@link https://docs.feathersjs.com/api/services.html#get-id-params|Feathers API Documentation: .get(id, params)}
+ */
+ _get (id: Id, params?: Params): Promise;
+
+ /**
+ * Create a new resource for this service, skipping any service-level hooks.
+ *
+ * @param data - Data to insert into this service.
+ * @param params - Service call parameters {@link Params}
+ * @see {@link HookLessServiceMethods}
+ * @see {@link https://docs.feathersjs.com/api/services.html#create-data-params|Feathers API Documentation: .create(data, params)}
+ */
+ _create (data: Partial | Partial[], params?: Params): Promise;
+
+ /**
+ * Replace any resources matching the given ID with the given data, skipping any service-level hooks.
+ *
+ * @param id - ID of the resource to be updated
+ * @param data - Data to be put in place of the current resource.
+ * @param params - Service call parameters {@link Params}
+ * @see {@link HookLessServiceMethods}
+ * @see {@link https://docs.feathersjs.com/api/services.html#update-id-data-params|Feathers API Documentation: .update(id, data, params)}
+ */
+ _update (id: Id, data: T, params?: Params): Promise;
+
+ /**
+ * Merge any resources matching the given ID with the given data, skipping any service-level hooks.
+ *
+ * @param id - ID of the resource to be patched
+ * @param data - Data to merge with the current resource.
+ * @param params - Service call parameters {@link Params}
+ * @see {@link HookLessServiceMethods}
+ * @see {@link https://docs.feathersjs.com/api/services.html#patch-id-data-params|Feathers API Documentation: .patch(id, data, params)}
+ */
+ _patch (id: NullableId, data: Partial, params?: Params): Promise;
+
+ /**
+ * Remove resources matching the given ID from the this service, skipping any service-level hooks.
+ *
+ * @param id - ID of the resource to be removed
+ * @param params - Service call parameters {@link Params}
+ * @see {@link HookLessServiceMethods}
+ * @see {@link https://docs.feathersjs.com/api/services.html#remove-id-params|Feathers API Documentation: .remove(id, params)}
+ */
+ _remove (id: NullableId, params?: Params): Promise;
+}
+
+export class AdapterService implements ServiceMethods {
+ options: ServiceOptions;
+
+ constructor (options: Partial) {
+ this.options = Object.assign({
+ id: 'id',
+ events: [],
+ paginate: {},
+ multi: false,
+ filters: [],
+ whitelist: []
+ }, options);
+ }
+
+ get id () {
+ return this.options.id;
+ }
+
+ get events () {
+ return this.options.events;
+ }
+
+ filterQuery (params: Params = {}, opts: any = {}) {
+ const paginate = typeof params.paginate !== 'undefined'
+ ? params.paginate : this.options.paginate;
+ const { query = {} } = params;
+ const options = Object.assign({
+ operators: this.options.whitelist || [],
+ filters: this.options.filters,
+ paginate
+ }, opts);
+ const result = filterQuery(query, options);
+
+ return Object.assign(result, { paginate });
+ }
+
+ allowsMulti (method: string) {
+ const always = alwaysMulti[method];
+
+ if (typeof always !== 'undefined') {
+ return always;
+ }
+
+ const option = this.options.multi;
+
+ if (option === true || option === false) {
+ return option;
+ } else {
+ return option.includes(method);
+ }
+ }
+
+ find (params?: Params): Promise> {
+ return callMethod(this, '_find', params);
+ }
+
+ get (id: Id, params?: Params): Promise {
+ return callMethod(this, '_get', id, params);
+ }
+
+ create (data: Partial | Partial[], params?: Params): Promise {
+ if (Array.isArray(data) && !this.allowsMulti('create')) {
+ return Promise.reject(new MethodNotAllowed(`Can not create multiple entries`));
+ }
+
+ return callMethod(this, '_create', data, params);
+ }
+
+ update (id: Id, data: T, params?: Params): Promise {
+ if (id === null || Array.isArray(data)) {
+ return Promise.reject(new BadRequest(
+ `You can not replace multiple instances. Did you mean 'patch'?`
+ ));
+ }
+
+ return callMethod(this, '_update', id, data, params);
+ }
+
+ patch (id: NullableId, data: Partial, params?: Params): Promise {
+ if (id === null && !this.allowsMulti('patch')) {
+ return Promise.reject(new MethodNotAllowed(`Can not patch multiple entries`));
+ }
+
+ return callMethod(this, '_patch', id, data, params);
+ }
+
+ remove (id: NullableId, params?: Params): Promise {
+ if (id === null && !this.allowsMulti('remove')) {
+ return Promise.reject(new MethodNotAllowed(`Can not remove multiple entries`));
+ }
+
+ return callMethod(this, '_remove', id, params);
+ }
+}
diff --git a/packages/adapter-commons/src/sort.ts b/packages/adapter-commons/src/sort.ts
new file mode 100644
index 0000000000..5803a000c3
--- /dev/null
+++ b/packages/adapter-commons/src/sort.ts
@@ -0,0 +1,91 @@
+// Sorting algorithm taken from NeDB (https://github.com/louischatriot/nedb)
+// See https://github.com/louischatriot/nedb/blob/e3f0078499aa1005a59d0c2372e425ab789145c1/lib/model.js#L189
+
+export function compareNSB (a: any, b: any) {
+ if (a < b) { return -1; }
+ if (a > b) { return 1; }
+ return 0;
+}
+
+export function compareArrays (a: any, b: any) {
+ let i;
+ let comp;
+
+ for (i = 0; i < Math.min(a.length, b.length); i += 1) {
+ comp = exports.compare(a[i], b[i]);
+
+ if (comp !== 0) { return comp; }
+ }
+
+ // Common section was identical, longest one wins
+ return exports.compareNSB(a.length, b.length);
+}
+
+export function compare (a: any, b: any, compareStrings: any = exports.compareNSB) {
+ const { compareNSB, compare, compareArrays } = exports;
+
+ // undefined
+ if (a === undefined) { return b === undefined ? 0 : -1; }
+ if (b === undefined) { return a === undefined ? 0 : 1; }
+
+ // null
+ if (a === null) { return b === null ? 0 : -1; }
+ if (b === null) { return a === null ? 0 : 1; }
+
+ // Numbers
+ if (typeof a === 'number') { return typeof b === 'number' ? compareNSB(a, b) : -1; }
+ if (typeof b === 'number') { return typeof a === 'number' ? compareNSB(a, b) : 1; }
+
+ // Strings
+ if (typeof a === 'string') { return typeof b === 'string' ? compareStrings(a, b) : -1; }
+ if (typeof b === 'string') { return typeof a === 'string' ? compareStrings(a, b) : 1; }
+
+ // Booleans
+ if (typeof a === 'boolean') { return typeof b === 'boolean' ? compareNSB(a, b) : -1; }
+ if (typeof b === 'boolean') { return typeof a === 'boolean' ? compareNSB(a, b) : 1; }
+
+ // Dates
+ if (a instanceof Date) { return b instanceof Date ? compareNSB(a.getTime(), b.getTime()) : -1; }
+ if (b instanceof Date) { return a instanceof Date ? compareNSB(a.getTime(), b.getTime()) : 1; }
+
+ // Arrays (first element is most significant and so on)
+ if (Array.isArray(a)) { return Array.isArray(b) ? compareArrays(a, b) : -1; }
+ if (Array.isArray(b)) { return Array.isArray(a) ? compareArrays(a, b) : 1; }
+
+ // Objects
+ const aKeys = Object.keys(a).sort();
+ const bKeys = Object.keys(b).sort();
+ let comp = 0;
+
+ for (let i = 0; i < Math.min(aKeys.length, bKeys.length); i += 1) {
+ comp = compare(a[aKeys[i]], b[bKeys[i]]);
+
+ if (comp !== 0) { return comp; }
+ }
+
+ return compareNSB(aKeys.length, bKeys.length);
+}
+
+// An in-memory sorting function according to the
+// $sort special query parameter
+export function sorter ($sort: any) {
+ const criteria = Object.keys($sort).map(key => {
+ const direction = $sort[key];
+
+ return { key, direction };
+ });
+
+ return function (a: any, b: any) {
+ let compare;
+
+ for (const criterion of criteria) {
+ compare = criterion.direction * exports.compare(a[criterion.key], b[criterion.key]);
+
+ if (compare !== 0) {
+ return compare;
+ }
+ }
+
+ return 0;
+ };
+}
diff --git a/packages/adapter-commons/test/commons.test.ts b/packages/adapter-commons/test/commons.test.ts
new file mode 100644
index 0000000000..8a74671e07
--- /dev/null
+++ b/packages/adapter-commons/test/commons.test.ts
@@ -0,0 +1,72 @@
+import assert from 'assert';
+import { select } from '../src';
+
+describe('@feathersjs/adapter-commons', () => {
+ describe('select', () => {
+ it('select', () => {
+ const selector = select({
+ query: { $select: ['name', 'age'] }
+ });
+
+ return Promise.resolve({
+ name: 'David',
+ age: 3,
+ test: 'me'
+ }).then(selector).then(result => assert.deepStrictEqual(result, {
+ name: 'David',
+ age: 3
+ }));
+ });
+
+ it('select with arrays', () => {
+ const selector = select({
+ query: { $select: ['name', 'age'] }
+ });
+
+ return Promise.resolve([{
+ name: 'David',
+ age: 3,
+ test: 'me'
+ }, {
+ name: 'D',
+ age: 4,
+ test: 'you'
+ }]).then(selector).then(result => assert.deepStrictEqual(result, [{
+ name: 'David',
+ age: 3
+ }, {
+ name: 'D',
+ age: 4
+ }]));
+ });
+
+ it('select with no query', () => {
+ const selector = select({});
+ const data = {
+ name: 'David'
+ };
+
+ return Promise.resolve(data).then(selector).then(result =>
+ assert.deepStrictEqual(result, data)
+ );
+ });
+
+ it('select with other fields', () => {
+ const selector = select({
+ query: { $select: [ 'name' ] }
+ }, 'id');
+ const data = {
+ id: 'me',
+ name: 'David',
+ age: 10
+ };
+
+ return Promise.resolve(data)
+ .then(selector)
+ .then(result => assert.deepStrictEqual(result, {
+ id: 'me',
+ name: 'David'
+ }));
+ });
+ });
+});
diff --git a/packages/adapter-commons/test/filter-query.test.ts b/packages/adapter-commons/test/filter-query.test.ts
new file mode 100644
index 0000000000..6695bcc3a0
--- /dev/null
+++ b/packages/adapter-commons/test/filter-query.test.ts
@@ -0,0 +1,258 @@
+import assert from 'assert';
+import { ObjectId } from 'mongodb';
+import { filterQuery } from '../src';
+
+describe('@feathersjs/adapter-commons/filterQuery', () => {
+ describe('$sort', () => {
+ it('returns $sort when present in query', () => {
+ const originalQuery = { $sort: { name: 1 } };
+ const { filters, query } = filterQuery(originalQuery);
+
+ assert.strictEqual(filters.$sort.name, 1);
+ assert.deepStrictEqual(query, {});
+ assert.deepStrictEqual(originalQuery, {
+ $sort: { name: 1 }
+ }, 'does not modify original query');
+ });
+
+ it('returns $sort when present in query as an object', () => {
+ const { filters, query } = filterQuery({ $sort: { name: { something: 10 } } });
+
+ assert.strictEqual(filters.$sort.name.something, 10);
+ assert.deepStrictEqual(query, {});
+ });
+
+ it('converts strings in $sort', () => {
+ const { filters, query } = filterQuery({ $sort: { test: '-1' } });
+
+ assert.strictEqual(filters.$sort.test, -1);
+ assert.deepStrictEqual(query, {});
+ });
+
+ it('does not convert $sort arrays', () => {
+ const $sort = [ [ 'test', '-1' ], [ 'a', '1' ] ];
+ const { filters, query } = filterQuery({ $sort });
+
+ assert.strictEqual(filters.$sort, $sort);
+ assert.deepStrictEqual(query, {});
+ });
+
+ it('throws an error when special parameter is not known', () => {
+ try {
+ const query = { $foo: 1 };
+ filterQuery(query);
+ assert.ok(false, 'Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'BadRequest');
+ assert.strictEqual(error.message, 'Invalid query parameter $foo');
+ }
+ });
+
+ it('returns undefined when not present in query', () => {
+ const query = { foo: 1 };
+ const { filters } = filterQuery(query);
+
+ assert.strictEqual(filters.$sort, undefined);
+ });
+ });
+
+ describe('$limit', () => {
+ let testQuery: any;
+
+ beforeEach(() => {
+ testQuery = { $limit: 1 };
+ });
+
+ it('returns $limit when present in query', () => {
+ const { filters, query } = filterQuery(testQuery);
+
+ assert.strictEqual(filters.$limit, 1);
+ assert.deepStrictEqual(query, {});
+ });
+
+ it('returns undefined when not present in query', () => {
+ const query = { foo: 1 };
+ const { filters } = filterQuery(query);
+
+ assert.strictEqual(filters.$limit, undefined);
+ });
+
+ it('removes $limit from query when present', () => {
+ assert.deepStrictEqual(filterQuery(testQuery).query, {});
+ });
+
+ it('parses $limit strings into integers (#4)', () => {
+ const { filters } = filterQuery({ $limit: '2' });
+
+ assert.strictEqual(filters.$limit, 2);
+ });
+
+ it('allows $limit 0', () => {
+ const { filters } = filterQuery({ $limit: 0 }, { default: 10 });
+
+ assert.strictEqual(filters.$limit, 0);
+ });
+
+ describe('pagination', () => {
+ it('limits with default pagination', () => {
+ const { filters } = filterQuery({}, { paginate: { default: 10 } });
+
+ assert.strictEqual(filters.$limit, 10);
+ });
+
+ it('limits with max pagination', () => {
+ const { filters } = filterQuery({ $limit: 20 }, { paginate: { default: 5, max: 10 } });
+ const { filters: filtersNeg } = filterQuery({ $limit: -20 }, { paginate: { default: 5, max: 10 } });
+
+ assert.strictEqual(filters.$limit, 10);
+ assert.strictEqual(filtersNeg.$limit, 10);
+ });
+
+ it('limits with default pagination when not a number', () => {
+ const { filters } = filterQuery({ $limit: 'something' }, { paginate: { default: 5, max: 10 } });
+
+ assert.strictEqual(filters.$limit, 5);
+ });
+ });
+ });
+
+ describe('$skip', () => {
+ let testQuery: any;
+
+ beforeEach(() => {
+ testQuery = { $skip: 1 };
+ });
+
+ it('returns $skip when present in query', () => {
+ const { filters } = filterQuery(testQuery);
+
+ assert.strictEqual(filters.$skip, 1);
+ });
+
+ it('removes $skip from query when present', () => {
+ assert.deepStrictEqual(filterQuery(testQuery).query, {});
+ });
+
+ it('returns undefined when not present in query', () => {
+ const query = { foo: 1 };
+ const { filters } = filterQuery(query);
+
+ assert.strictEqual(filters.$skip, undefined);
+ });
+
+ it('parses $skip strings into integers (#4)', () => {
+ const { filters } = filterQuery({ $skip: '33' });
+
+ assert.strictEqual(filters.$skip, 33);
+ });
+ });
+
+ describe('$select', () => {
+ let testQuery: any;
+
+ beforeEach(() => {
+ testQuery = { $select: 1 };
+ });
+
+ it('returns $select when present in query', () => {
+ const { filters } = filterQuery(testQuery);
+
+ assert.strictEqual(filters.$select, 1);
+ });
+
+ it('removes $select from query when present', () => {
+ assert.deepStrictEqual(filterQuery(testQuery).query, {});
+ });
+
+ it('returns undefined when not present in query', () => {
+ const query = { foo: 1 };
+ const { filters } = filterQuery(query);
+
+ assert.strictEqual(filters.$select, undefined);
+ });
+
+ it('includes Symbols', () => {
+ const TEST = Symbol('testing');
+ const original = {
+ [TEST]: 'message',
+ other: true,
+ sub: { [TEST]: 'othermessage' }
+ };
+
+ const { query } = filterQuery(original);
+
+ assert.deepStrictEqual(query, {
+ [TEST]: 'message',
+ other: true,
+ sub: { [TEST]: 'othermessage' }
+ });
+ });
+
+ it('only converts plain objects', () => {
+ const userId = new ObjectId();
+ const original = {
+ userId
+ };
+
+ const { query } = filterQuery(original);
+
+ assert.deepStrictEqual(query, original);
+ });
+ });
+
+ describe('arrays', () => {
+ it('validates queries in arrays', () => {
+ assert.throws(() => {
+ filterQuery({
+ $or: [{ $exists: false }]
+ });
+ }, {
+ name: 'BadRequest',
+ message: 'Invalid query parameter $exists'
+ });
+ });
+ });
+
+ describe('additional filters', () => {
+ it('throw error when not set as additionals', () => {
+ try {
+ filterQuery({ $select: 1, $known: 1 });
+ assert.ok(false, 'Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.message, 'Invalid query parameter $known');
+ }
+ });
+
+ it('returns default and known additional filters (array)', () => {
+ const query = { $select: ['a', 'b'], $known: 1, $unknown: 1 };
+ const { filters } = filterQuery(query, { filters: [ '$known', '$unknown' ] });
+
+ assert.strictEqual(filters.$unknown, 1);
+ assert.strictEqual(filters.$known, 1);
+ assert.deepStrictEqual(filters.$select, [ 'a', 'b' ]);
+ });
+
+ it('returns default and known additional filters (object)', () => {
+ const { filters } = filterQuery({
+ $known: 1,
+ $select: 1
+ }, { filters: { $known: (value: any) => value.toString() } });
+
+ assert.strictEqual(filters.$unknown, undefined);
+ assert.strictEqual(filters.$known, '1');
+ assert.strictEqual(filters.$select, 1);
+ });
+ });
+
+ describe('additional operators', () => {
+ it('returns query with default and known additional operators', () => {
+ const { query } = filterQuery({
+ $ne: 1, $known: 1
+ }, { operators: [ '$known' ] });
+
+ assert.strictEqual(query.$ne, 1);
+ assert.strictEqual(query.$known, 1);
+ assert.strictEqual(query.$unknown, undefined);
+ });
+ });
+});
diff --git a/packages/adapter-commons/test/service.test.ts b/packages/adapter-commons/test/service.test.ts
new file mode 100644
index 0000000000..2831bcbaea
--- /dev/null
+++ b/packages/adapter-commons/test/service.test.ts
@@ -0,0 +1,198 @@
+import assert from 'assert';
+import { NotImplemented } from '@feathersjs/errors';
+import { AdapterService, InternalServiceMethods } from '../src';
+import { Params, Id, NullableId } from '@feathersjs/feathers';
+
+const METHODS: [ 'find', 'get', 'create', 'update', 'patch', 'remove' ] = [ 'find', 'get', 'create', 'update', 'patch', 'remove' ];
+
+describe('@feathersjs/adapter-commons/service', () => {
+ class CustomService extends AdapterService {
+ }
+
+ describe('errors when method does not exit', () => {
+ METHODS.forEach(method => {
+ it(`${method}`, () => {
+ const service = new CustomService({});
+
+ // @ts-ignore
+ return service[method]().then(() => {
+ throw new Error('Should never get here');
+ }).catch((error: Error) => {
+ assert.ok(error instanceof NotImplemented);
+ assert.strictEqual(error.message, `Method _${method} not available`);
+ });
+ });
+ });
+ });
+
+ describe('works when methods exist', () => {
+ class MethodService extends AdapterService implements InternalServiceMethods {
+ _find (_params?: Params) {
+ return Promise.resolve([]);
+ }
+
+ _get (id: Id, _params?: Params) {
+ return Promise.resolve({ id });
+ }
+
+ _create (data: Partial | Partial[], _params?: Params) {
+ return Promise.resolve(data);
+ }
+
+ _update (id: NullableId, _data: any, _params?: Params) {
+ return Promise.resolve({ id });
+ }
+
+ _patch (id: NullableId, _data: any, _params?: Params) {
+ return Promise.resolve({ id });
+ }
+
+ _remove (id: NullableId, _params?: Params) {
+ return Promise.resolve({ id });
+ }
+ }
+
+ METHODS.forEach(method => {
+ it(`${method}`, () => {
+ const service = new MethodService({});
+ const args = [];
+
+ if (method !== 'find') {
+ args.push('test');
+ }
+
+ if (method === 'update' || method === 'patch') {
+ args.push({});
+ }
+
+ // @ts-ignore
+ return service[method](...args);
+ });
+ });
+
+ it('does not allow multi patch', () => {
+ const service = new MethodService({});
+
+ return service.patch(null, {})
+ .then(() => assert.ok(false))
+ .catch(error => {
+ assert.strictEqual(error.name, 'MethodNotAllowed');
+ assert.strictEqual(error.message, 'Can not patch multiple entries');
+ });
+ });
+
+ it('does not allow multi remove', () => {
+ const service = new MethodService({});
+
+ return service.remove(null, {})
+ .then(() => assert.ok(false))
+ .catch(error => {
+ assert.strictEqual(error.name, 'MethodNotAllowed');
+ assert.strictEqual(error.message, 'Can not remove multiple entries');
+ });
+ });
+
+ it('does not allow multi create', () => {
+ const service = new MethodService({});
+
+ return service.create([])
+ .then(() => assert.ok(false))
+ .catch(error => {
+ assert.strictEqual(error.name, 'MethodNotAllowed');
+ assert.strictEqual(error.message, 'Can not create multiple entries');
+ });
+ });
+
+ it('multi can be set to true', () => {
+ const service = new MethodService({});
+
+ service.options.multi = true;
+
+ return service.create([])
+ .then(() => assert.ok(true));
+ });
+ });
+
+ it('filterQuery', () => {
+ const service = new CustomService({
+ whitelist: [ '$something' ]
+ });
+ const filtered = service.filterQuery({
+ query: { $limit: 10, test: 'me' }
+ });
+
+ assert.deepStrictEqual(filtered, {
+ paginate: {},
+ filters: { $limit: 10 },
+ query: { test: 'me' }
+ });
+
+ const withWhitelisted = service.filterQuery({
+ query: { $limit: 10, $something: 'else' }
+ });
+
+ assert.deepStrictEqual(withWhitelisted, {
+ paginate: {},
+ filters: { $limit: 10 },
+ query: { $something: 'else' }
+ });
+ });
+
+ it('allowsMulti', () => {
+ context('with true', () => {
+ const service = new AdapterService({multi: true});
+
+ it('does return true for multible methodes', () => {
+ assert.equal(service.allowsMulti('patch'), true);
+ });
+
+ it('does return false for always non-multible methodes', () => {
+ assert.equal(service.allowsMulti('update'), false);
+ });
+
+ it('does return true for unknown methods', () => {
+ assert.equal(service.allowsMulti('other'), true);
+ });
+ });
+
+ context('with false', () => {
+ const service = new AdapterService({multi: false});
+
+ it('does return false for multible methodes', () => {
+ assert.equal(service.allowsMulti('remove'), false);
+ });
+
+ it('does return true for always multible methodes', () => {
+ assert.equal(service.allowsMulti('find'), true);
+ });
+
+ it('does return false for unknown methods', () => {
+ assert.equal(service.allowsMulti('other'), false);
+ });
+ });
+
+ context('with array', () => {
+ const service = new AdapterService({multi: ['create', 'get', 'other']});
+
+ it('does return true for specified multible methodes', () => {
+ assert.equal(service.allowsMulti('create'), true);
+ });
+
+ it('does return false for non-specified multible methodes', () => {
+ assert.equal(service.allowsMulti('patch'), false);
+ });
+
+ it('does return false for specified always multible methodes', () => {
+ assert.equal(service.allowsMulti('get'), false);
+ });
+
+ it('does return true for specified unknown methodes', () => {
+ assert.equal(service.allowsMulti('other'), true);
+ });
+
+ it('does return false for non-specified unknown methodes', () => {
+ assert.equal(service.allowsMulti('another'), false);
+ });
+ });
+ });
+});
diff --git a/packages/adapter-commons/test/sort.test.ts b/packages/adapter-commons/test/sort.test.ts
new file mode 100644
index 0000000000..88e144b56c
--- /dev/null
+++ b/packages/adapter-commons/test/sort.test.ts
@@ -0,0 +1,179 @@
+import assert from 'assert';
+import { sorter } from '../src';
+
+describe('@feathersjs/adapter-commons', () => {
+ describe('sorter', () => {
+ it('simple sorter', () => {
+ const array = [{
+ name: 'David'
+ }, {
+ name: 'Eric'
+ }];
+
+ const sort = sorter({
+ name: -1
+ });
+
+ assert.deepStrictEqual(array.sort(sort), [{
+ name: 'Eric'
+ }, {
+ name: 'David'
+ }]);
+ });
+
+ it('simple sorter with arrays', () => {
+ const array = [{
+ names: [ 'a', 'b' ]
+ }, {
+ names: [ 'c', 'd' ]
+ }];
+
+ const sort = sorter({
+ names: -1
+ });
+
+ assert.deepStrictEqual(array.sort(sort), [{
+ names: [ 'c', 'd' ]
+ }, {
+ names: [ 'a', 'b' ]
+ }]);
+ });
+
+ it('simple sorter with objects', () => {
+ const array = [{
+ names: {
+ first: 'Dave',
+ last: 'L'
+ }
+ }, {
+ names: {
+ first: 'A',
+ last: 'B'
+ }
+ }];
+
+ const sort = sorter({
+ names: 1
+ });
+
+ assert.deepStrictEqual(array.sort(sort), [{
+ names: {
+ first: 'A',
+ last: 'B'
+ }
+ }, {
+ names: {
+ first: 'Dave',
+ last: 'L'
+ }
+ }]);
+ });
+
+ it('two property sorter', () => {
+ const array = [{
+ name: 'David',
+ counter: 0
+ }, {
+ name: 'Eric',
+ counter: 1
+ }, {
+ name: 'David',
+ counter: 1
+ }, {
+ name: 'Eric',
+ counter: 0
+ }];
+
+ const sort = sorter({
+ name: -1,
+ counter: 1
+ });
+
+ assert.deepStrictEqual(array.sort(sort), [
+ { name: 'Eric', counter: 0 },
+ { name: 'Eric', counter: 1 },
+ { name: 'David', counter: 0 },
+ { name: 'David', counter: 1 }
+ ]);
+ });
+
+ it('two property sorter with names', () => {
+ const array = [{
+ name: 'David',
+ counter: 0
+ }, {
+ name: 'Eric',
+ counter: 1
+ }, {
+ name: 'Andrew',
+ counter: 1
+ }, {
+ name: 'David',
+ counter: 1
+ }, {
+ name: 'Andrew',
+ counter: 0
+ }, {
+ name: 'Eric',
+ counter: 0
+ }];
+
+ const sort = sorter({
+ name: -1,
+ counter: 1
+ });
+
+ assert.deepStrictEqual(array.sort(sort), [
+ { name: 'Eric', counter: 0 },
+ { name: 'Eric', counter: 1 },
+ { name: 'David', counter: 0 },
+ { name: 'David', counter: 1 },
+ { name: 'Andrew', counter: 0 },
+ { name: 'Andrew', counter: 1 }
+ ]);
+ });
+
+ it('three property sorter with names', () => {
+ const array = [{
+ name: 'David',
+ counter: 0,
+ age: 2
+ }, {
+ name: 'Eric',
+ counter: 1,
+ age: 2
+ }, {
+ name: 'David',
+ counter: 1,
+ age: 1
+ }, {
+ name: 'Eric',
+ counter: 0,
+ age: 1
+ }, {
+ name: 'Andrew',
+ counter: 0,
+ age: 2
+ }, {
+ name: 'Andrew',
+ counter: 0,
+ age: 1
+ }];
+
+ const sort = sorter({
+ name: -1,
+ counter: 1,
+ age: -1
+ });
+
+ assert.deepStrictEqual(array.sort(sort), [
+ { name: 'Eric', counter: 0, age: 1 },
+ { name: 'Eric', counter: 1, age: 2 },
+ { name: 'David', counter: 0, age: 2 },
+ { name: 'David', counter: 1, age: 1 },
+ { name: 'Andrew', counter: 0, age: 2 },
+ { name: 'Andrew', counter: 0, age: 1 }
+ ]);
+ });
+ });
+});
diff --git a/packages/adapter-commons/tsconfig.json b/packages/adapter-commons/tsconfig.json
new file mode 100644
index 0000000000..316fd41336
--- /dev/null
+++ b/packages/adapter-commons/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "../../tsconfig",
+ "include": [
+ "src/**/*.ts"
+ ],
+ "compilerOptions": {
+ "outDir": "lib"
+ }
+}
diff --git a/packages/adapter-tests/CHANGELOG.md b/packages/adapter-tests/CHANGELOG.md
new file mode 100644
index 0000000000..851ba4a717
--- /dev/null
+++ b/packages/adapter-tests/CHANGELOG.md
@@ -0,0 +1,281 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [4.5.11](https://github.com/feathersjs/databases/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## [4.5.4](https://github.com/feathersjs/databases/compare/@feathersjs/adapter-tests@4.5.3...@feathersjs/adapter-tests@4.5.4) (2020-09-27)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## 4.5.3 (2020-09-24)
+
+
+### Bug Fixes
+
+* **adapter-tests:** Update multi patch + query tests ([#5](https://github.com/feathersjs/databases/issues/5)) ([84f1fe4](https://github.com/feathersjs/databases/commit/84f1fe4f13dc3a26891e43b965f75d08243f6c6f))
+
+
+
+
+
+## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+# [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+# [4.4.0](https://github.com/feathersjs/feathers/compare/v4.3.11...v4.4.0) (2019-11-27)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## [4.3.11](https://github.com/feathersjs/feathers/compare/v4.3.10...v4.3.11) (2019-11-11)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## [4.3.10](https://github.com/feathersjs/feathers/compare/v4.3.9...v4.3.10) (2019-10-26)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## [4.3.9](https://github.com/feathersjs/feathers/compare/v4.3.8...v4.3.9) (2019-10-26)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## [4.3.4](https://github.com/feathersjs/feathers/compare/v4.3.3...v4.3.4) (2019-10-03)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## [4.3.3](https://github.com/feathersjs/feathers/compare/v4.3.2...v4.3.3) (2019-09-21)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## [4.3.2](https://github.com/feathersjs/feathers/compare/v4.3.1...v4.3.2) (2019-09-16)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+## [4.3.1](https://github.com/feathersjs/feathers/compare/v4.3.0...v4.3.1) (2019-09-09)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+# [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+# [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+# [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+# [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10)
+
+
+### Bug Fixes
+
+* Fix feathers-memory dependency that did not get updated ([9422b13](https://github.com/feathersjs/feathers/commit/9422b13))
+
+
+
+
+
+# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01)
+
+
+### Bug Fixes
+
+* Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f))
+
+
+
+
+
+# [4.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.1...v4.0.0-pre.2) (2019-05-15)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+# [4.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.0...v4.0.0-pre.1) (2019-05-08)
+
+**Note:** Version bump only for package @feathersjs/adapter-tests
+
+
+
+
+
+# [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21)
+
+
+### Bug Fixes
+
+* Add test to make sure different id in adapter query works ([#1165](https://github.com/feathersjs/feathers/issues/1165)) ([0ba4580](https://github.com/feathersjs/feathers/commit/0ba4580))
+* Update adapter tests to not rely on error instance ([#1202](https://github.com/feathersjs/feathers/issues/1202)) ([6885e0e](https://github.com/feathersjs/feathers/commit/6885e0e))
+* Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6))
+
+
+### chore
+
+* **package:** Move adapter tests into their own module ([#1164](https://github.com/feathersjs/feathers/issues/1164)) ([dcc1e6b](https://github.com/feathersjs/feathers/commit/dcc1e6b))
+
+
+### Features
+
+* Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713))
+* Authentication v3 core server implementation ([#1205](https://github.com/feathersjs/feathers/issues/1205)) ([1bd7591](https://github.com/feathersjs/feathers/commit/1bd7591))
+
+
+### BREAKING CHANGES
+
+* **package:** Removes adapter tests from @feathersjs/adapter-commons
+
+
+
+
+
+## [1.0.1](https://github.com/feathersjs/feathers/compare/@feathersjs/adapter-tests@1.0.0...@feathersjs/adapter-tests@1.0.1) (2019-01-10)
+
+
+### Bug Fixes
+
+* Add test to make sure different id in adapter query works ([#1165](https://github.com/feathersjs/feathers/issues/1165)) ([0ba4580](https://github.com/feathersjs/feathers/commit/0ba4580))
+
+
+
+
+
+# 1.0.0 (2019-01-10)
+
+
+### chore
+
+* **package:** Move adapter tests into their own module ([#1164](https://github.com/feathersjs/feathers/issues/1164)) ([dcc1e6b](https://github.com/feathersjs/feathers/commit/dcc1e6b))
+
+
+### BREAKING CHANGES
+
+* **package:** Removes adapter tests from @feathersjs/adapter-commons
diff --git a/packages/adapter-tests/LICENSE b/packages/adapter-tests/LICENSE
new file mode 100644
index 0000000000..7139cac0dd
--- /dev/null
+++ b/packages/adapter-tests/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2020 Feathers
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/packages/adapter-tests/README.md b/packages/adapter-tests/README.md
new file mode 100644
index 0000000000..7a552f9666
--- /dev/null
+++ b/packages/adapter-tests/README.md
@@ -0,0 +1,21 @@
+# Feathers Adapter Tests
+
+[](https://github.com/feathersjs/feathers/actions?query=workflow%3A%22Node.js+CI%22)
+[](https://david-dm.org/feathersjs/feathers?path=packages/adapter-tests)
+[](https://www.npmjs.com/package/@feathersjs/adapter-commons)
+
+> Feathers shared database adapter test suite
+
+## About
+
+This is a repository that contains the test suite for the common database adapter syntax. See the [API documentation](https://docs.feathersjs.com/api/databases/common.html) for more information.
+
+## Authors
+
+[Feathers contributors](https://github.com/feathersjs/adapter-tests/graphs/contributors)
+
+## License
+
+Copyright (c) 2019 Feathers contributors
+
+Licensed under the [MIT license](LICENSE).
diff --git a/packages/adapter-tests/package.json b/packages/adapter-tests/package.json
new file mode 100644
index 0000000000..409ac8c06c
--- /dev/null
+++ b/packages/adapter-tests/package.json
@@ -0,0 +1,57 @@
+{
+ "name": "@feathersjs/adapter-tests",
+ "version": "4.5.11",
+ "description": "Feathers shared database adapter test suite",
+ "homepage": "https://feathersjs.com",
+ "keywords": [
+ "feathers"
+ ],
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/feathers"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/feathersjs/databases.git"
+ },
+ "author": {
+ "name": "Feathers contributor",
+ "email": "hello@feathersjs.com",
+ "url": "https://feathersjs.com"
+ },
+ "contributors": [],
+ "bugs": {
+ "url": "https://github.com/feathersjs/databases/issues"
+ },
+ "engines": {
+ "node": ">= 10"
+ },
+ "main": "lib/index.js",
+ "scripts": {
+ "prepublish": "npm run compile",
+ "compile": "shx rm -rf lib/ && tsc",
+ "test": "mocha --config ../../.mocharc.ts.json --recursive test/**.test.ts test/**/*.test.ts"
+ },
+ "directories": {
+ "lib": "lib"
+ },
+ "files": [
+ "CHANGELOG.md",
+ "LICENSE",
+ "README.md",
+ "src/**",
+ "lib/**"
+ ],
+ "publishConfig": {
+ "access": "public"
+ },
+ "devDependencies": {
+ "@types/node": "^14.14.10",
+ "mocha": "^8.2.1",
+ "shx": "^0.3.3",
+ "ts-node": "^9.1.0",
+ "typescript": "^4.1.2"
+ },
+ "gitHead": "9b9f0f13387341bdd320f1e66feda828fca2c9f2"
+}
diff --git a/packages/adapter-tests/src/basic.ts b/packages/adapter-tests/src/basic.ts
new file mode 100644
index 0000000000..5353ac1dcd
--- /dev/null
+++ b/packages/adapter-tests/src/basic.ts
@@ -0,0 +1,53 @@
+import assert from 'assert';
+
+export default (test: any, app: any, _errors: any, serviceName: string, idProp: string) => {
+ describe('Basic Functionality', () => {
+ let service: any;
+
+ beforeEach(() => {
+ service = app.service(serviceName);
+ });
+
+ it('.id', () => {
+ assert.strictEqual(service.id, idProp,
+ 'id property is set to expected name'
+ );
+ });
+
+ test('.options', () => {
+ assert.ok(service.options, 'Options are available in service.options');
+ });
+
+ test('.events', () => {
+ assert.ok(service.events.includes('testing'),
+ 'service.events is set and includes "testing"'
+ );
+ });
+
+ describe('Raw Methods', () => {
+ test('._get', () => {
+ assert.strictEqual(typeof service._get, 'function');
+ });
+
+ test('._find', () => {
+ assert.strictEqual(typeof service._find, 'function');
+ });
+
+ test('._create', () => {
+ assert.strictEqual(typeof service._create, 'function');
+ });
+
+ test('._update', () => {
+ assert.strictEqual(typeof service._update, 'function');
+ });
+
+ test('._patch', () => {
+ assert.strictEqual(typeof service._patch, 'function');
+ });
+
+ test('._remove', () => {
+ assert.strictEqual(typeof service._remove, 'function');
+ });
+ });
+ });
+};
diff --git a/packages/adapter-tests/src/index.ts b/packages/adapter-tests/src/index.ts
new file mode 100644
index 0000000000..32902c8c23
--- /dev/null
+++ b/packages/adapter-tests/src/index.ts
@@ -0,0 +1,53 @@
+/* tslint:disable:no-console */
+import basicTests from './basic';
+import methodTests from './methods';
+import syntaxTests from './syntax';
+
+const adapterTests = (testNames: string[]) => {
+ return (app: any, errors: any, serviceName: any, idProp = 'id') => {
+ if (!serviceName) {
+ throw new Error('You must pass a service name');
+ }
+
+ const skippedTests: string[] = [];
+ const allTests: string[] = [];
+
+ const test = (name: string, runner: any) => {
+ const skip = !testNames.includes(name);
+ const its = skip ? it.skip : it;
+
+ if (skip) {
+ skippedTests.push(name);
+ }
+
+ allTests.push(name);
+
+ its(name, runner);
+ };
+
+ describe(`Adapter tests for '${serviceName}' service with '${idProp}' id property`, () => {
+ after(() => {
+ console.log('\n');
+ testNames.forEach(name => {
+ if (!allTests.includes(name)) {
+ console.error(`WARNING: '${name}' test is not part of the test suite`);
+ }
+ });
+ if (skippedTests.length) {
+ console.log(`\nSkipped the following ${skippedTests.length} Feathers adapter test(s) out of ${allTests.length} total:`);
+ console.log(JSON.stringify(skippedTests, null, ' '));
+ }
+ });
+
+ basicTests(test, app, errors, serviceName, idProp);
+ methodTests(test, app, errors, serviceName, idProp);
+ syntaxTests(test, app, errors, serviceName, idProp);
+ });
+ };
+};
+
+export default adapterTests;
+
+if (typeof module !== 'undefined') {
+ module.exports = adapterTests;
+}
diff --git a/packages/adapter-tests/src/methods.ts b/packages/adapter-tests/src/methods.ts
new file mode 100644
index 0000000000..2fa8cabb5a
--- /dev/null
+++ b/packages/adapter-tests/src/methods.ts
@@ -0,0 +1,600 @@
+import assert from 'assert';
+
+export default (test: any, app: any, _errors: any, serviceName: string, idProp: string) => {
+ describe(' Methods', () => {
+ let doug: any;
+ let service: any;
+
+ beforeEach(async () => {
+ service = app.service(serviceName);
+ doug = await app.service(serviceName).create({
+ name: 'Doug',
+ age: 32
+ });
+ });
+
+ afterEach(async () => {
+ try {
+ await app.service(serviceName).remove(doug[idProp]);
+ } catch (error) {}
+ });
+
+ describe('get', () => {
+ test('.get', async () => {
+ const data = await service.get(doug[idProp]);
+
+ assert.strictEqual(data[idProp].toString(), doug[idProp].toString(),
+ `${idProp} id matches`
+ );
+ assert.strictEqual(data.name, 'Doug', 'data.name matches');
+ assert.strictEqual(data.age, 32, 'data.age matches');
+ });
+
+ test('.get + $select', async () => {
+ const data = await service.get(doug[idProp], {
+ query: { $select: [ 'name' ] }
+ });
+
+ assert.strictEqual(data[idProp].toString(), doug[idProp].toString(),
+ `${idProp} id property matches`
+ );
+ assert.strictEqual(data.name, 'Doug', 'data.name matches');
+ assert.ok(!data.age, 'data.age is falsy');
+ });
+
+ test('.get + id + query', async () => {
+ try {
+ await service.get(doug[idProp], {
+ query: { name: 'Tester' }
+ });
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Got a NotFound Feathers error'
+ );
+ }
+ });
+
+ test('.get + NotFound', async () => {
+ try {
+ await service.get('568225fbfe21222432e836ff');
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Error is a NotFound Feathers error'
+ );
+ }
+ });
+
+ test('.get + id + query id', async () => {
+ const alice = await service.create({
+ name: 'Alice',
+ age: 12
+ });
+
+ try {
+ await service.get(doug[idProp], {
+ query: { [idProp]: alice[idProp] }
+ });
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Got a NotFound Feathers error'
+ );
+ }
+
+ await service.remove(alice[idProp]);
+ });
+ });
+
+ describe('find', () => {
+ test('.find', async () => {
+ const data = await service.find();
+
+ assert.ok(Array.isArray(data), 'Data is an array');
+ assert.strictEqual(data.length, 1, 'Got one entry');
+ });
+ });
+
+ describe('remove', () => {
+ test('.remove', async () => {
+ const data = await service.remove(doug[idProp]);
+
+ assert.strictEqual(data.name, 'Doug', 'data.name matches');
+ });
+
+ test('.remove + $select', async () => {
+ const data = await service.remove(doug[idProp], {
+ query: { $select: [ 'name' ] }
+ });
+
+ assert.strictEqual(data.name, 'Doug', 'data.name matches');
+ assert.ok(!data.age, 'data.age is falsy');
+ });
+
+ test('.remove + id + query', async () => {
+ try {
+ await service.remove(doug[idProp], {
+ query: { name: 'Tester' }
+ });
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Got a NotFound Feathers error'
+ );
+ }
+ });
+
+ test('.remove + multi', async () => {
+ try {
+ await service.remove(null);
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'MethodNotAllowed',
+ 'Removing multiple without option set throws MethodNotAllowed'
+ );
+ }
+
+ service.options.multi = [ 'remove' ];
+
+ await service.create({ name: 'Dave', age: 29, created: true });
+ await service.create({
+ name: 'David',
+ age: 3,
+ created: true
+ });
+
+ const data = await service.remove(null, {
+ query: { created: true }
+ });
+
+ assert.strictEqual(data.length, 2);
+
+ const names = data.map((person: any) => person.name);
+
+ assert.ok(names.includes('Dave'), 'Dave removed');
+ assert.ok(names.includes('David'), 'David removed');
+ });
+
+ test('.remove + id + query id', async () => {
+ const alice = await service.create({
+ name: 'Alice',
+ age: 12
+ });
+
+ try {
+ await service.remove(doug[idProp], {
+ query: { [idProp]: alice[idProp] }
+ });
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Got a NotFound Feathers error'
+ );
+ }
+
+ await service.remove(alice[idProp]);
+ });
+ });
+
+ describe('update', () => {
+ test('.update', async () => {
+ const originalData = { [idProp]: doug[idProp], name: 'Dougler' };
+ const originalCopy = Object.assign({}, originalData);
+
+ const data = await service.update(doug[idProp], originalData);
+
+ assert.deepStrictEqual(originalData, originalCopy,
+ 'data was not modified'
+ );
+ assert.strictEqual(data[idProp].toString(), doug[idProp].toString(),
+ `${idProp} id matches`
+ );
+ assert.strictEqual(data.name, 'Dougler', 'data.name matches');
+ assert.ok(!data.age, 'data.age is falsy');
+ });
+
+ test('.update + $select', async () => {
+ const originalData = {
+ [idProp]: doug[idProp],
+ name: 'Dougler',
+ age: 10
+ };
+
+ const data = await service.update(doug[idProp], originalData, {
+ query: { $select: [ 'name' ] }
+ });
+
+ assert.strictEqual(data.name, 'Dougler', 'data.name matches');
+ assert.ok(!data.age, 'data.age is falsy');
+ });
+
+ test('.update + id + query', async () => {
+ try {
+ await service.update(doug[idProp], {
+ name: 'Dougler'
+ }, {
+ query: { name: 'Tester' }
+ });
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Got a NotFound Feathers error'
+ );
+ }
+ });
+
+ test('.update + NotFound', async () => {
+ try {
+ await service.update('568225fbfe21222432e836ff', { name: 'NotFound' });
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Error is a NotFound Feathers error'
+ );
+ }
+ });
+
+ test('.update + query + NotFound', async () => {
+ const dave = await service.create({ name: 'Dave' });
+ try {
+ await service.update(
+ dave[idProp],
+ { name: 'UpdatedDave' },
+ { query: { name: 'NotDave' } }
+ );
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Error is a NotFound Feathers error'
+ );
+ }
+ await service.remove(dave[idProp]);
+ });
+
+ test('.update + id + query id', async () => {
+ const alice = await service.create({
+ name: 'Alice',
+ age: 12
+ });
+
+ try {
+ await service.update(doug[idProp], {
+ name: 'Dougler',
+ age: 33
+ }, {
+ query: { [idProp]: alice[idProp] }
+ });
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Got a NotFound Feathers error'
+ );
+ }
+
+ await service.remove(alice[idProp]);
+ });
+ });
+
+ describe('patch', () => {
+ test('.patch', async () => {
+ const originalData = { [idProp]: doug[idProp], name: 'PatchDoug' };
+ const originalCopy = Object.assign({}, originalData);
+
+ const data = await service.patch(doug[idProp], originalData);
+
+ assert.deepStrictEqual(originalData, originalCopy,
+ 'original data was not modified'
+ );
+ assert.strictEqual(data[idProp].toString(), doug[idProp].toString(),
+ `${idProp} id matches`
+ );
+ assert.strictEqual(data.name, 'PatchDoug', 'data.name matches');
+ assert.strictEqual(data.age, 32, 'data.age matches');
+ });
+
+ test('.patch + $select', async () => {
+ const originalData = { [idProp]: doug[idProp], name: 'PatchDoug' };
+
+ const data = await service.patch(doug[idProp], originalData, {
+ query: { $select: [ 'name' ] }
+ });
+
+ assert.strictEqual(data.name, 'PatchDoug', 'data.name matches');
+ assert.ok(!data.age, 'data.age is falsy');
+ });
+
+ test('.patch + id + query', async () => {
+ try {
+ await service.patch(doug[idProp], {
+ name: 'id patched doug'
+ }, {
+ query: { name: 'Tester' }
+ });
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Got a NotFound Feathers error'
+ );
+ }
+ });
+
+ test('.patch multiple', async () => {
+ try {
+ await service.patch(null, {});
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'MethodNotAllowed',
+ 'Removing multiple without option set throws MethodNotAllowed'
+ );
+ }
+
+ const params = {
+ query: { created: true }
+ };
+ const dave = await service.create({
+ name: 'Dave',
+ age: 29,
+ created: true
+ });
+ const david = await service.create({
+ name: 'David',
+ age: 3,
+ created: true
+ });
+
+ service.options.multi = [ 'patch' ];
+
+ const data = await service.patch(null, {
+ age: 2
+ }, params);
+
+ assert.strictEqual(data.length, 2, 'returned two entries');
+ assert.strictEqual(data[0].age, 2, 'First entry age was updated');
+ assert.strictEqual(data[1].age, 2, 'Second entry age was updated');
+
+ await service.remove(dave[idProp]);
+ await service.remove(david[idProp]);
+ });
+
+ test('.patch multi query same', async () => {
+ const service = app.service(serviceName);
+ const params = {
+ query: { age: { $lt: 10 } }
+ };
+ const dave = await service.create({
+ name: 'Dave',
+ age: 8,
+ created: true
+ });
+ const david = await service.create({
+ name: 'David',
+ age: 4,
+ created: true
+ });
+
+ const data = await service.patch(null, {
+ age: 2
+ }, params);
+
+ assert.strictEqual(data.length, 2, 'returned two entries');
+ assert.strictEqual(data[0].age, 2, 'First entry age was updated');
+ assert.strictEqual(data[1].age, 2, 'Second entry age was updated');
+
+ await service.remove(dave[idProp]);
+ await service.remove(david[idProp]);
+ });
+
+ test('.patch multi query changed', async () => {
+ const service = app.service(serviceName);
+ const params = {
+ query: { age: 10 }
+ };
+ const dave = await service.create({
+ name: 'Dave',
+ age: 10,
+ created: true
+ });
+ const david = await service.create({
+ name: 'David',
+ age: 10,
+ created: true
+ });
+
+ const data = await service.patch(null, {
+ age: 2
+ }, params);
+
+ assert.strictEqual(data.length, 2, 'returned two entries');
+ assert.strictEqual(data[0].age, 2, 'First entry age was updated');
+ assert.strictEqual(data[1].age, 2, 'Second entry age was updated');
+
+ await service.remove(dave[idProp]);
+ await service.remove(david[idProp]);
+ });
+
+ test('.patch + NotFound', async () => {
+ try {
+ await service.patch('568225fbfe21222432e836ff', { name: 'PatchDoug' });
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Error is a NotFound Feathers error'
+ );
+ }
+ });
+
+ test('.patch + query + NotFound', async () => {
+ const dave = await service.create({ name: 'Dave' });
+ try {
+ await service.patch(
+ dave[idProp],
+ { name: 'PatchedDave' },
+ { query: { name: 'NotDave' } }
+ );
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Error is a NotFound Feathers error'
+ );
+ }
+ await service.remove(dave[idProp]);
+ });
+
+ test('.patch + id + query id', async () => {
+ const alice = await service.create({
+ name: 'Alice',
+ age: 12
+ });
+
+ try {
+ await service.patch(doug[idProp], {
+ age: 33
+ }, {
+ query: { [idProp]: alice[idProp] }
+ });
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'NotFound',
+ 'Got a NotFound Feathers error'
+ );
+ }
+
+ await service.remove(alice[idProp]);
+ });
+ });
+
+ describe('create', () => {
+ test('.create', async () => {
+ const originalData = {
+ name: 'Bill',
+ age: 40
+ };
+ const originalCopy = Object.assign({}, originalData);
+
+ const data = await service.create(originalData);
+
+ assert.deepStrictEqual(originalData, originalCopy,
+ 'original data was not modified'
+ );
+ assert.ok(data instanceof Object, 'data is an object');
+ assert.strictEqual(data.name, 'Bill', 'data.name matches');
+
+ await service.remove(data[idProp]);
+ });
+
+ test('.create + $select', async () => {
+ const originalData = {
+ name: 'William',
+ age: 23
+ };
+
+ const data = await service.create(originalData, {
+ query: { $select: [ 'name' ] }
+ });
+
+ assert.strictEqual(data.name, 'William', 'data.name matches');
+ assert.ok(!data.age, 'data.age is falsy');
+
+ await service.remove(data[idProp]);
+ });
+
+ test('.create multi', async () => {
+ try {
+ await service.create([], {});
+ throw new Error('Should never get here');
+ } catch (error) {
+ assert.strictEqual(error.name, 'MethodNotAllowed',
+ 'Removing multiple without option set throws MethodNotAllowed'
+ );
+ }
+
+ const items = [
+ {
+ name: 'Gerald',
+ age: 18
+ },
+ {
+ name: 'Herald',
+ age: 18
+ }
+ ];
+
+ service.options.multi = [ 'create', 'patch' ];
+
+ const data = await service.create(items);
+
+ assert.ok(Array.isArray(data), 'data is an array');
+ assert.ok(typeof data[0][idProp] !== 'undefined', 'id is set');
+ assert.strictEqual(data[0].name, 'Gerald', 'first name matches');
+ assert.ok(typeof data[1][idProp] !== 'undefined', 'id is set');
+ assert.strictEqual(data[1].name, 'Herald', 'second name macthes');
+
+ await service.remove(data[0][idProp]);
+ await service.remove(data[1][idProp]);
+ });
+ });
+
+ describe('doesn\'t call public methods internally', () => {
+ let throwing: any;
+
+ before(() => {
+ throwing = app.service(serviceName).extend({
+ get store () {
+ return app.service(serviceName).store;
+ },
+
+ find () {
+ throw new Error('find method called');
+ },
+ get () {
+ throw new Error('get method called');
+ },
+ create () {
+ throw new Error('create method called');
+ },
+ update () {
+ throw new Error('update method called');
+ },
+ patch () {
+ throw new Error('patch method called');
+ },
+ remove () {
+ throw new Error('remove method called');
+ }
+ });
+ });
+
+ test('internal .find', () => app.service(serviceName).find.call(throwing));
+
+ test('internal .get', () =>
+ service.get.call(throwing, doug[idProp])
+ );
+
+ test('internal .create', async () => {
+ const bob = await service.create.call(throwing, {
+ name: 'Bob',
+ age: 25
+ });
+
+ await service.remove(bob[idProp]);
+ });
+
+ test('internal .update', () =>
+ service.update.call(throwing, doug[idProp], {
+ name: 'Dougler'
+ })
+ );
+
+ test('internal .patch', () =>
+ service.patch.call(throwing, doug[idProp], {
+ name: 'PatchDoug'
+ })
+ );
+
+ test('internal .remove', () =>
+ service.remove.call(throwing, doug[idProp])
+ );
+ });
+ });
+};
diff --git a/packages/adapter-tests/src/syntax.ts b/packages/adapter-tests/src/syntax.ts
new file mode 100644
index 0000000000..627309cd4b
--- /dev/null
+++ b/packages/adapter-tests/src/syntax.ts
@@ -0,0 +1,342 @@
+import assert from 'assert';
+
+export default (test: any, app: any, _errors: any, serviceName: string, idProp: string) => {
+ describe('Query Syntax', () => {
+ let bob: any;
+ let alice: any;
+ let doug: any;
+ let service: any;
+
+ beforeEach(async () => {
+ service = app.service(serviceName);
+ bob = await app.service(serviceName).create({
+ name: 'Bob',
+ age: 25
+ });
+ doug = await app.service(serviceName).create({
+ name: 'Doug',
+ age: 32
+ });
+ alice = await app.service(serviceName).create({
+ name: 'Alice',
+ age: 19
+ });
+ });
+
+ afterEach(async () => {
+ await service.remove(bob[idProp]);
+ await service.remove(alice[idProp]);
+ await service.remove(doug[idProp]);
+ });
+
+ test('.find + equal', async () => {
+ const params = { query: { name: 'Alice' } };
+ const data = await service.find(params);
+
+ assert.ok(Array.isArray(data));
+ assert.strictEqual(data.length, 1);
+ assert.strictEqual(data[0].name, 'Alice');
+ });
+
+ test('.find + equal multiple', async () => {
+ const data = await service.find({
+ query: { name: 'Alice', age: 20 }
+ });
+
+ assert.strictEqual(data.length, 0);
+ });
+
+ describe('special filters', () => {
+ test('.find + $sort', async () => {
+ let data = await service.find({
+ query: {
+ $sort: { name: 1 }
+ }
+ });
+
+ assert.strictEqual(data.length, 3);
+ assert.strictEqual(data[0].name, 'Alice');
+ assert.strictEqual(data[1].name, 'Bob');
+ assert.strictEqual(data[2].name, 'Doug');
+
+ data = await service.find({
+ query: {
+ $sort: { name: -1 }
+ }
+ });
+
+ assert.strictEqual(data.length, 3);
+ assert.strictEqual(data[0].name, 'Doug');
+ assert.strictEqual(data[1].name, 'Bob');
+ assert.strictEqual(data[2].name, 'Alice');
+ });
+
+ test('.find + $sort + string', async () => {
+ const data = await service.find({
+ query: {
+ $sort: { name: '1' }
+ }
+ });
+
+ assert.strictEqual(data.length, 3);
+ assert.strictEqual(data[0].name, 'Alice');
+ assert.strictEqual(data[1].name, 'Bob');
+ assert.strictEqual(data[2].name, 'Doug');
+ });
+
+ test('.find + $limit', async () => {
+ const data = await service.find({
+ query: {
+ $limit: 2
+ }
+ });
+
+ assert.strictEqual(data.length, 2);
+ });
+
+ test('.find + $limit 0', async () => {
+ const data = await service.find({
+ query: {
+ $limit: 0
+ }
+ });
+
+ assert.strictEqual(data.length, 0);
+ });
+
+ test('.find + $skip', async () => {
+ const data = await service.find({
+ query: {
+ $sort: { name: 1 },
+ $skip: 1
+ }
+ });
+
+ assert.strictEqual(data.length, 2);
+ assert.strictEqual(data[0].name, 'Bob');
+ assert.strictEqual(data[1].name, 'Doug');
+ });
+
+ test('.find + $select', async () => {
+ const data = await service.find({
+ query: {
+ name: 'Alice',
+ $select: ['name']
+ }
+ });
+
+ assert.strictEqual(data.length, 1);
+ assert.strictEqual(data[0].name, 'Alice');
+ assert.strictEqual(data[0].age, undefined);
+ });
+
+ test('.find + $or', async () => {
+ const data = await service.find({
+ query: {
+ $or: [
+ { name: 'Alice' },
+ { name: 'Bob' }
+ ],
+ $sort: { name: 1 }
+ }
+ });
+
+ assert.strictEqual(data.length, 2);
+ assert.strictEqual(data[0].name, 'Alice');
+ assert.strictEqual(data[1].name, 'Bob');
+ });
+
+ test('.find + $in', async () => {
+ const data = await service.find({
+ query: {
+ name: {
+ $in: ['Alice', 'Bob']
+ },
+ $sort: { name: 1 }
+ }
+ });
+
+ assert.strictEqual(data.length, 2);
+ assert.strictEqual(data[0].name, 'Alice');
+ assert.strictEqual(data[1].name, 'Bob');
+ });
+
+ test('.find + $nin', async () => {
+ const data = await service.find({
+ query: {
+ name: {
+ $nin: [ 'Alice', 'Bob' ]
+ }
+ }
+ });
+
+ assert.strictEqual(data.length, 1);
+ assert.strictEqual(data[0].name, 'Doug');
+ });
+
+ test('.find + $lt', async () => {
+ const data = await service.find({
+ query: {
+ age: {
+ $lt: 30
+ }
+ }
+ });
+
+ assert.strictEqual(data.length, 2);
+ });
+
+ test('.find + $lte', async () => {
+ const data = await service.find({
+ query: {
+ age: {
+ $lte: 25
+ }
+ }
+ });
+
+ assert.strictEqual(data.length, 2);
+ });
+
+ test('.find + $gt', async () => {
+ const data = await service.find({
+ query: {
+ age: {
+ $gt: 30
+ }
+ }
+ });
+
+ assert.strictEqual(data.length, 1);
+ });
+
+ test('.find + $gte', async () => {
+ const data = await service.find({
+ query: {
+ age: {
+ $gte: 25
+ }
+ }
+ });
+
+ assert.strictEqual(data.length, 2);
+ });
+
+ test('.find + $ne', async () => {
+ const data = await service.find({
+ query: {
+ age: {
+ $ne: 25
+ }
+ }
+ });
+
+ assert.strictEqual(data.length, 2);
+ });
+ });
+
+ test('.find + $gt + $lt + $sort', async () => {
+ const params = {
+ query: {
+ age: {
+ $gt: 18,
+ $lt: 30
+ },
+ $sort: { name: 1 }
+ }
+ };
+
+ const data = await service.find(params);
+
+ assert.strictEqual(data.length, 2);
+ assert.strictEqual(data[0].name, 'Alice');
+ assert.strictEqual(data[1].name, 'Bob');
+ });
+
+ test('.find + $or nested + $sort', async () => {
+ const params = {
+ query: {
+ $or: [
+ { name: 'Doug' },
+ {
+ age: {
+ $gte: 18,
+ $lt: 25
+ }
+ }
+ ],
+ $sort: { name: 1 }
+ }
+ };
+
+ const data = await service.find(params);
+
+ assert.strictEqual(data.length, 2);
+ assert.strictEqual(data[0].name, 'Alice');
+ assert.strictEqual(data[1].name, 'Doug');
+ });
+
+ describe('paginate', function () {
+ beforeEach(() => {
+ service.options.paginate = {
+ default: 1,
+ max: 2
+ };
+ });
+
+ afterEach(() => {
+ service.options.paginate = {};
+ });
+
+ test('.find + paginate', async () => {
+ const page = await service.find({
+ query: { $sort: { name: -1 } }
+ });
+
+ assert.strictEqual(page.total, 3);
+ assert.strictEqual(page.limit, 1);
+ assert.strictEqual(page.skip, 0);
+ assert.strictEqual(page.data[0].name, 'Doug');
+ });
+
+ test('.find + paginate + $limit + $skip', async () => {
+ const params = {
+ query: {
+ $skip: 1,
+ $limit: 4,
+ $sort: { name: -1 }
+ }
+ };
+
+ const page = await service.find(params);
+
+ assert.strictEqual(page.total, 3);
+ assert.strictEqual(page.limit, 2);
+ assert.strictEqual(page.skip, 1);
+ assert.strictEqual(page.data[0].name, 'Bob');
+ assert.strictEqual(page.data[1].name, 'Alice');
+ });
+
+ test('.find + paginate + $limit 0', async () => {
+ const page = await service.find({
+ query: { $limit: 0 }
+ });
+
+ assert.strictEqual(page.total, 3);
+ assert.strictEqual(page.data.length, 0);
+ });
+
+ test('.find + paginate + params', async () => {
+ const page = await service.find({ paginate: { default: 3 } });
+
+ assert.strictEqual(page.limit, 3);
+ assert.strictEqual(page.skip, 0);
+
+ const results = await service.find({ paginate: false });
+
+ assert.ok(Array.isArray(results));
+ assert.strictEqual(results.length, 3);
+ });
+ });
+ });
+};
diff --git a/packages/adapter-tests/test/index.test.ts b/packages/adapter-tests/test/index.test.ts
new file mode 100644
index 0000000000..a80474e555
--- /dev/null
+++ b/packages/adapter-tests/test/index.test.ts
@@ -0,0 +1,76 @@
+import { strict as assert } from 'assert';
+import adapterTests from '../src';
+
+const testSuite = adapterTests([
+ '.events',
+ '._get',
+ '._find',
+ '._create',
+ '._update',
+ '._patch',
+ '._remove',
+ '.get',
+ '.get + $select',
+ '.get + id + query',
+ '.get + NotFound',
+ '.find',
+ '.remove',
+ '.remove + $select',
+ '.remove + id + query',
+ '.remove + multi',
+ '.update',
+ '.update + $select',
+ '.update + id + query',
+ '.update + NotFound',
+ '.patch',
+ '.patch + $select',
+ '.patch + id + query',
+ '.patch multiple',
+ '.patch multi query',
+ '.patch + NotFound',
+ '.create',
+ '.create + $select',
+ '.create multi',
+ 'internal .find',
+ 'internal .get',
+ 'internal .create',
+ 'internal .update',
+ 'internal .patch',
+ 'internal .remove',
+ '.find + equal',
+ '.find + equal multiple',
+ '.find + $sort',
+ '.find + $sort + string',
+ '.find + $limit',
+ '.find + $limit 0',
+ '.find + $skip',
+ '.find + $select',
+ '.find + $or',
+ '.find + $in',
+ '.find + $nin',
+ '.find + $lt',
+ '.find + $lte',
+ '.find + $gt',
+ '.find + $gte',
+ '.find + $ne',
+ '.find + $gt + $lt + $sort',
+ '.find + $or nested + $sort',
+ '.find + paginate',
+ '.find + paginate + $limit + $skip',
+ '.find + paginate + $limit 0',
+ '.find + paginate + params',
+ '.get + id + query id',
+ '.remove + id + query id',
+ '.update + id + query id',
+ '.patch + id + query id'
+]);
+
+describe('Feathers Memory Service', () => {
+ it('loads the test suite', async () => {
+ assert.ok(typeof testSuite === 'function');
+ });
+
+ it('exports as CommonJS', () => {
+ assert.equal(typeof require('../lib'), 'function');
+ });
+});
diff --git a/packages/adapter-tests/tsconfig.json b/packages/adapter-tests/tsconfig.json
new file mode 100644
index 0000000000..316fd41336
--- /dev/null
+++ b/packages/adapter-tests/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "../../tsconfig",
+ "include": [
+ "src/**/*.ts"
+ ],
+ "compilerOptions": {
+ "outDir": "lib"
+ }
+}
diff --git a/packages/authentication-client/CHANGELOG.md b/packages/authentication-client/CHANGELOG.md
index 6fbe122d80..d03c240b04 100644
--- a/packages/authentication-client/CHANGELOG.md
+++ b/packages/authentication-client/CHANGELOG.md
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+
+### Bug Fixes
+
+* **authentication-client:** Allow reAuthentication using specific strategy ([#2140](https://github.com/feathersjs/feathers/issues/2140)) ([2a2bbf7](https://github.com/feathersjs/feathers/commit/2a2bbf7f8ee6d32b9fac8afab3421286b06e6443))
+* **socketio-client:** Throw an error and show a warning if someone tries to use socket.io-client v3 ([#2135](https://github.com/feathersjs/feathers/issues/2135)) ([cc3521c](https://github.com/feathersjs/feathers/commit/cc3521c935a1cbd690e29b7057998e3898f282db))
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
**Note:** Version bump only for package @feathersjs/authentication-client
diff --git a/packages/authentication-client/package.json b/packages/authentication-client/package.json
index df4cd63851..b962583b3a 100644
--- a/packages/authentication-client/package.json
+++ b/packages/authentication-client/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/authentication-client",
"description": "The authentication plugin for feathers-client",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "lib/",
@@ -52,28 +52,28 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/authentication": "^4.5.10",
- "@feathersjs/commons": "^4.5.10",
- "@feathersjs/errors": "^4.5.10",
- "@feathersjs/feathers": "^4.5.10",
- "debug": "^4.2.0"
+ "@feathersjs/authentication": "^4.5.11",
+ "@feathersjs/commons": "^4.5.11",
+ "@feathersjs/errors": "^4.5.11",
+ "@feathersjs/feathers": "^4.5.11",
+ "debug": "^4.3.1"
},
"devDependencies": {
- "@feathersjs/authentication-local": "^4.5.10",
- "@feathersjs/express": "^4.5.10",
- "@feathersjs/primus": "^4.5.10",
- "@feathersjs/primus-client": "^4.5.10",
- "@feathersjs/rest-client": "^4.5.10",
- "@feathersjs/socketio": "^4.5.10",
- "@feathersjs/socketio-client": "^4.5.10",
+ "@feathersjs/authentication-local": "^4.5.11",
+ "@feathersjs/express": "^4.5.11",
+ "@feathersjs/primus": "^4.5.11",
+ "@feathersjs/primus-client": "^4.5.11",
+ "@feathersjs/rest-client": "^4.5.11",
+ "@feathersjs/socketio": "^4.5.11",
+ "@feathersjs/socketio-client": "^4.5.11",
"@types/debug": "^4.1.5",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.14.6",
+ "@types/mocha": "^8.0.4",
+ "@types/node": "^14.14.10",
"axios": "^0.21.0",
"mocha": "^8.2.1",
"shx": "^0.3.3",
- "ts-node": "^9.0.0",
- "typescript": "^4.0.5"
+ "ts-node": "^9.1.0",
+ "typescript": "^4.1.2"
},
"gitHead": "9b9f0f13387341bdd320f1e66feda828fca2c9f2"
}
diff --git a/packages/authentication-client/src/core.ts b/packages/authentication-client/src/core.ts
index 77178872f4..9d7e8da4af 100644
--- a/packages/authentication-client/src/core.ts
+++ b/packages/authentication-client/src/core.ts
@@ -65,7 +65,7 @@ export class AuthenticationClient {
socket.on(disconnected, () => {
const authPromise = new Promise(resolve =>
- socket.once(connected, () => resolve())
+ socket.once(connected, (data: any) => resolve(data))
)
// Only reconnect when `reAuthenticate()` or `authenticate()`
// has been called explicitly first
@@ -132,7 +132,7 @@ export class AuthenticationClient {
return Promise.reject(error);
}
- reAuthenticate (force: boolean = false): Promise {
+ reAuthenticate (force: boolean = false, strategy?: string): Promise {
// Either returns the authentication state or
// tries to re-authenticate with the stored JWT and strategy
const authPromise = this.app.get('authentication');
@@ -144,7 +144,7 @@ export class AuthenticationClient {
}
return this.authenticate({
- strategy: this.options.jwtStrategy,
+ strategy: strategy || this.options.jwtStrategy,
accessToken
});
});
diff --git a/packages/authentication-client/test/index.test.ts b/packages/authentication-client/test/index.test.ts
index fb6f669a14..9f44ce736d 100644
--- a/packages/authentication-client/test/index.test.ts
+++ b/packages/authentication-client/test/index.test.ts
@@ -202,5 +202,27 @@ describe('@feathersjs/authentication-client', () => {
assert.ok(!app.get('authentication'));
});
});
+
+ it('reauthenticates using different strategy', async () => {
+ app.configure(client({ jwtStrategy: 'any' }));
+
+ const data = {
+ strategy: 'testing'
+ };
+
+ let result = await app.authenticate(data);
+ assert.deepStrictEqual(result, {
+ accessToken,
+ data,
+ user
+ });
+
+ result = await app.authentication.reAuthenticate(false, 'jwt');
+ assert.deepStrictEqual(result, {
+ accessToken,
+ data,
+ user
+ });
+ })
});
});
diff --git a/packages/authentication-local/CHANGELOG.md b/packages/authentication-local/CHANGELOG.md
index a10c3b89d0..9e7816e232 100644
--- a/packages/authentication-local/CHANGELOG.md
+++ b/packages/authentication-local/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/authentication-local
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
**Note:** Version bump only for package @feathersjs/authentication-local
diff --git a/packages/authentication-local/package.json b/packages/authentication-local/package.json
index e565548542..1826d9c29f 100644
--- a/packages/authentication-local/package.json
+++ b/packages/authentication-local/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/authentication-local",
"description": "Local authentication strategy for @feathers/authentication",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "lib/",
@@ -52,23 +52,23 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/authentication": "^4.5.10",
- "@feathersjs/errors": "^4.5.10",
- "@feathersjs/feathers": "^4.5.10",
+ "@feathersjs/authentication": "^4.5.11",
+ "@feathersjs/errors": "^4.5.11",
+ "@feathersjs/feathers": "^4.5.11",
"bcryptjs": "^2.4.3",
- "debug": "^4.2.0",
+ "debug": "^4.3.1",
"lodash": "^4.17.20"
},
"devDependencies": {
"@types/bcryptjs": "^2.4.2",
"@types/debug": "^4.1.5",
- "@types/lodash": "^4.14.164",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.14.6",
+ "@types/lodash": "^4.14.165",
+ "@types/mocha": "^8.0.4",
+ "@types/node": "^14.14.10",
"mocha": "^8.2.1",
"shx": "^0.3.3",
- "ts-node": "^9.0.0",
- "typescript": "^4.0.5"
+ "ts-node": "^9.1.0",
+ "typescript": "^4.1.2"
},
"gitHead": "9b9f0f13387341bdd320f1e66feda828fca2c9f2"
}
diff --git a/packages/authentication-oauth/CHANGELOG.md b/packages/authentication-oauth/CHANGELOG.md
index ae9823be78..1b3f06735a 100644
--- a/packages/authentication-oauth/CHANGELOG.md
+++ b/packages/authentication-oauth/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+
+### Bug Fixes
+
+* **socketio-client:** Throw an error and show a warning if someone tries to use socket.io-client v3 ([#2135](https://github.com/feathersjs/feathers/issues/2135)) ([cc3521c](https://github.com/feathersjs/feathers/commit/cc3521c935a1cbd690e29b7057998e3898f282db))
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
diff --git a/packages/authentication-oauth/package.json b/packages/authentication-oauth/package.json
index 0372cf710a..0553704f2e 100644
--- a/packages/authentication-oauth/package.json
+++ b/packages/authentication-oauth/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/authentication-oauth",
"description": "oAuth 1 and 2 authentication for Feathers. Powered by Grant.",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "lib/",
@@ -52,11 +52,11 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/authentication": "^4.5.10",
- "@feathersjs/errors": "^4.5.10",
- "@feathersjs/express": "^4.5.10",
- "@feathersjs/feathers": "^4.5.10",
- "debug": "^4.2.0",
+ "@feathersjs/authentication": "^4.5.11",
+ "@feathersjs/errors": "^4.5.11",
+ "@feathersjs/express": "^4.5.11",
+ "@feathersjs/feathers": "^4.5.11",
+ "debug": "^4.3.1",
"express-session": "^1.17.1",
"grant": "^4.7.0",
"grant-profile": "^0.0.11",
@@ -64,16 +64,16 @@
},
"devDependencies": {
"@types/debug": "^4.1.5",
- "@types/express": "^4.17.8",
- "@types/express-session": "^1.17.0",
- "@types/lodash": "^4.14.164",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.14.6",
+ "@types/express": "^4.17.9",
+ "@types/express-session": "^1.17.3",
+ "@types/lodash": "^4.14.165",
+ "@types/mocha": "^8.0.4",
+ "@types/node": "^14.14.10",
"axios": "^0.21.0",
"mocha": "^8.2.1",
"shx": "^0.3.3",
- "ts-node": "^9.0.0",
- "typescript": "^4.0.5"
+ "ts-node": "^9.1.0",
+ "typescript": "^4.1.2"
},
"gitHead": "9b9f0f13387341bdd320f1e66feda828fca2c9f2"
}
diff --git a/packages/authentication-oauth/src/express.ts b/packages/authentication-oauth/src/express.ts
index 4d1fbf4294..6401353f92 100644
--- a/packages/authentication-oauth/src/express.ts
+++ b/packages/authentication-oauth/src/express.ts
@@ -15,6 +15,15 @@ import { OAuthStrategy } from './strategy';
const grant = grantExpress();
const debug = Debug('@feathersjs/authentication-oauth/express');
+declare module 'express-session' {
+ interface SessionData {
+ redirect: string;
+ accessToken: string;
+ query: { [key: string]: any };
+ grant: { [key: string]: any };
+ }
+}
+
export default (options: OauthSetupSettings) => {
return (feathersApp: Application) => {
const { authService, linkStrategy } = options;
@@ -43,9 +52,9 @@ export default (options: OauthSetupSettings) => {
if (feathers_token) {
debug(`Got feathers_token query parameter to link accounts`, feathers_token);
- req.session.accessToken = feathers_token;
+ req.session.accessToken = feathers_token as string;
}
- req.session.redirect = redirect;
+ req.session.redirect = redirect as string;
req.session.query = query;
res.redirect(`${path}/connect/${name}?${qs.stringify(query as any)}`);
@@ -95,7 +104,7 @@ export default (options: OauthSetupSettings) => {
...payload
};
- await new Promise((resolve, reject) => {
+ await new Promise((resolve, reject) => {
if (!req.session.destroy) {
req.session = null;
resolve();
diff --git a/packages/authentication-oauth/test/express.test.ts b/packages/authentication-oauth/test/express.test.ts
index 967be8f2f6..af0a0c8848 100644
--- a/packages/authentication-oauth/test/express.test.ts
+++ b/packages/authentication-oauth/test/express.test.ts
@@ -9,7 +9,7 @@ describe('@feathersjs/authentication-oauth/express', () => {
before(async () => {
server = app.listen(9876);
- await new Promise(resolve => server.once('listening', () => resolve()));
+ await new Promise(resolve => server.once('listening', () => resolve()));
});
after(() => server.close());
diff --git a/packages/authentication/CHANGELOG.md b/packages/authentication/CHANGELOG.md
index 65f634079e..bfb5e70a7e 100644
--- a/packages/authentication/CHANGELOG.md
+++ b/packages/authentication/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/authentication
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
diff --git a/packages/authentication/package.json b/packages/authentication/package.json
index 4cb0bb4fff..f2707b0852 100644
--- a/packages/authentication/package.json
+++ b/packages/authentication/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/authentication",
"description": "Add Authentication to your FeathersJS app.",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "lib/",
@@ -52,11 +52,11 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/errors": "^4.5.10",
- "@feathersjs/feathers": "^4.5.10",
- "@feathersjs/transport-commons": "^4.5.10",
+ "@feathersjs/errors": "^4.5.11",
+ "@feathersjs/feathers": "^4.5.11",
+ "@feathersjs/transport-commons": "^4.5.11",
"@types/jsonwebtoken": "^8.5.0",
- "debug": "^4.2.0",
+ "debug": "^4.3.1",
"jsonwebtoken": "^8.5.1",
"lodash": "^4.17.20",
"long-timeout": "^0.1.1",
@@ -64,15 +64,15 @@
},
"devDependencies": {
"@types/debug": "^4.1.5",
- "@types/lodash": "^4.14.164",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.14.6",
+ "@types/lodash": "^4.14.165",
+ "@types/mocha": "^8.0.4",
+ "@types/node": "^14.14.10",
"@types/uuid": "^8.3.0",
"feathers-memory": "^4.1.0",
"mocha": "^8.2.1",
"shx": "^0.3.3",
- "ts-node": "^9.0.0",
- "typescript": "^4.0.5"
+ "ts-node": "^9.1.0",
+ "typescript": "^4.1.2"
},
"gitHead": "9b9f0f13387341bdd320f1e66feda828fca2c9f2"
}
diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md
index 7450358d4a..efa0be0cee 100644
--- a/packages/client/CHANGELOG.md
+++ b/packages/client/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/client
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
diff --git a/packages/client/package.json b/packages/client/package.json
index f82f172e9b..e200d022dc 100644
--- a/packages/client/package.json
+++ b/packages/client/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/client",
"description": "A module that consolidates Feathers client modules for REST (jQuery, Request, Superagent) and Websocket (Socket.io, Primus) connections",
- "version": "4.5.10",
+ "version": "4.5.11",
"repository": {
"type": "git",
"url": "https://github.com/feathersjs/feathers.git"
@@ -49,19 +49,19 @@
"IE 10"
],
"devDependencies": {
- "@babel/core": "^7.12.3",
- "@babel/preset-env": "^7.12.1",
- "@feathersjs/authentication-client": "^4.5.10",
- "@feathersjs/errors": "^4.5.10",
- "@feathersjs/express": "^4.5.10",
- "@feathersjs/feathers": "^4.5.10",
- "@feathersjs/primus": "^4.5.10",
- "@feathersjs/primus-client": "^4.5.10",
- "@feathersjs/rest-client": "^4.5.10",
- "@feathersjs/socketio": "^4.5.10",
- "@feathersjs/socketio-client": "^4.5.10",
- "@feathersjs/tests": "^4.5.10",
- "babel-loader": "^8.1.0",
+ "@babel/core": "^7.12.9",
+ "@babel/preset-env": "^7.12.7",
+ "@feathersjs/authentication-client": "^4.5.11",
+ "@feathersjs/errors": "^4.5.11",
+ "@feathersjs/express": "^4.5.11",
+ "@feathersjs/feathers": "^4.5.11",
+ "@feathersjs/primus": "^4.5.11",
+ "@feathersjs/primus-client": "^4.5.11",
+ "@feathersjs/rest-client": "^4.5.11",
+ "@feathersjs/socketio": "^4.5.11",
+ "@feathersjs/socketio-client": "^4.5.11",
+ "@feathersjs/tests": "^4.5.11",
+ "babel-loader": "^8.2.2",
"body-parser": "^1.19.0",
"feathers-memory": "^4.1.0",
"jquery": "^3.5.1",
@@ -74,9 +74,9 @@
"socket.io-client": "^2.3.1",
"superagent": "^6.1.0",
"uglifyjs-webpack-plugin": "^2.2.0",
- "webpack": "^5.4.0",
- "webpack-merge": "^5.3.0",
- "ws": "^7.3.1",
+ "webpack": "^5.10.0",
+ "webpack-merge": "^5.4.0",
+ "ws": "^7.4.1",
"xhr2": "^0.2.0"
},
"gitHead": "9b9f0f13387341bdd320f1e66feda828fca2c9f2"
diff --git a/packages/commons/CHANGELOG.md b/packages/commons/CHANGELOG.md
index 50b9d1d269..9a6fe2a3dd 100644
--- a/packages/commons/CHANGELOG.md
+++ b/packages/commons/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/commons
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
**Note:** Version bump only for package @feathersjs/commons
diff --git a/packages/commons/package.json b/packages/commons/package.json
index f6b105af24..9ca1ab8b3d 100644
--- a/packages/commons/package.json
+++ b/packages/commons/package.json
@@ -1,6 +1,6 @@
{
"name": "@feathersjs/commons",
- "version": "4.5.10",
+ "version": "4.5.11",
"description": "Shared Feathers utility functions",
"homepage": "https://feathersjs.com",
"keywords": [
@@ -50,12 +50,12 @@
"access": "public"
},
"devDependencies": {
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.14.6",
+ "@types/mocha": "^8.0.4",
+ "@types/node": "^14.14.10",
"mocha": "^8.2.1",
"shx": "^0.3.3",
- "ts-node": "^9.0.0",
- "typescript": "^4.0.5"
+ "ts-node": "^9.1.0",
+ "typescript": "^4.1.2"
},
"gitHead": "9b9f0f13387341bdd320f1e66feda828fca2c9f2"
}
diff --git a/packages/configuration/CHANGELOG.md b/packages/configuration/CHANGELOG.md
index 09bf49fcea..600c6c38b9 100644
--- a/packages/configuration/CHANGELOG.md
+++ b/packages/configuration/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/configuration
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
**Note:** Version bump only for package @feathersjs/configuration
diff --git a/packages/configuration/package.json b/packages/configuration/package.json
index b8624b45cd..8855455730 100644
--- a/packages/configuration/package.json
+++ b/packages/configuration/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/configuration",
"description": "A small configuration module for your Feathers application.",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "lib/",
@@ -57,19 +57,19 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/feathers": "^4.5.10",
- "config": "^3.3.2",
- "debug": "^4.2.0"
+ "@feathersjs/feathers": "^4.5.11",
+ "config": "^3.3.3",
+ "debug": "^4.3.1"
},
"devDependencies": {
- "@types/config": "^0.0.36",
+ "@types/config": "^0.0.37",
"@types/debug": "^4.1.5",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.14.6",
+ "@types/mocha": "^8.0.4",
+ "@types/node": "^14.14.10",
"mocha": "^8.2.1",
"shx": "^0.3.3",
- "ts-node": "^9.0.0",
- "typescript": "^4.0.5"
+ "ts-node": "^9.1.0",
+ "typescript": "^4.1.2"
},
"gitHead": "9b9f0f13387341bdd320f1e66feda828fca2c9f2"
}
diff --git a/packages/errors/CHANGELOG.md b/packages/errors/CHANGELOG.md
index 85dcf6a2ae..7aa5d75bf8 100644
--- a/packages/errors/CHANGELOG.md
+++ b/packages/errors/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+
+### Bug Fixes
+
+* **typescript:** Fix `data` property definition in @feathersjs/errors ([#2018](https://github.com/feathersjs/feathers/issues/2018)) ([ef1398c](https://github.com/feathersjs/feathers/commit/ef1398cd5b19efa50929e8c9511ca5684a18997f))
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
**Note:** Version bump only for package @feathersjs/errors
diff --git a/packages/errors/index.d.ts b/packages/errors/index.d.ts
index ae1dff39e9..4c43f46427 100644
--- a/packages/errors/index.d.ts
+++ b/packages/errors/index.d.ts
@@ -3,14 +3,14 @@ export interface FeathersErrorJSON {
readonly message: string;
readonly code: number;
readonly className: string;
- readonly data: any;
+ readonly data?: any;
readonly errors: any;
}
export class FeathersError extends Error {
readonly code: number;
readonly className: string;
- readonly data: any;
+ readonly data?: unknown;
readonly errors: any;
constructor (msg: string | Error, name: string, code: number, className: string, data: any);
toJSON (): FeathersErrorJSON;
diff --git a/packages/errors/package.json b/packages/errors/package.json
index b57e02ae6b..d177e2c19b 100644
--- a/packages/errors/package.json
+++ b/packages/errors/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/errors",
"description": "Common error types for Feathers apps",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/index",
"types": "index.d.ts",
@@ -45,10 +45,10 @@
"access": "public"
},
"dependencies": {
- "debug": "^4.2.0"
+ "debug": "^4.3.1"
},
"devDependencies": {
- "@feathersjs/feathers": "^4.5.10",
+ "@feathersjs/feathers": "^4.5.11",
"express": "^4.17.1",
"mocha": "^8.2.1"
},
diff --git a/packages/express/CHANGELOG.md b/packages/express/CHANGELOG.md
index e174a9aadd..6802458075 100644
--- a/packages/express/CHANGELOG.md
+++ b/packages/express/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/express
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
diff --git a/packages/express/package.json b/packages/express/package.json
index 4c59cb9540..7a60ccba41 100644
--- a/packages/express/package.json
+++ b/packages/express/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/express",
"description": "Feathers Express framework bindings and REST provider",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "index.d.ts",
@@ -49,19 +49,19 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/commons": "^4.5.10",
- "@feathersjs/errors": "^4.5.10",
- "@types/express": "^4.17.8",
- "debug": "^4.2.0",
+ "@feathersjs/commons": "^4.5.11",
+ "@feathersjs/errors": "^4.5.11",
+ "@types/express": "^4.17.9",
+ "debug": "^4.3.1",
"express": "^4.17.1",
"lodash": "^4.17.20",
"uberproto": "^2.0.6"
},
"devDependencies": {
- "@feathersjs/authentication": "^4.5.10",
- "@feathersjs/authentication-local": "^4.5.10",
- "@feathersjs/feathers": "^4.5.10",
- "@feathersjs/tests": "^4.5.10",
+ "@feathersjs/authentication": "^4.5.11",
+ "@feathersjs/authentication-local": "^4.5.11",
+ "@feathersjs/feathers": "^4.5.11",
+ "@feathersjs/tests": "^4.5.11",
"axios": "^0.21.0",
"lodash": "^4.17.20",
"mocha": "^8.2.1"
diff --git a/packages/feathers/CHANGELOG.md b/packages/feathers/CHANGELOG.md
index 5e53fab5ac..9fe5a8c79f 100644
--- a/packages/feathers/CHANGELOG.md
+++ b/packages/feathers/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/feathers
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
diff --git a/packages/feathers/package.json b/packages/feathers/package.json
index 5ab2a6d73a..a9122ef1fa 100644
--- a/packages/feathers/package.json
+++ b/packages/feathers/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/feathers",
"description": "A framework for real-time applications and REST API with JavaScript and TypeScript",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "http://feathersjs.com",
"repository": {
"type": "git",
@@ -54,8 +54,8 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/commons": "^4.5.10",
- "debug": "^4.2.0",
+ "@feathersjs/commons": "^4.5.11",
+ "debug": "^4.3.1",
"events": "^3.2.0",
"uberproto": "^2.0.6"
},
diff --git a/packages/primus-client/CHANGELOG.md b/packages/primus-client/CHANGELOG.md
index df704877ec..1f821c204e 100644
--- a/packages/primus-client/CHANGELOG.md
+++ b/packages/primus-client/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/primus-client
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
**Note:** Version bump only for package @feathersjs/primus-client
diff --git a/packages/primus-client/package.json b/packages/primus-client/package.json
index c86be49dc0..9c41188bf1 100644
--- a/packages/primus-client/package.json
+++ b/packages/primus-client/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/primus-client",
"description": "Client services for Primus and feathers-primus",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/index.js",
"types": "index.d.ts",
@@ -49,16 +49,16 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/transport-commons": "^4.5.10"
+ "@feathersjs/transport-commons": "^4.5.11"
},
"devDependencies": {
- "@feathersjs/commons": "^4.5.10",
- "@feathersjs/feathers": "^4.5.10",
- "@feathersjs/primus": "^4.5.10",
- "@feathersjs/tests": "^4.5.10",
+ "@feathersjs/commons": "^4.5.11",
+ "@feathersjs/feathers": "^4.5.11",
+ "@feathersjs/primus": "^4.5.11",
+ "@feathersjs/tests": "^4.5.11",
"feathers-memory": "^4.1.0",
"mocha": "^8.2.1",
- "ws": "^7.3.1"
+ "ws": "^7.4.1"
},
"gitHead": "9b9f0f13387341bdd320f1e66feda828fca2c9f2"
}
diff --git a/packages/primus/CHANGELOG.md b/packages/primus/CHANGELOG.md
index 51a36f065b..bf91853450 100644
--- a/packages/primus/CHANGELOG.md
+++ b/packages/primus/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/primus
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
**Note:** Version bump only for package @feathersjs/primus
diff --git a/packages/primus/package.json b/packages/primus/package.json
index 0ea430e428..9686b2cf00 100644
--- a/packages/primus/package.json
+++ b/packages/primus/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/primus",
"description": "The Feathers Primus real-time API provider",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "index.d.ts",
@@ -49,21 +49,21 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/transport-commons": "^4.5.10",
- "debug": "^4.2.0",
+ "@feathersjs/transport-commons": "^4.5.11",
+ "debug": "^4.3.1",
"primus": "^8.0.0",
"primus-emitter": "^3.1.1",
"uberproto": "^2.0.6"
},
"devDependencies": {
- "@feathersjs/commons": "^4.5.10",
- "@feathersjs/express": "^4.5.10",
- "@feathersjs/feathers": "^4.5.10",
- "@feathersjs/tests": "^4.5.10",
+ "@feathersjs/commons": "^4.5.11",
+ "@feathersjs/express": "^4.5.11",
+ "@feathersjs/feathers": "^4.5.11",
+ "@feathersjs/tests": "^4.5.11",
"feathers-memory": "^4.1.0",
"lodash": "^4.17.20",
"mocha": "^8.2.1",
- "ws": "^7.3.1"
+ "ws": "^7.4.1"
},
"gitHead": "9b9f0f13387341bdd320f1e66feda828fca2c9f2"
}
diff --git a/packages/rest-client/CHANGELOG.md b/packages/rest-client/CHANGELOG.md
index 3c5c50eb34..3d5a65ed3d 100644
--- a/packages/rest-client/CHANGELOG.md
+++ b/packages/rest-client/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/rest-client
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
**Note:** Version bump only for package @feathersjs/rest-client
diff --git a/packages/rest-client/package.json b/packages/rest-client/package.json
index c2fa2856a2..d7251099de 100644
--- a/packages/rest-client/package.json
+++ b/packages/rest-client/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/rest-client",
"description": "REST client services for different Ajax libraries",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/index.js",
"types": "index.d.ts",
@@ -49,18 +49,18 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/commons": "^4.5.10",
- "@feathersjs/errors": "^4.5.10",
+ "@feathersjs/commons": "^4.5.11",
+ "@feathersjs/errors": "^4.5.11",
"qs": "^6.9.4"
},
"devDependencies": {
- "@angular/common": "^10.2.2",
- "@angular/core": "^10.2.2",
+ "@angular/common": "^11.0.3",
+ "@angular/core": "^11.0.3",
"@angular/http": "^7.2.16",
- "@angular/platform-browser": "^10.2.2",
- "@feathersjs/express": "^4.5.10",
- "@feathersjs/feathers": "^4.5.10",
- "@feathersjs/tests": "^4.5.10",
+ "@angular/platform-browser": "^11.0.3",
+ "@feathersjs/express": "^4.5.11",
+ "@feathersjs/feathers": "^4.5.11",
+ "@feathersjs/tests": "^4.5.11",
"axios": "^0.21.0",
"body-parser": "^1.19.0",
"feathers-memory": "^4.1.0",
diff --git a/packages/socketio-client/CHANGELOG.md b/packages/socketio-client/CHANGELOG.md
index 81366feb0f..c5d7f933aa 100644
--- a/packages/socketio-client/CHANGELOG.md
+++ b/packages/socketio-client/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+
+### Bug Fixes
+
+* **socketio-client:** Throw an error and show a warning if someone tries to use socket.io-client v3 ([#2135](https://github.com/feathersjs/feathers/issues/2135)) ([cc3521c](https://github.com/feathersjs/feathers/commit/cc3521c935a1cbd690e29b7057998e3898f282db))
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
**Note:** Version bump only for package @feathersjs/socketio-client
diff --git a/packages/socketio-client/lib/index.js b/packages/socketio-client/lib/index.js
index e31ec04f8f..23f8e5c89a 100644
--- a/packages/socketio-client/lib/index.js
+++ b/packages/socketio-client/lib/index.js
@@ -5,6 +5,15 @@ function socketioClient (connection, options) {
throw new Error('Socket.io connection needs to be provided');
}
+ if (connection && connection.io && connection.io.engine &&
+ connection.io.engine.transport && connection.io.engine.transport.query &&
+ connection.io.engine.transport.query.EIO > 3
+ ) {
+ // tslint:disable-next-line
+ console.error('You are trying to use the Socket.io client version 3 or later with Feathers v4 which only supports Socket.io version 2. Please use socket.io-client version 2 instead.');
+ throw new Error('socket.io-client must be version 2.x');
+ }
+
const defaultService = function (name) {
const events = Object.keys(this.eventMappings || {})
.map(method => this.eventMappings[method]);
diff --git a/packages/socketio-client/package.json b/packages/socketio-client/package.json
index 64c2610d9b..3470bb2213 100644
--- a/packages/socketio-client/package.json
+++ b/packages/socketio-client/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/socketio-client",
"description": "The client for Socket.io through feathers-socketio",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/index.js",
"types": "index.d.ts",
@@ -40,14 +40,14 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/transport-commons": "^4.5.10",
+ "@feathersjs/transport-commons": "^4.5.11",
"@types/socket.io-client": "^1.4.34"
},
"devDependencies": {
- "@feathersjs/commons": "^4.5.10",
- "@feathersjs/feathers": "^4.5.10",
- "@feathersjs/socketio": "^4.5.10",
- "@feathersjs/tests": "^4.5.10",
+ "@feathersjs/commons": "^4.5.11",
+ "@feathersjs/feathers": "^4.5.11",
+ "@feathersjs/socketio": "^4.5.11",
+ "@feathersjs/tests": "^4.5.11",
"feathers-memory": "^4.1.0",
"mocha": "^8.2.1",
"socket.io-client": "^2.3.1"
diff --git a/packages/socketio/CHANGELOG.md b/packages/socketio/CHANGELOG.md
index 71dcc554f1..d0d1f66982 100644
--- a/packages/socketio/CHANGELOG.md
+++ b/packages/socketio/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/socketio
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
**Note:** Version bump only for package @feathersjs/socketio
diff --git a/packages/socketio/package.json b/packages/socketio/package.json
index 0a55f3ea7d..f05884836a 100644
--- a/packages/socketio/package.json
+++ b/packages/socketio/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/socketio",
"description": "The Feathers Socket.io real-time API provider",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "index.d.ts",
@@ -49,20 +49,20 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/transport-commons": "^4.5.10",
+ "@feathersjs/transport-commons": "^4.5.11",
"@types/socket.io": "^2.1.11",
- "debug": "^4.2.0",
+ "debug": "^4.3.1",
"socket.io": "^2.3.0",
"uberproto": "^2.0.6"
},
"devDependencies": {
- "@feathersjs/commons": "^4.5.10",
- "@feathersjs/express": "^4.5.10",
- "@feathersjs/feathers": "^4.5.10",
- "@feathersjs/tests": "^4.5.10",
- "@types/mocha": "^8.0.3",
- "@types/mongodb": "^3.5.32",
- "@types/node": "^14.14.6",
+ "@feathersjs/commons": "^4.5.11",
+ "@feathersjs/express": "^4.5.11",
+ "@feathersjs/feathers": "^4.5.11",
+ "@feathersjs/tests": "^4.5.11",
+ "@types/mocha": "^8.0.4",
+ "@types/mongodb": "^3.6.1",
+ "@types/node": "^14.14.10",
"feathers-memory": "^4.1.0",
"lodash": "^4.17.20",
"mocha": "^8.2.1",
diff --git a/packages/tests/CHANGELOG.md b/packages/tests/CHANGELOG.md
index 7eeaa06937..7c618a523f 100644
--- a/packages/tests/CHANGELOG.md
+++ b/packages/tests/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+**Note:** Version bump only for package @feathersjs/tests
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
**Note:** Version bump only for package @feathersjs/tests
diff --git a/packages/tests/package.json b/packages/tests/package.json
index d5f5d062da..bb441c544e 100644
--- a/packages/tests/package.json
+++ b/packages/tests/package.json
@@ -2,7 +2,7 @@
"name": "@feathersjs/tests",
"private": true,
"description": "Feathers core module common tests",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/",
"keywords": [
@@ -46,15 +46,15 @@
"lodash": "^4.17.20"
},
"devDependencies": {
- "@feathersjs/feathers": "^4.5.10",
+ "@feathersjs/feathers": "^4.5.11",
"@types/axios": "^0.14.0",
"@types/debug": "^4.1.5",
- "@types/lodash": "^4.14.164",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.14.6",
+ "@types/lodash": "^4.14.165",
+ "@types/mocha": "^8.0.4",
+ "@types/node": "^14.14.10",
"mocha": "^8.2.1",
"shx": "^0.3.3",
- "ts-node": "^9.0.0",
- "typescript": "^4.0.5"
+ "ts-node": "^9.1.0",
+ "typescript": "^4.1.2"
}
}
diff --git a/packages/transport-commons/CHANGELOG.md b/packages/transport-commons/CHANGELOG.md
index 1f40afb56a..6678c7a4d9 100644
--- a/packages/transport-commons/CHANGELOG.md
+++ b/packages/transport-commons/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05)
+
+
+### Bug Fixes
+
+* **socketio-client:** Throw an error and show a warning if someone tries to use socket.io-client v3 ([#2135](https://github.com/feathersjs/feathers/issues/2135)) ([cc3521c](https://github.com/feathersjs/feathers/commit/cc3521c935a1cbd690e29b7057998e3898f282db))
+
+
+
+
+
## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08)
**Note:** Version bump only for package @feathersjs/transport-commons
diff --git a/packages/transport-commons/package.json b/packages/transport-commons/package.json
index ab8d0a2354..f490b3206e 100644
--- a/packages/transport-commons/package.json
+++ b/packages/transport-commons/package.json
@@ -1,7 +1,7 @@
{
"name": "@feathersjs/transport-commons",
"description": "Shared functionality for websocket providers",
- "version": "4.5.10",
+ "version": "4.5.11",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "lib/",
@@ -43,21 +43,21 @@
"access": "public"
},
"dependencies": {
- "@feathersjs/commons": "^4.5.10",
- "@feathersjs/errors": "^4.5.10",
- "debug": "^4.2.0",
+ "@feathersjs/commons": "^4.5.11",
+ "@feathersjs/errors": "^4.5.11",
+ "debug": "^4.3.1",
"lodash": "^4.17.20",
"radix-router": "^3.0.1"
},
"devDependencies": {
- "@feathersjs/feathers": "^4.5.10",
+ "@feathersjs/feathers": "^4.5.11",
"@types/debug": "^4.1.5",
- "@types/mocha": "^8.0.3",
- "@types/node": "^14.14.6",
+ "@types/mocha": "^8.0.4",
+ "@types/node": "^14.14.10",
"mocha": "^8.2.1",
"shx": "^0.3.3",
- "ts-node": "^9.0.0",
- "typescript": "^4.0.5"
+ "ts-node": "^9.1.0",
+ "typescript": "^4.1.2"
},
"gitHead": "9b9f0f13387341bdd320f1e66feda828fca2c9f2"
}
diff --git a/packages/transport-commons/test/channels/channel.test.ts b/packages/transport-commons/test/channels/channel.test.ts
index 07fb1bd439..e56c15eef2 100644
--- a/packages/transport-commons/test/channels/channel.test.ts
+++ b/packages/transport-commons/test/channels/channel.test.ts
@@ -104,7 +104,7 @@ describe('app.channel', () => {
it('is an EventEmitter', () => {
const channel = app.channel('emitchannel');
- return new Promise((resolve) => {
+ return new Promise((resolve) => {
channel.once('message', data => {
assert.strictEqual(data, 'hello');
resolve();