@zukhruf/mutex 0.3.39 → 0.3.41
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/README.md +26 -14
- package/dist/index.d.ts +0 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -15
- package/dist/index.js.map +1 -1
- package/dist/lock-stores/docker/docker-engine-store.d.ts +37 -0
- package/dist/lock-stores/docker/docker-engine-store.d.ts.map +1 -0
- package/dist/lock-stores/docker/docker-engine-store.js +312 -0
- package/dist/lock-stores/docker/docker-engine-store.js.map +1 -0
- package/dist/lock-stores/docker/index.d.ts +2 -0
- package/dist/lock-stores/docker/index.d.ts.map +1 -0
- package/dist/lock-stores/docker/index.js +2 -0
- package/dist/lock-stores/docker/index.js.map +1 -0
- package/dist/lock-stores/file-system/index.d.ts +5 -0
- package/dist/lock-stores/file-system/index.d.ts.map +1 -0
- package/dist/lock-stores/file-system/index.js +5 -0
- package/dist/lock-stores/file-system/index.js.map +1 -0
- package/dist/lock-stores/ipc/index.d.ts +5 -0
- package/dist/lock-stores/ipc/index.d.ts.map +1 -0
- package/dist/lock-stores/ipc/index.js +5 -0
- package/dist/lock-stores/ipc/index.js.map +1 -0
- package/dist/lock-stores/mariadb/index.d.ts +2 -0
- package/dist/lock-stores/mariadb/index.d.ts.map +1 -0
- package/dist/lock-stores/mariadb/index.js +2 -0
- package/dist/lock-stores/mariadb/index.js.map +1 -0
- package/dist/lock-stores/mariadb/mariadb-store.d.ts +33 -0
- package/dist/lock-stores/mariadb/mariadb-store.d.ts.map +1 -0
- package/dist/lock-stores/mariadb/mariadb-store.js +36 -0
- package/dist/lock-stores/mariadb/mariadb-store.js.map +1 -0
- package/dist/lock-stores/memory/index.d.ts +2 -0
- package/dist/lock-stores/memory/index.d.ts.map +1 -0
- package/dist/lock-stores/memory/index.js +2 -0
- package/dist/lock-stores/memory/index.js.map +1 -0
- package/dist/lock-stores/mysql/get-lock-dialect.d.ts +46 -0
- package/dist/lock-stores/mysql/get-lock-dialect.d.ts.map +1 -0
- package/dist/lock-stores/mysql/get-lock-dialect.js +80 -0
- package/dist/lock-stores/mysql/get-lock-dialect.js.map +1 -0
- package/dist/lock-stores/mysql/index.d.ts +2 -0
- package/dist/lock-stores/mysql/index.d.ts.map +1 -0
- package/dist/lock-stores/mysql/index.js +2 -0
- package/dist/lock-stores/mysql/index.js.map +1 -0
- package/dist/lock-stores/mysql/mysql-store.d.ts +37 -0
- package/dist/lock-stores/mysql/mysql-store.d.ts.map +1 -0
- package/dist/lock-stores/mysql/mysql-store.js +35 -0
- package/dist/lock-stores/mysql/mysql-store.js.map +1 -0
- package/dist/lock-stores/postgres/index.d.ts +2 -0
- package/dist/lock-stores/postgres/index.d.ts.map +1 -0
- package/dist/lock-stores/postgres/index.js +2 -0
- package/dist/lock-stores/postgres/index.js.map +1 -0
- package/dist/lock-stores/postgres/postgres-store.d.ts +41 -0
- package/dist/lock-stores/postgres/postgres-store.d.ts.map +1 -0
- package/dist/lock-stores/postgres/postgres-store.js +83 -0
- package/dist/lock-stores/postgres/postgres-store.js.map +1 -0
- package/dist/lock-stores/session/session-lock-store.d.ts +72 -0
- package/dist/lock-stores/session/session-lock-store.d.ts.map +1 -0
- package/dist/lock-stores/session/session-lock-store.js +221 -0
- package/dist/lock-stores/session/session-lock-store.js.map +1 -0
- package/dist/lock-stores/socket/index.d.ts +7 -0
- package/dist/lock-stores/socket/index.d.ts.map +1 -0
- package/dist/lock-stores/socket/index.js +7 -0
- package/dist/lock-stores/socket/index.js.map +1 -0
- package/dist/lock-stores/sqlite/index.d.ts +4 -0
- package/dist/lock-stores/sqlite/index.d.ts.map +1 -0
- package/dist/lock-stores/sqlite/index.js +3 -0
- package/dist/lock-stores/sqlite/index.js.map +1 -0
- package/dist/lock-stores/sqlite/sqlite-store.d.ts.map +1 -1
- package/dist/lock-stores/sqlite/sqlite-store.js +6 -25
- package/dist/lock-stores/sqlite/sqlite-store.js.map +1 -1
- package/dist/lock-stores/sqlserver/index.d.ts +2 -0
- package/dist/lock-stores/sqlserver/index.d.ts.map +1 -0
- package/dist/lock-stores/sqlserver/index.js +2 -0
- package/dist/lock-stores/sqlserver/index.js.map +1 -0
- package/dist/lock-stores/sqlserver/sqlserver-store.d.ts +40 -0
- package/dist/lock-stores/sqlserver/sqlserver-store.d.ts.map +1 -0
- package/dist/lock-stores/sqlserver/sqlserver-store.js +104 -0
- package/dist/lock-stores/sqlserver/sqlserver-store.js.map +1 -0
- package/dist/lock-stores/thread/index.d.ts +5 -0
- package/dist/lock-stores/thread/index.d.ts.map +1 -0
- package/dist/lock-stores/thread/index.js +5 -0
- package/dist/lock-stores/thread/index.js.map +1 -0
- package/dist/shared/in-process-turns.d.ts +17 -0
- package/dist/shared/in-process-turns.d.ts.map +1 -0
- package/dist/shared/in-process-turns.js +39 -0
- package/dist/shared/in-process-turns.js.map +1 -0
- package/dist/shared/key-digest.d.ts +8 -0
- package/dist/shared/key-digest.d.ts.map +1 -0
- package/dist/shared/key-digest.js +11 -0
- package/dist/shared/key-digest.js.map +1 -0
- package/package.json +30 -8
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
/**
|
|
3
|
+
* The SHA-256 digest of the UTF-16 code units of `key`. The code units, not
|
|
4
|
+
* UTF-8, so that keys that differ only in a lone surrogate get different
|
|
5
|
+
* digests. Each lock store encodes the digest in the form that its server
|
|
6
|
+
* takes.
|
|
7
|
+
*/
|
|
8
|
+
export function keyDigest(key) {
|
|
9
|
+
return createHash('sha256').update(Buffer.from(key, 'utf16le')).digest();
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=key-digest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-digest.js","sourceRoot":"","sources":["../../src/shared/key-digest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AAC3E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/mutex",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.41",
|
|
4
4
|
"description": "A mutex with interchangeable lock stores, from one object to every process on a host, with fencing tokens on every lease.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -26,6 +26,14 @@
|
|
|
26
26
|
"types": "./dist/index.d.ts",
|
|
27
27
|
"import": "./dist/index.js",
|
|
28
28
|
"default": "./dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./remote": null,
|
|
31
|
+
"./session": null,
|
|
32
|
+
"./*": {
|
|
33
|
+
"@zukhruf/source": "./src/lock-stores/*/index.ts",
|
|
34
|
+
"types": "./dist/lock-stores/*/index.d.ts",
|
|
35
|
+
"import": "./dist/lock-stores/*/index.js",
|
|
36
|
+
"default": "./dist/lock-stores/*/index.js"
|
|
29
37
|
}
|
|
30
38
|
},
|
|
31
39
|
"files": [
|
|
@@ -38,14 +46,28 @@
|
|
|
38
46
|
"access": "public"
|
|
39
47
|
},
|
|
40
48
|
"dependencies": {
|
|
41
|
-
"@zukhruf/async": "^0.3.
|
|
42
|
-
"@zukhruf/election": "^0.3.
|
|
43
|
-
"@zukhruf/fencing": "^0.3.
|
|
44
|
-
"@zukhruf/fs": "^0.3.
|
|
45
|
-
"@zukhruf/lease": "^0.3.
|
|
49
|
+
"@zukhruf/async": "^0.3.41",
|
|
50
|
+
"@zukhruf/election": "^0.3.41",
|
|
51
|
+
"@zukhruf/fencing": "^0.3.41",
|
|
52
|
+
"@zukhruf/fs": "^0.3.41",
|
|
53
|
+
"@zukhruf/lease": "^0.3.41"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@zukhruf/docker": "^0.3.41"
|
|
57
|
+
},
|
|
58
|
+
"peerDependenciesMeta": {
|
|
59
|
+
"@zukhruf/docker": {
|
|
60
|
+
"optional": true
|
|
61
|
+
}
|
|
46
62
|
},
|
|
47
63
|
"devDependencies": {
|
|
48
|
-
"@
|
|
49
|
-
"
|
|
64
|
+
"@types/pg": "^8.23.1",
|
|
65
|
+
"@zukhruf/docker": "^0.3.41",
|
|
66
|
+
"@zukhruf/testing": "^0.3.41",
|
|
67
|
+
"hono": "^4.13.13",
|
|
68
|
+
"mariadb": "^3.5.4",
|
|
69
|
+
"mysql2": "^3.24.5",
|
|
70
|
+
"pg": "^8.23.1",
|
|
71
|
+
"tedious": "^20.3.3"
|
|
50
72
|
}
|
|
51
73
|
}
|