kuzzle 2.60.0-beta.3 → 2.60.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/lib/api/controllers/adminController.d.ts +7 -1
  2. package/dist/lib/api/controllers/adminController.js +9 -2
  3. package/dist/lib/api/controllers/documentController.d.ts +1 -1
  4. package/dist/lib/api/funnel.js +12 -1
  5. package/dist/lib/api/httpRoutes.js +52 -20
  6. package/dist/lib/api/request/kuzzleRequest.d.ts +7 -2
  7. package/dist/lib/api/request/kuzzleRequest.js +20 -10
  8. package/dist/lib/api/request/requestContext.d.ts +1 -1
  9. package/dist/lib/api/request/requestResponse.js +2 -1
  10. package/dist/lib/cluster/command.d.ts +7 -0
  11. package/dist/lib/cluster/command.js +67 -28
  12. package/dist/lib/cluster/node.d.ts +13 -2
  13. package/dist/lib/cluster/node.js +20 -4
  14. package/dist/lib/cluster/subscriber.d.ts +2 -0
  15. package/dist/lib/cluster/subscriber.js +6 -0
  16. package/dist/lib/config/index.js +60 -3
  17. package/dist/lib/core/backend/backend.d.ts +4 -3
  18. package/dist/lib/core/backend/backend.js +15 -15
  19. package/dist/lib/core/backend/backendCluster.d.ts +1 -1
  20. package/dist/lib/core/backend/internalLogger.d.ts +6 -0
  21. package/dist/lib/core/backend/internalLogger.js +6 -0
  22. package/dist/lib/core/network/router.d.ts +18 -0
  23. package/dist/lib/core/network/router.js +44 -10
  24. package/dist/lib/core/security/authTokenSettings.d.ts +21 -0
  25. package/dist/lib/core/security/authTokenSettings.js +61 -0
  26. package/dist/lib/core/security/tokenRepository.js +8 -14
  27. package/dist/lib/core/shared/KoncordeWrapper.d.ts +9 -0
  28. package/dist/lib/core/shared/KoncordeWrapper.js +8 -8
  29. package/dist/lib/core/shared/store.js +4 -0
  30. package/dist/lib/core/storage/clientAdapter.d.ts +6 -0
  31. package/dist/lib/core/storage/clientAdapter.js +40 -5
  32. package/dist/lib/kuzzle/Logger.d.ts +4 -0
  33. package/dist/lib/kuzzle/Logger.js +9 -2
  34. package/dist/lib/kuzzle/internalIndexHandler.js +28 -11
  35. package/dist/lib/kuzzle/kuzzle.d.ts +17 -0
  36. package/dist/lib/kuzzle/kuzzle.js +62 -0
  37. package/dist/lib/kuzzle/vault.d.ts +13 -0
  38. package/dist/lib/kuzzle/vault.js +25 -7
  39. package/dist/lib/model/security/profile.d.ts +1 -1
  40. package/dist/lib/model/security/role.d.ts +1 -1
  41. package/dist/lib/model/security/user.d.ts +1 -1
  42. package/dist/lib/service/storage/7/elasticsearch.d.ts +18 -0
  43. package/dist/lib/service/storage/7/elasticsearch.js +50 -10
  44. package/dist/lib/service/storage/7/esWrapper.js +31 -2
  45. package/dist/lib/service/storage/8/elasticsearch.d.ts +18 -0
  46. package/dist/lib/service/storage/8/elasticsearch.js +50 -10
  47. package/dist/lib/service/storage/8/esWrapper.js +31 -2
  48. package/dist/lib/types/config/KuzzleConfiguration.d.ts +7 -0
  49. package/dist/lib/types/config/SecurityConfiguration.d.ts +4 -3
  50. package/dist/lib/types/controllers/ControllerDefinition.d.ts +4 -4
  51. package/dist/lib/types/events/EventGenericDocument.d.ts +2 -1
  52. package/dist/lib/types/events/EventProtocol.d.ts +1 -1
  53. package/dist/lib/util/mutex.d.ts +5 -4
  54. package/dist/lib/util/mutex.js +8 -2
  55. package/dist/package.json +1 -1
  56. package/package.json +1 -1
@@ -165,6 +165,11 @@ class Mutex {
165
165
  * @return {Promise}
166
166
  */
167
167
  async unlock() {
168
+ // `releaseAllBeforeExit` already gave this lock back: its holder is only
169
+ // catching up, and throwing would turn a requested shutdown into a crash.
170
+ if (!this._locked && exiting) {
171
+ return;
172
+ }
168
173
  if (!this._locked) {
169
174
  throw fatal.get("assertion_failed", `tried to unlock the resource "${this.resource}", which is not locked (mutex id: ${this.mutexId})`);
170
175
  }
@@ -191,7 +196,7 @@ class Mutex {
191
196
  *
192
197
  * @return {Promise.<boolean>} True if the ressource has been unlocked before the `timeout`
193
198
  */
194
- async wait({ attemptDelay = this.attemptDelay, timeout = this.timeout, }) {
199
+ async wait({ attemptDelay = this.attemptDelay, timeout = this.timeout, } = {}) {
195
200
  let duration = 0;
196
201
  let isLocked;
197
202
  do {
@@ -214,7 +219,8 @@ class Mutex {
214
219
  *
215
220
  * From then on, `lock()` never resolves: the process is about to exit, and
216
221
  * answering `false` would send its caller down a path meant for a lock
217
- * held by another node.
222
+ * held by another node. And `unlock()` on a lock it already freed resolves
223
+ * without doing anything, since its holder may still try to give it back.
218
224
  */
219
225
  static async releaseAllBeforeExit() {
220
226
  exiting = true;
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kuzzle",
3
3
  "author": "The Kuzzle Team <support@kuzzle.io>",
4
- "version": "2.60.0-beta.3",
4
+ "version": "2.60.0-beta.5",
5
5
  "description": "Kuzzle is an open-source solution that handles all the data management through a secured API, with a large choice of protocols.",
6
6
  "scripts": {
7
7
  "build": "rm -Rf ./dist && tsc && node -r ts-node/register/transpile-only ./bin/copy-binaries.ts",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kuzzle",
3
3
  "author": "The Kuzzle Team <support@kuzzle.io>",
4
- "version": "2.60.0-beta.3",
4
+ "version": "2.60.0-beta.5",
5
5
  "description": "Kuzzle is an open-source solution that handles all the data management through a secured API, with a large choice of protocols.",
6
6
  "scripts": {
7
7
  "build": "rm -Rf ./dist && tsc && node -r ts-node/register/transpile-only ./bin/copy-binaries.ts",