@adonisjs/lock 1.0.0-1 → 1.0.0-3

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.
package/build/index.js CHANGED
@@ -75,17 +75,10 @@ var stores = {
75
75
  // src/errors.ts
76
76
  var errors_exports = {};
77
77
  __export(errors_exports, {
78
- E_LOCK_ALREADY_ACQUIRED: () => E_LOCK_ALREADY_ACQUIRED,
79
78
  E_LOCK_NOT_OWNED: () => E_LOCK_NOT_OWNED,
80
- E_LOCK_STORAGE_ERROR: () => E_LOCK_STORAGE_ERROR,
81
- E_LOCK_TIMEOUT: () => E_LOCK_TIMEOUT
79
+ E_LOCK_STORAGE_ERROR: () => E_LOCK_STORAGE_ERROR
82
80
  });
83
- import {
84
- E_LOCK_TIMEOUT,
85
- E_LOCK_NOT_OWNED,
86
- E_LOCK_STORAGE_ERROR,
87
- E_LOCK_ALREADY_ACQUIRED
88
- } from "@verrou/core";
81
+ import { E_LOCK_NOT_OWNED, E_LOCK_STORAGE_ERROR } from "@verrou/core";
89
82
 
90
83
  // configure.ts
91
84
  import string from "@adonisjs/core/helpers/string";
@@ -13,7 +13,13 @@ var LockProvider = class {
13
13
  const { Verrou } = await import("@verrou/core");
14
14
  const config = this.app.config.get("lock", {});
15
15
  const stores = Object.entries(config.stores).map(async ([name, store]) => {
16
- return [name, await store.resolver(this.app)];
16
+ let resolvedStore;
17
+ if ("resolver" in store) {
18
+ resolvedStore = await store.resolver(this.app);
19
+ } else {
20
+ resolvedStore = store;
21
+ }
22
+ return [name, resolvedStore];
17
23
  });
18
24
  return new Verrou({
19
25
  default: config.default,
@@ -3,7 +3,7 @@ import type { ConfigProvider } from '@adonisjs/core/types';
3
3
  /**
4
4
  * Define lock configuration
5
5
  */
6
- export declare function defineConfig<KnownStores extends Record<string, ConfigProvider<StoreFactory>>>(config: {
6
+ export declare function defineConfig<KnownStores extends Record<string, ConfigProvider<StoreFactory> | StoreFactory>>(config: {
7
7
  default: keyof KnownStores;
8
8
  stores: KnownStores;
9
9
  }): {
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Re-exporting verrou errors
3
3
  */
4
- export { E_LOCK_TIMEOUT, E_LOCK_NOT_OWNED, E_LOCK_STORAGE_ERROR, E_LOCK_ALREADY_ACQUIRED, } from '@verrou/core';
4
+ export { E_LOCK_NOT_OWNED, E_LOCK_STORAGE_ERROR } from '@verrou/core';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/lock",
3
3
  "description": "Atomic locks (mutex) for AdonisJS applications",
4
- "version": "1.0.0-1",
4
+ "version": "1.0.0-3",
5
5
  "engines": {
6
6
  "node": ">=20.6.0"
7
7
  },
@@ -60,7 +60,7 @@
60
60
  "typescript": "^5.4.2"
61
61
  },
62
62
  "dependencies": {
63
- "@verrou/core": "^0.3.0"
63
+ "@verrou/core": "^0.4.0"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@adonisjs/assembler": "^7.0.0",