wire-mesh-core 4.0.3 → 4.0.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 (68) hide show
  1. package/dist/adapters/byte-stream-connection.cjs +15 -4
  2. package/dist/adapters/byte-stream-connection.mjs +15 -4
  3. package/dist/adapters/memory-storage.d.cts +1 -1
  4. package/dist/adapters/memory-storage.d.mts +1 -1
  5. package/dist/adapters/node-fs-storage.cjs +4 -3
  6. package/dist/adapters/node-fs-storage.d.cts +1 -1
  7. package/dist/adapters/node-fs-storage.d.mts +1 -1
  8. package/dist/adapters/node-fs-storage.mjs +4 -3
  9. package/dist/adapters/system-clock.d.cts +1 -1
  10. package/dist/adapters/system-clock.d.mts +1 -1
  11. package/dist/clock-DhUPRfLh.d.cts +10 -0
  12. package/dist/clock-DhUPRfLh.d.mts +10 -0
  13. package/dist/domain/bulk.cjs +21 -12
  14. package/dist/domain/bulk.d.cts +1 -1
  15. package/dist/domain/bulk.d.mts +1 -1
  16. package/dist/domain/bulk.mjs +21 -12
  17. package/dist/domain/capability-grant.d.cts +1 -1
  18. package/dist/domain/capability-grant.d.mts +1 -1
  19. package/dist/domain/capability-request.d.cts +2 -2
  20. package/dist/domain/capability-request.d.mts +2 -2
  21. package/dist/domain/data-sync.cjs +22 -19
  22. package/dist/domain/data-sync.d.cts +1 -1
  23. package/dist/domain/data-sync.d.mts +1 -1
  24. package/dist/domain/data-sync.mjs +22 -19
  25. package/dist/domain/gossip-expansion.cjs +11 -5
  26. package/dist/domain/gossip-expansion.mjs +11 -5
  27. package/dist/domain/hub-mailbox.d.cts +1 -1
  28. package/dist/domain/hub-mailbox.d.mts +1 -1
  29. package/dist/domain/mesh-session.cjs +30 -14
  30. package/dist/domain/mesh-session.d.cts +1 -1
  31. package/dist/domain/mesh-session.d.mts +1 -1
  32. package/dist/domain/mesh-session.mjs +30 -14
  33. package/dist/domain/notice-board.cjs +4 -1
  34. package/dist/domain/notice-board.d.cts +2 -2
  35. package/dist/domain/notice-board.d.mts +2 -2
  36. package/dist/domain/notice-board.mjs +4 -1
  37. package/dist/domain/path-trace.d.cts +1 -1
  38. package/dist/domain/path-trace.d.mts +1 -1
  39. package/dist/domain/relay-hub.cjs +15 -10
  40. package/dist/domain/relay-hub.mjs +15 -10
  41. package/dist/domain/room-rekey.d.cts +1 -1
  42. package/dist/domain/room-rekey.d.mts +1 -1
  43. package/dist/domain/room.d.cts +1 -1
  44. package/dist/domain/room.d.mts +1 -1
  45. package/dist/domain/token-predicates.cjs +10 -10
  46. package/dist/domain/token-predicates.d.cts +1 -1
  47. package/dist/domain/token-predicates.d.mts +1 -1
  48. package/dist/domain/token-predicates.mjs +10 -10
  49. package/dist/domain/tokens.cjs +16 -4
  50. package/dist/domain/tokens.d.cts +2 -2
  51. package/dist/domain/tokens.d.mts +2 -2
  52. package/dist/domain/tokens.mjs +16 -4
  53. package/dist/ports/clock.d.cts +1 -1
  54. package/dist/ports/clock.d.mts +1 -1
  55. package/dist/ports/storage.d.cts +1 -1
  56. package/dist/ports/storage.d.mts +1 -1
  57. package/dist/sequential-CtQVlW8M.cjs +31 -0
  58. package/dist/sequential-D_W3THly.mjs +20 -0
  59. package/dist/storage-jbGFAYIV.d.cts +13 -0
  60. package/dist/storage-jbGFAYIV.d.mts +13 -0
  61. package/dist/{token-predicates-DqpG8VZZ.d.mts → token-predicates-CrieP1WI.d.mts} +1 -1
  62. package/dist/{token-predicates-D4NNPLnp.d.cts → token-predicates-lg4TtUxm.d.cts} +1 -1
  63. package/package.json +2 -2
  64. package/wasm-dist/wire_mesh_threshold_wasm_bg.wasm +0 -0
  65. package/dist/clock-DiSx-WKM.d.cts +0 -7
  66. package/dist/clock-DiSx-WKM.d.mts +0 -7
  67. package/dist/storage-B403CRyu.d.cts +0 -10
  68. package/dist/storage-B403CRyu.d.mts +0 -10
@@ -1,2 +1,2 @@
1
- import { t as KeyValueStorage } from "../storage-B403CRyu.cjs";
1
+ import { t as KeyValueStorage } from "../storage-jbGFAYIV.cjs";
2
2
  export { KeyValueStorage };
@@ -1,2 +1,2 @@
1
- import { t as KeyValueStorage } from "../storage-B403CRyu.mjs";
1
+ import { t as KeyValueStorage } from "../storage-jbGFAYIV.mjs";
2
2
  export { KeyValueStorage };
@@ -0,0 +1,31 @@
1
+ //#region src/domain/sequential.ts
2
+ /**
3
+ * The first item, in order, for which `predicate` resolves true, or undefined when none does. Items are tested strictly one after another and the search stops at the first match: a later item is never tested once an earlier one has matched, so a check that has to fail closed on the earliest offender, or whose later items must not run after an earlier one decided the outcome, keeps that order.
4
+ */
5
+ async function firstAsync(items, predicate) {
6
+ const [head, ...remaining] = items;
7
+ if (head === void 0) return;
8
+ return await predicate(head) ? head : firstAsync(remaining, predicate);
9
+ }
10
+ /**
11
+ * Runs `step` for each item, starting each only once the one before it has finished and stopping at the first that rejects, so side effects happen in item order and nothing after a failure runs.
12
+ */
13
+ async function eachInOrder(items, step) {
14
+ await items.reduce(async (previous, item, index) => {
15
+ await previous;
16
+ await step(item, index);
17
+ }, Promise.resolve());
18
+ }
19
+ //#endregion
20
+ Object.defineProperty(exports, "eachInOrder", {
21
+ enumerable: true,
22
+ get: function() {
23
+ return eachInOrder;
24
+ }
25
+ });
26
+ Object.defineProperty(exports, "firstAsync", {
27
+ enumerable: true,
28
+ get: function() {
29
+ return firstAsync;
30
+ }
31
+ });
@@ -0,0 +1,20 @@
1
+ //#region src/domain/sequential.ts
2
+ /**
3
+ * The first item, in order, for which `predicate` resolves true, or undefined when none does. Items are tested strictly one after another and the search stops at the first match: a later item is never tested once an earlier one has matched, so a check that has to fail closed on the earliest offender, or whose later items must not run after an earlier one decided the outcome, keeps that order.
4
+ */
5
+ async function firstAsync(items, predicate) {
6
+ const [head, ...remaining] = items;
7
+ if (head === void 0) return;
8
+ return await predicate(head) ? head : firstAsync(remaining, predicate);
9
+ }
10
+ /**
11
+ * Runs `step` for each item, starting each only once the one before it has finished and stopping at the first that rejects, so side effects happen in item order and nothing after a failure runs.
12
+ */
13
+ async function eachInOrder(items, step) {
14
+ await items.reduce(async (previous, item, index) => {
15
+ await previous;
16
+ await step(item, index);
17
+ }, Promise.resolve());
18
+ }
19
+ //#endregion
20
+ export { firstAsync as n, eachInOrder as t };
@@ -0,0 +1,13 @@
1
+ //#region src/ports/storage.d.ts
2
+ /**
3
+ * A minimal async key/value contract for whatever this package needs to persist (revocation entries, data-domain oplog entries) -- local and remote implementations interchangeable behind it, per the org's storage-boundary rules. Values are opaque bytes, not a specific serialisation: callers encode/decode with whatever schema the stored data actually has (a revocation-entry, a data-domain entry, etc.), matching the protocol's own treatment of data-domain entries as opaque to the wire format.
4
+ */
5
+ interface KeyValueStorage {
6
+ get: (key: string) => Promise<Uint8Array<ArrayBuffer> | undefined>;
7
+ set: (key: string, value: Uint8Array<ArrayBuffer>) => Promise<void>;
8
+ delete: (key: string) => Promise<void>;
9
+ /** Keys with the given prefix, in no particular order. */
10
+ keys: (prefix: string) => Promise<string[]>;
11
+ }
12
+ //#endregion
13
+ export { KeyValueStorage as t };
@@ -0,0 +1,13 @@
1
+ //#region src/ports/storage.d.ts
2
+ /**
3
+ * A minimal async key/value contract for whatever this package needs to persist (revocation entries, data-domain oplog entries) -- local and remote implementations interchangeable behind it, per the org's storage-boundary rules. Values are opaque bytes, not a specific serialisation: callers encode/decode with whatever schema the stored data actually has (a revocation-entry, a data-domain entry, etc.), matching the protocol's own treatment of data-domain entries as opaque to the wire format.
4
+ */
5
+ interface KeyValueStorage {
6
+ get: (key: string) => Promise<Uint8Array<ArrayBuffer> | undefined>;
7
+ set: (key: string, value: Uint8Array<ArrayBuffer>) => Promise<void>;
8
+ delete: (key: string) => Promise<void>;
9
+ /** Keys with the given prefix, in no particular order. */
10
+ keys: (prefix: string) => Promise<string[]>;
11
+ }
12
+ //#endregion
13
+ export { KeyValueStorage as t };
@@ -1,5 +1,5 @@
1
1
  import { D as DeviceId, en as TokenClaims } from "./protocol-DzmpxxUr.mjs";
2
- import { t as Clock } from "./clock-DiSx-WKM.mjs";
2
+ import { t as Clock } from "./clock-DhUPRfLh.mjs";
3
3
  import { z } from "zod";
4
4
  import { JsonValue, PredicateNode, Resolution } from "trilean";
5
5
  //#region src/domain/token-predicates.d.ts
@@ -1,5 +1,5 @@
1
1
  import { D as DeviceId, en as TokenClaims } from "./protocol-DzmpxxUr.cjs";
2
- import { t as Clock } from "./clock-DiSx-WKM.cjs";
2
+ import { t as Clock } from "./clock-DhUPRfLh.cjs";
3
3
  import { z } from "zod";
4
4
  import { JsonValue, PredicateNode, Resolution } from "trilean";
5
5
  //#region src/domain/token-predicates.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wire-mesh-core",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "dependencies": {
5
5
  "cbor2": "2.3.0",
6
6
  "cddl.js": "1.0.1",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "devDependencies": {
11
11
  "@arethetypeswrong/cli": "0.18.5",
12
- "@exadev/eslint-config": "2.18.0",
12
+ "@exadev/eslint-config": "3.0.0",
13
13
  "@stryker-mutator/api": "10.0.0",
14
14
  "@stryker-mutator/core": "10.0.0",
15
15
  "@stryker-mutator/typescript-checker": "10.0.0",
@@ -1,7 +0,0 @@
1
- //#region src/ports/clock.d.ts
2
- interface Clock {
3
- /** Current time as Unix milliseconds, matching every uint timestamp field in the protocol (token-claims.expires, revocation-entry.revoked-at, handshake params, etc.). */
4
- now: () => number;
5
- }
6
- //#endregion
7
- export { Clock as t };
@@ -1,7 +0,0 @@
1
- //#region src/ports/clock.d.ts
2
- interface Clock {
3
- /** Current time as Unix milliseconds, matching every uint timestamp field in the protocol (token-claims.expires, revocation-entry.revoked-at, handshake params, etc.). */
4
- now: () => number;
5
- }
6
- //#endregion
7
- export { Clock as t };
@@ -1,10 +0,0 @@
1
- //#region src/ports/storage.d.ts
2
- interface KeyValueStorage {
3
- get: (key: string) => Promise<Uint8Array<ArrayBuffer> | undefined>;
4
- set: (key: string, value: Uint8Array<ArrayBuffer>) => Promise<void>;
5
- delete: (key: string) => Promise<void>;
6
- /** Keys with the given prefix, in no particular order. */
7
- keys: (prefix: string) => Promise<string[]>;
8
- }
9
- //#endregion
10
- export { KeyValueStorage as t };
@@ -1,10 +0,0 @@
1
- //#region src/ports/storage.d.ts
2
- interface KeyValueStorage {
3
- get: (key: string) => Promise<Uint8Array<ArrayBuffer> | undefined>;
4
- set: (key: string, value: Uint8Array<ArrayBuffer>) => Promise<void>;
5
- delete: (key: string) => Promise<void>;
6
- /** Keys with the given prefix, in no particular order. */
7
- keys: (prefix: string) => Promise<string[]>;
8
- }
9
- //#endregion
10
- export { KeyValueStorage as t };