@seed-hypermedia/client 0.0.69 → 0.0.70

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 (43) hide show
  1. package/dist/auth.mjs +3 -2
  2. package/dist/auto-link.d.ts +3 -2
  3. package/dist/auto-link.mjs +5 -4
  4. package/dist/blobs.d.ts +6 -4
  5. package/dist/blobs.mjs +2 -1
  6. package/dist/capability.d.ts +7 -2
  7. package/dist/capability.mjs +5 -2
  8. package/dist/change.d.ts +8 -7
  9. package/dist/change.mjs +4 -3
  10. package/dist/{chunk-NX7YFFRX.mjs → chunk-37WRGUK4.mjs} +5 -4
  11. package/dist/{chunk-MKUWQB5W.mjs → chunk-3KESF5XJ.mjs} +2 -2
  12. package/dist/{chunk-GKGWSN6J.mjs → chunk-4Q3SAL5R.mjs} +1 -1
  13. package/dist/{chunk-W4OGV22Y.mjs → chunk-BUPMCRR4.mjs} +14 -23
  14. package/dist/{chunk-5EWV4OPF.mjs → chunk-DBHL3BYB.mjs} +8 -13
  15. package/dist/chunk-DR3HJ6BV.mjs +25 -0
  16. package/dist/{chunk-WJQSJ6UM.mjs → chunk-EU36RFR3.mjs} +2 -2
  17. package/dist/{chunk-FYUZZ3HT.mjs → chunk-IT5LLTMP.mjs} +15 -5
  18. package/dist/{chunk-I3YUHKYW.mjs → chunk-JT57MV7Y.mjs} +6 -5
  19. package/dist/{chunk-YZX54L3G.mjs → chunk-LVAHHQIK.mjs} +8 -0
  20. package/dist/{chunk-QS7TPMYT.mjs → chunk-NYWCMQTH.mjs} +5 -4
  21. package/dist/{chunk-XI2LXZM7.mjs → chunk-PJ2RFT5A.mjs} +5 -4
  22. package/dist/{chunk-DXDF36H5.mjs → chunk-SHOAYNJY.mjs} +1 -1
  23. package/dist/client.d.ts +3 -2
  24. package/dist/client.mjs +5 -4
  25. package/dist/comment.d.ts +5 -4
  26. package/dist/comment.mjs +3 -2
  27. package/dist/contact.d.ts +5 -4
  28. package/dist/contact.mjs +3 -2
  29. package/dist/hm-types.d.ts +566 -566
  30. package/dist/hmauth.mjs +3 -2
  31. package/dist/index.d.ts +2 -0
  32. package/dist/index.mjs +17 -9
  33. package/dist/ref.d.ts +5 -4
  34. package/dist/ref.mjs +3 -2
  35. package/dist/resource-read.mjs +6 -5
  36. package/dist/signer.d.ts +42 -0
  37. package/dist/signer.mjs +9 -0
  38. package/dist/signing.d.ts +10 -2
  39. package/dist/signing.mjs +4 -1
  40. package/dist/vault-local.mjs +4 -1
  41. package/dist/vault.d.ts +14 -4
  42. package/dist/vault.mjs +4 -1
  43. package/package.json +1 -1
package/dist/hmauth.mjs CHANGED
@@ -21,9 +21,10 @@ import {
21
21
  validateSessionKeyPrincipal,
22
22
  validateState,
23
23
  verifyDelegationRequestProof
24
- } from "./chunk-DXDF36H5.mjs";
24
+ } from "./chunk-SHOAYNJY.mjs";
25
25
  import "./chunk-2MD3FXKB.mjs";
26
- import "./chunk-FYUZZ3HT.mjs";
26
+ import "./chunk-IT5LLTMP.mjs";
27
+ import "./chunk-DR3HJ6BV.mjs";
27
28
  import "./chunk-3TPCJCVO.mjs";
28
29
  import "./chunk-7P6ASYW6.mjs";
29
30
  export {
package/dist/index.d.ts CHANGED
@@ -22,6 +22,8 @@ export type { EmbeddedPdfResult } from './pdf-to-blocks-embedded';
22
22
  export { trimTrailingEmptyBlocks } from './comment';
23
23
  export { codePointLength, entityQueryPathToHmIdPath, getHMQueryString, hmIdPathToEntityQueryPath, HYPERMEDIA_SCHEME, isSurrogate, packBaseId, packHmId, parseCustomURL, parseFragment, serializeBlockRange, unpackHmId, } from './hm-types';
24
24
  export type { HMRequest, HMSigner, UnpackedHypermediaId } from './hm-types';
25
+ export { toHMSigner, toPrincipalSigner } from './signer';
26
+ export type { AnySigner, PrincipalSigner } from './signer';
25
27
  export { resolveHypermediaUrl, resolveId } from './hm-resolver';
26
28
  export type { DomainResolverFn, DomainIdChangedCallback, ResolveOptions, ResolvedUrl } from './hm-resolver';
27
29
  export { resolveIdWithClient } from './resource-read';
package/dist/index.mjs CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-52P3E6H6.mjs";
20
20
  import {
21
21
  resolveIdWithClient
22
- } from "./chunk-GKGWSN6J.mjs";
22
+ } from "./chunk-4Q3SAL5R.mjs";
23
23
  import {
24
24
  fileToIpfsBlobs,
25
25
  filesToIpfsBlobs,
@@ -42,7 +42,7 @@ import {
42
42
  } from "./chunk-KO4XH5L2.mjs";
43
43
  import {
44
44
  createSeedClient
45
- } from "./chunk-MKUWQB5W.mjs";
45
+ } from "./chunk-3KESF5XJ.mjs";
46
46
  import {
47
47
  SeedClientError,
48
48
  SeedNetworkError,
@@ -54,13 +54,13 @@ import {
54
54
  deleteComment,
55
55
  trimTrailingEmptyBlocks,
56
56
  updateComment
57
- } from "./chunk-QS7TPMYT.mjs";
57
+ } from "./chunk-NYWCMQTH.mjs";
58
58
  import {
59
59
  contactRecordIdFromBlob,
60
60
  createContact,
61
61
  deleteContact,
62
62
  updateContact
63
- } from "./chunk-NX7YFFRX.mjs";
63
+ } from "./chunk-37WRGUK4.mjs";
64
64
  import {
65
65
  editorBlockToHMBlock,
66
66
  editorBlocksToHMBlockNodes
@@ -79,7 +79,7 @@ import {
79
79
  documentContainsLinkToChild,
80
80
  documentHasSelfQuery,
81
81
  shouldAutoLinkParent
82
- } from "./chunk-WJQSJ6UM.mjs";
82
+ } from "./chunk-EU36RFR3.mjs";
83
83
  import {
84
84
  createChange,
85
85
  createChangeOps,
@@ -88,12 +88,12 @@ import {
88
88
  createGenesisChange,
89
89
  signDocumentChange,
90
90
  signPreparedChange
91
- } from "./chunk-I3YUHKYW.mjs";
91
+ } from "./chunk-JT57MV7Y.mjs";
92
92
  import {
93
93
  createRedirectRef,
94
94
  createTombstoneRef,
95
95
  createVersionRef
96
- } from "./chunk-XI2LXZM7.mjs";
96
+ } from "./chunk-PJ2RFT5A.mjs";
97
97
  import {
98
98
  resolveDocumentState
99
99
  } from "./chunk-HBIVZA6C.mjs";
@@ -119,8 +119,13 @@ import {
119
119
  import {
120
120
  createCapability,
121
121
  resolveCapability
122
- } from "./chunk-W4OGV22Y.mjs";
123
- import "./chunk-YZX54L3G.mjs";
122
+ } from "./chunk-BUPMCRR4.mjs";
123
+ import "./chunk-LVAHHQIK.mjs";
124
+ import "./chunk-IT5LLTMP.mjs";
125
+ import {
126
+ toHMSigner,
127
+ toPrincipalSigner
128
+ } from "./chunk-DR3HJ6BV.mjs";
124
129
  import {
125
130
  HYPERMEDIA_SCHEME,
126
131
  codePointLength,
@@ -135,6 +140,7 @@ import {
135
140
  serializeBlockRange,
136
141
  unpackHmId
137
142
  } from "./chunk-SQEUO7FO.mjs";
143
+ import "./chunk-3TPCJCVO.mjs";
138
144
  import "./chunk-7P6ASYW6.mjs";
139
145
  export {
140
146
  AnnotationSet,
@@ -218,6 +224,8 @@ export {
218
224
  slugify,
219
225
  teiToBlocks,
220
226
  toAPIBlockNode,
227
+ toHMSigner,
228
+ toPrincipalSigner,
221
229
  trimTrailingEmptyBlocks,
222
230
  unpackHmId,
223
231
  updateComment,
package/dist/ref.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Ref SDK — create signed ref blobs for document version, tombstone, and redirect operations.
3
3
  */
4
- import type { HMPublishBlobsInput, HMSigner } from './hm-types';
4
+ import type { HMPublishBlobsInput } from './hm-types';
5
+ import type { AnySigner } from './signer';
5
6
  export type CreateVersionRefInput = {
6
7
  /** Account UID (base58btc-encoded principal) */
7
8
  space: string;
@@ -55,15 +56,15 @@ export type CreateRedirectRefInput = {
55
56
  * Points to a specific document version (genesis + heads).
56
57
  * Used for fork/branch operations and normal document refs.
57
58
  */
58
- export declare function createVersionRef(input: CreateVersionRefInput, signer: HMSigner): Promise<HMPublishBlobsInput>;
59
+ export declare function createVersionRef(input: CreateVersionRefInput, signer: AnySigner): Promise<HMPublishBlobsInput>;
59
60
  /**
60
61
  * Create a signed tombstone ref blob ready for publishing.
61
62
  * Marks a document as deleted (empty heads, no redirect).
62
63
  */
63
- export declare function createTombstoneRef(input: CreateTombstoneRefInput, signer: HMSigner): Promise<HMPublishBlobsInput>;
64
+ export declare function createTombstoneRef(input: CreateTombstoneRefInput, signer: AnySigner): Promise<HMPublishBlobsInput>;
64
65
  /**
65
66
  * Create a signed redirect ref blob ready for publishing.
66
67
  * Redirects this document path to a different account/path.
67
68
  * Optionally republishes the target content at this location.
68
69
  */
69
- export declare function createRedirectRef(input: CreateRedirectRefInput, signer: HMSigner): Promise<HMPublishBlobsInput>;
70
+ export declare function createRedirectRef(input: CreateRedirectRefInput, signer: AnySigner): Promise<HMPublishBlobsInput>;
package/dist/ref.mjs CHANGED
@@ -2,8 +2,9 @@ import {
2
2
  createRedirectRef,
3
3
  createTombstoneRef,
4
4
  createVersionRef
5
- } from "./chunk-XI2LXZM7.mjs";
6
- import "./chunk-YZX54L3G.mjs";
5
+ } from "./chunk-PJ2RFT5A.mjs";
6
+ import "./chunk-LVAHHQIK.mjs";
7
+ import "./chunk-DR3HJ6BV.mjs";
7
8
  import "./chunk-7P6ASYW6.mjs";
8
9
  export {
9
10
  createRedirectRef,
@@ -1,12 +1,13 @@
1
1
  import {
2
2
  resolveIdWithClient
3
- } from "./chunk-GKGWSN6J.mjs";
3
+ } from "./chunk-4Q3SAL5R.mjs";
4
4
  import "./chunk-YNVFRCUH.mjs";
5
- import "./chunk-MKUWQB5W.mjs";
5
+ import "./chunk-3KESF5XJ.mjs";
6
6
  import "./chunk-CBELM7KX.mjs";
7
- import "./chunk-I3YUHKYW.mjs";
8
- import "./chunk-XI2LXZM7.mjs";
9
- import "./chunk-YZX54L3G.mjs";
7
+ import "./chunk-JT57MV7Y.mjs";
8
+ import "./chunk-PJ2RFT5A.mjs";
9
+ import "./chunk-LVAHHQIK.mjs";
10
+ import "./chunk-DR3HJ6BV.mjs";
10
11
  import "./chunk-SQEUO7FO.mjs";
11
12
  import "./chunk-7P6ASYW6.mjs";
12
13
  export {
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The signer abstraction shared across this package.
3
+ *
4
+ * Two signer shapes grew up independently here:
5
+ *
6
+ * - {@link HMSigner} (`getPublicKey()`) — used by the blob builders
7
+ * (`createComment`, `createContact`, `createChange`, …) and by `SeedClient`.
8
+ * - {@link PrincipalSigner} (`principal`) — used by the blob primitives in
9
+ * `./blobs` and by the auth/vault code, where the principal is already
10
+ * known synchronously.
11
+ *
12
+ * Neither is wrong, and both produce identical bytes. Rather than break one set
13
+ * of callers, every public entry point now accepts {@link AnySigner} and
14
+ * normalizes with the helpers below, so callers never have to care which shape
15
+ * a given function was originally written against.
16
+ *
17
+ * This module intentionally has no runtime imports, so importing it never pulls
18
+ * crypto or schema code into a bundle.
19
+ */
20
+ import type { HMSigner } from './hm-types';
21
+ export type { HMSigner };
22
+ /**
23
+ * A signer that exposes its principal synchronously.
24
+ *
25
+ * Structurally identical to the `Signer` interface in `./blobs`; declared
26
+ * separately here so this module stays dependency-free.
27
+ */
28
+ export type PrincipalSigner = {
29
+ readonly principal: Uint8Array;
30
+ sign(data: Uint8Array): Promise<Uint8Array>;
31
+ };
32
+ /** Either accepted signer shape. */
33
+ export type AnySigner = HMSigner | PrincipalSigner;
34
+ /** Normalize to the `getPublicKey()` shape. Cheap — no key material is touched. */
35
+ export declare function toHMSigner(signer: AnySigner): HMSigner;
36
+ /**
37
+ * Normalize to the synchronous-principal shape.
38
+ *
39
+ * Async because an {@link HMSigner} only reveals its public key through a
40
+ * promise; the result caches it so callers can read `.principal` directly.
41
+ */
42
+ export declare function toPrincipalSigner(signer: AnySigner): Promise<PrincipalSigner>;
@@ -0,0 +1,9 @@
1
+ import {
2
+ toHMSigner,
3
+ toPrincipalSigner
4
+ } from "./chunk-DR3HJ6BV.mjs";
5
+ import "./chunk-7P6ASYW6.mjs";
6
+ export {
7
+ toHMSigner,
8
+ toPrincipalSigner
9
+ };
package/dist/signing.d.ts CHANGED
@@ -2,14 +2,22 @@
2
2
  * Internal signing utilities shared across blob creation modules.
3
3
  * Not exported from the package index.
4
4
  */
5
- import type { HMPublishBlobsInput, HMSigner } from './hm-types';
5
+ import type { HMPublishBlobsInput } from './hm-types';
6
+ import { type AnySigner } from './signer';
6
7
  export declare const cborCodec: {
7
8
  code: 113;
8
9
  encode: (input: unknown) => import("multiformats").ByteView<unknown>;
9
10
  name: "DAG-CBOR";
10
11
  };
11
12
  export declare function normalizeBytes(data: Uint8Array): Uint8Array<ArrayBuffer>;
12
- export declare function signObject(signer: HMSigner, data: unknown): Promise<Uint8Array>;
13
+ export declare function signObject(signer: AnySigner, data: unknown): Promise<Uint8Array>;
14
+ /**
15
+ * Read a signer's principal, accepting either signer shape.
16
+ *
17
+ * Lets the blob builders take an `AnySigner` without each one having to
18
+ * normalize first.
19
+ */
20
+ export declare function signerPublicKey(signer: AnySigner): Promise<Uint8Array>;
13
21
  export declare function toPublishInput(blobData: Uint8Array, extraBlobs?: Array<{
14
22
  cid?: string;
15
23
  data: Uint8Array;
package/dist/signing.mjs CHANGED
@@ -2,12 +2,15 @@ import {
2
2
  cborCodec,
3
3
  normalizeBytes,
4
4
  signObject,
5
+ signerPublicKey,
5
6
  toPublishInput
6
- } from "./chunk-YZX54L3G.mjs";
7
+ } from "./chunk-LVAHHQIK.mjs";
8
+ import "./chunk-DR3HJ6BV.mjs";
7
9
  import "./chunk-7P6ASYW6.mjs";
8
10
  export {
9
11
  cborCodec,
10
12
  normalizeBytes,
11
13
  signObject,
14
+ signerPublicKey,
12
15
  toPublishInput
13
16
  };
@@ -5,13 +5,16 @@ import {
5
5
  principalFromPublicKey,
6
6
  principalToString,
7
7
  unwrapDEK
8
- } from "./chunk-5EWV4OPF.mjs";
8
+ } from "./chunk-DBHL3BYB.mjs";
9
9
  import {
10
10
  readOSSecret,
11
11
  stripGoKeyringPrefix
12
12
  } from "./chunk-KNP335NP.mjs";
13
13
  import "./chunk-UOL3F6XQ.mjs";
14
14
  import "./chunk-2MD3FXKB.mjs";
15
+ import "./chunk-IT5LLTMP.mjs";
16
+ import "./chunk-DR3HJ6BV.mjs";
17
+ import "./chunk-3TPCJCVO.mjs";
15
18
  import "./chunk-7P6ASYW6.mjs";
16
19
 
17
20
  // src/vault-local.ts
package/dist/vault.d.ts CHANGED
@@ -16,10 +16,20 @@ import './base64';
16
16
  export declare const VAULT_VERSION = 2;
17
17
  /** A principal: multicodec prefix + raw Ed25519 public key. */
18
18
  export type Principal = Uint8Array;
19
- /** Build a Principal from a raw 32-byte Ed25519 public key. */
20
- export declare function principalFromPublicKey(publicKey: Uint8Array): Principal;
21
- /** Encode a Principal to its base58btc multibase string (starts with 'z'). */
22
- export declare function principalToString(principal: Principal): string;
19
+ /**
20
+ * Build a Principal from a raw 32-byte Ed25519 public key.
21
+ *
22
+ * @deprecated Use `principalFromEd25519` from `./blobs`, the single
23
+ * implementation. Kept as an alias so existing vault callers keep working.
24
+ */
25
+ export declare const principalFromPublicKey: (publicKey: Uint8Array) => Principal;
26
+ /**
27
+ * Encode a Principal to its base58btc multibase string (starts with 'z').
28
+ *
29
+ * @deprecated Use `principalToString` from `./blobs`, the single
30
+ * implementation. Re-exported here so existing vault callers keep working.
31
+ */
32
+ export declare const principalToString: (principal: Principal) => string;
23
33
  /** Derive the account ID (base58btc principal string) from a 32-byte Ed25519 seed. */
24
34
  export declare function accountIdFromSeed(seed: Uint8Array): string;
25
35
  /**
package/dist/vault.mjs CHANGED
@@ -14,9 +14,12 @@ import {
14
14
  principalToString,
15
15
  serialize,
16
16
  unwrapDEK
17
- } from "./chunk-5EWV4OPF.mjs";
17
+ } from "./chunk-DBHL3BYB.mjs";
18
18
  import "./chunk-UOL3F6XQ.mjs";
19
19
  import "./chunk-2MD3FXKB.mjs";
20
+ import "./chunk-IT5LLTMP.mjs";
21
+ import "./chunk-DR3HJ6BV.mjs";
22
+ import "./chunk-3TPCJCVO.mjs";
20
23
  import "./chunk-7P6ASYW6.mjs";
21
24
  export {
22
25
  VAULT_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-hypermedia/client",
3
- "version": "0.0.69",
3
+ "version": "0.0.70",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/seed-hypermedia/seed",