@abraca/dabra 2.0.2 → 2.0.4

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/dist/index.d.ts CHANGED
@@ -613,11 +613,16 @@ declare class AbracadabraClient {
613
613
  public_access: string | null;
614
614
  effective_public_access: string | null;
615
615
  }>;
616
- /** Update document metadata (label, description, kind). Requires manage permission. */
616
+ /**
617
+ * Update document metadata (label, description, kind, parent_id). Requires
618
+ * manage permission on the doc; reparenting additionally requires manage on
619
+ * the new parent (or admin if moving under the server root).
620
+ */
617
621
  updateDocumentMeta(docId: string, opts: {
618
622
  label?: string | null;
619
623
  description?: string | null;
620
624
  kind?: string | null;
625
+ parent_id?: string | null;
621
626
  }): Promise<void>;
622
627
  /**
623
628
  * List Spaces visible to the caller — top-level docs (children of the
@@ -3950,7 +3955,8 @@ declare class NotificationsClient extends EventEmitter {
3950
3955
  private handleServerError;
3951
3956
  }
3952
3957
  //#endregion
3953
- //#region node_modules/@scure/bip39/esm/wordlists/english.d.ts
3958
+ //#region node_modules/@scure/bip39/wordlists/english.d.ts
3959
+ /** English BIP39 wordlist. */
3954
3960
  declare const wordlist: string[];
3955
3961
  //#endregion
3956
3962
  //#region packages/provider/src/MnemonicKeyDerivation.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abraca/dabra",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "abracadabra provider",
5
5
  "keywords": [
6
6
  "abracadabra",
@@ -29,10 +29,10 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@lifeomic/attempt": "^3.1.0",
32
- "@noble/curves": "^2.0.1",
33
- "@noble/ed25519": "^2.3.0",
34
- "@noble/hashes": "^1.8.0",
35
- "@scure/bip39": "^1.5.0",
32
+ "@noble/curves": "^2.2.0",
33
+ "@noble/ed25519": "^3.1.0",
34
+ "@noble/hashes": "^2.2.0",
35
+ "@scure/bip39": "^2.2.0",
36
36
  "lib0": "^0.2.117",
37
37
  "ws": "^8.19.0"
38
38
  },
@@ -824,10 +824,19 @@ export class AbracadabraClient {
824
824
  return this.request("GET", `/docs/${encodeURIComponent(docId)}/access`);
825
825
  }
826
826
 
827
- /** Update document metadata (label, description, kind). Requires manage permission. */
827
+ /**
828
+ * Update document metadata (label, description, kind, parent_id). Requires
829
+ * manage permission on the doc; reparenting additionally requires manage on
830
+ * the new parent (or admin if moving under the server root).
831
+ */
828
832
  async updateDocumentMeta(
829
833
  docId: string,
830
- opts: { label?: string | null; description?: string | null; kind?: string | null },
834
+ opts: {
835
+ label?: string | null;
836
+ description?: string | null;
837
+ kind?: string | null;
838
+ parent_id?: string | null;
839
+ },
831
840
  ): Promise<void> {
832
841
  await this.request("PATCH", `/docs/${encodeURIComponent(docId)}`, { body: opts });
833
842
  }
@@ -18,9 +18,14 @@
18
18
  */
19
19
 
20
20
  import * as ed from "@noble/ed25519";
21
- import { hkdf } from "@noble/hashes/hkdf";
22
- import { sha256 } from "@noble/hashes/sha256";
21
+ import { hkdf } from "@noble/hashes/hkdf.js";
22
+ import { sha256, sha512 } from "@noble/hashes/sha2.js";
23
23
  import { ed25519 as nobleEd25519Curves } from "@noble/curves/ed25519.js";
24
+
25
+ // @noble/ed25519 v3: wire sha512 for sync paths and define an async hook so
26
+ // signAsync/verifyAsync don't require a Web Crypto fallback in Node.
27
+ ed.hashes.sha512 = sha512;
28
+ ed.hashes.sha512Async = (m: Uint8Array) => Promise.resolve(sha512(m));
24
29
  import {
25
30
  mnemonicToKeyPair,
26
31
  mnemonicToEd25519Seed,
@@ -6,8 +6,8 @@
6
6
  */
7
7
 
8
8
  import { x25519 } from "@noble/curves/ed25519.js";
9
- import { hkdf } from "@noble/hashes/hkdf";
10
- import { sha256 } from "@noble/hashes/sha256";
9
+ import { hkdf } from "@noble/hashes/hkdf.js";
10
+ import { sha256 } from "@noble/hashes/sha2.js";
11
11
  import type { AbracadabraClient } from "./AbracadabraClient.ts";
12
12
  import type { CryptoIdentityKeystore } from "./CryptoIdentityKeystore.ts";
13
13
 
@@ -1,5 +1,5 @@
1
1
  import * as Y from "yjs";
2
- import { sha256 } from "@noble/hashes/sha256";
2
+ import { sha256 } from "@noble/hashes/sha2.js";
3
3
  import EventEmitter from "./EventEmitter.ts";
4
4
  import { AbracadabraProvider } from "./AbracadabraProvider.ts";
5
5
  import type { AbracadabraProviderConfiguration } from "./AbracadabraProvider.ts";
@@ -21,11 +21,15 @@
21
21
  */
22
22
 
23
23
  import * as ed from "@noble/ed25519";
24
- import { hkdf } from "@noble/hashes/hkdf";
25
- import { sha256 } from "@noble/hashes/sha256";
24
+ import { hkdf } from "@noble/hashes/hkdf.js";
25
+ import { sha256, sha512 } from "@noble/hashes/sha2.js";
26
26
  import { ed25519 as nobleEd25519Curves } from "@noble/curves/ed25519.js";
27
27
  import { generateMnemonic as _generateMnemonic, validateMnemonic as _validateMnemonic, mnemonicToSeedSync } from "@scure/bip39";
28
- import { wordlist } from "@scure/bip39/wordlists/english";
28
+ import { wordlist } from "@scure/bip39/wordlists/english.js";
29
+
30
+ // @noble/ed25519 v3 hash hook (idempotent across modules).
31
+ ed.hashes.sha512 = sha512;
32
+ ed.hashes.sha512Async = (m: Uint8Array) => Promise.resolve(sha512(m));
29
33
 
30
34
  // ── Constants ───────────────────────────────────────────────────────────────
31
35
 
@@ -10,7 +10,7 @@
10
10
  * DataChannelRouter, and E2EEChannel (X25519 ECDH + AES-256-GCM).
11
11
  */
12
12
 
13
- import { sha256 } from "@noble/hashes/sha256";
13
+ import { sha256 } from "@noble/hashes/sha2.js";
14
14
  import EventEmitter from "../EventEmitter.ts";
15
15
  import { AbracadabraClient } from "../AbracadabraClient.ts";
16
16
  import { AbracadabraWebRTC } from "./AbracadabraWebRTC.ts";
@@ -21,8 +21,8 @@
21
21
  */
22
22
 
23
23
  import { x25519, ed25519 as nobleEd25519 } from "@noble/curves/ed25519.js";
24
- import { hkdf } from "@noble/hashes/hkdf";
25
- import { sha256 } from "@noble/hashes/sha256";
24
+ import { hkdf } from "@noble/hashes/hkdf.js";
25
+ import { sha256 } from "@noble/hashes/sha2.js";
26
26
  import EventEmitter from "../EventEmitter.ts";
27
27
 
28
28
  const HKDF_INFO = new TextEncoder().encode("abracadabra-webrtc-e2ee-v1");