@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.
Files changed (89) hide show
  1. package/README.md +26 -14
  2. package/dist/index.d.ts +0 -15
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +0 -15
  5. package/dist/index.js.map +1 -1
  6. package/dist/lock-stores/docker/docker-engine-store.d.ts +37 -0
  7. package/dist/lock-stores/docker/docker-engine-store.d.ts.map +1 -0
  8. package/dist/lock-stores/docker/docker-engine-store.js +312 -0
  9. package/dist/lock-stores/docker/docker-engine-store.js.map +1 -0
  10. package/dist/lock-stores/docker/index.d.ts +2 -0
  11. package/dist/lock-stores/docker/index.d.ts.map +1 -0
  12. package/dist/lock-stores/docker/index.js +2 -0
  13. package/dist/lock-stores/docker/index.js.map +1 -0
  14. package/dist/lock-stores/file-system/index.d.ts +5 -0
  15. package/dist/lock-stores/file-system/index.d.ts.map +1 -0
  16. package/dist/lock-stores/file-system/index.js +5 -0
  17. package/dist/lock-stores/file-system/index.js.map +1 -0
  18. package/dist/lock-stores/ipc/index.d.ts +5 -0
  19. package/dist/lock-stores/ipc/index.d.ts.map +1 -0
  20. package/dist/lock-stores/ipc/index.js +5 -0
  21. package/dist/lock-stores/ipc/index.js.map +1 -0
  22. package/dist/lock-stores/mariadb/index.d.ts +2 -0
  23. package/dist/lock-stores/mariadb/index.d.ts.map +1 -0
  24. package/dist/lock-stores/mariadb/index.js +2 -0
  25. package/dist/lock-stores/mariadb/index.js.map +1 -0
  26. package/dist/lock-stores/mariadb/mariadb-store.d.ts +33 -0
  27. package/dist/lock-stores/mariadb/mariadb-store.d.ts.map +1 -0
  28. package/dist/lock-stores/mariadb/mariadb-store.js +36 -0
  29. package/dist/lock-stores/mariadb/mariadb-store.js.map +1 -0
  30. package/dist/lock-stores/memory/index.d.ts +2 -0
  31. package/dist/lock-stores/memory/index.d.ts.map +1 -0
  32. package/dist/lock-stores/memory/index.js +2 -0
  33. package/dist/lock-stores/memory/index.js.map +1 -0
  34. package/dist/lock-stores/mysql/get-lock-dialect.d.ts +46 -0
  35. package/dist/lock-stores/mysql/get-lock-dialect.d.ts.map +1 -0
  36. package/dist/lock-stores/mysql/get-lock-dialect.js +80 -0
  37. package/dist/lock-stores/mysql/get-lock-dialect.js.map +1 -0
  38. package/dist/lock-stores/mysql/index.d.ts +2 -0
  39. package/dist/lock-stores/mysql/index.d.ts.map +1 -0
  40. package/dist/lock-stores/mysql/index.js +2 -0
  41. package/dist/lock-stores/mysql/index.js.map +1 -0
  42. package/dist/lock-stores/mysql/mysql-store.d.ts +37 -0
  43. package/dist/lock-stores/mysql/mysql-store.d.ts.map +1 -0
  44. package/dist/lock-stores/mysql/mysql-store.js +35 -0
  45. package/dist/lock-stores/mysql/mysql-store.js.map +1 -0
  46. package/dist/lock-stores/postgres/index.d.ts +2 -0
  47. package/dist/lock-stores/postgres/index.d.ts.map +1 -0
  48. package/dist/lock-stores/postgres/index.js +2 -0
  49. package/dist/lock-stores/postgres/index.js.map +1 -0
  50. package/dist/lock-stores/postgres/postgres-store.d.ts +41 -0
  51. package/dist/lock-stores/postgres/postgres-store.d.ts.map +1 -0
  52. package/dist/lock-stores/postgres/postgres-store.js +83 -0
  53. package/dist/lock-stores/postgres/postgres-store.js.map +1 -0
  54. package/dist/lock-stores/session/session-lock-store.d.ts +72 -0
  55. package/dist/lock-stores/session/session-lock-store.d.ts.map +1 -0
  56. package/dist/lock-stores/session/session-lock-store.js +221 -0
  57. package/dist/lock-stores/session/session-lock-store.js.map +1 -0
  58. package/dist/lock-stores/socket/index.d.ts +7 -0
  59. package/dist/lock-stores/socket/index.d.ts.map +1 -0
  60. package/dist/lock-stores/socket/index.js +7 -0
  61. package/dist/lock-stores/socket/index.js.map +1 -0
  62. package/dist/lock-stores/sqlite/index.d.ts +4 -0
  63. package/dist/lock-stores/sqlite/index.d.ts.map +1 -0
  64. package/dist/lock-stores/sqlite/index.js +3 -0
  65. package/dist/lock-stores/sqlite/index.js.map +1 -0
  66. package/dist/lock-stores/sqlite/sqlite-store.d.ts.map +1 -1
  67. package/dist/lock-stores/sqlite/sqlite-store.js +6 -25
  68. package/dist/lock-stores/sqlite/sqlite-store.js.map +1 -1
  69. package/dist/lock-stores/sqlserver/index.d.ts +2 -0
  70. package/dist/lock-stores/sqlserver/index.d.ts.map +1 -0
  71. package/dist/lock-stores/sqlserver/index.js +2 -0
  72. package/dist/lock-stores/sqlserver/index.js.map +1 -0
  73. package/dist/lock-stores/sqlserver/sqlserver-store.d.ts +40 -0
  74. package/dist/lock-stores/sqlserver/sqlserver-store.d.ts.map +1 -0
  75. package/dist/lock-stores/sqlserver/sqlserver-store.js +104 -0
  76. package/dist/lock-stores/sqlserver/sqlserver-store.js.map +1 -0
  77. package/dist/lock-stores/thread/index.d.ts +5 -0
  78. package/dist/lock-stores/thread/index.d.ts.map +1 -0
  79. package/dist/lock-stores/thread/index.js +5 -0
  80. package/dist/lock-stores/thread/index.js.map +1 -0
  81. package/dist/shared/in-process-turns.d.ts +17 -0
  82. package/dist/shared/in-process-turns.d.ts.map +1 -0
  83. package/dist/shared/in-process-turns.js +39 -0
  84. package/dist/shared/in-process-turns.js.map +1 -0
  85. package/dist/shared/key-digest.d.ts +8 -0
  86. package/dist/shared/key-digest.d.ts.map +1 -0
  87. package/dist/shared/key-digest.js +11 -0
  88. package/dist/shared/key-digest.js.map +1 -0
  89. 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.39",
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.39",
42
- "@zukhruf/election": "^0.3.39",
43
- "@zukhruf/fencing": "^0.3.39",
44
- "@zukhruf/fs": "^0.3.39",
45
- "@zukhruf/lease": "^0.3.39"
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
- "@zukhruf/testing": "^0.3.39",
49
- "hono": "^4.13.13"
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
  }