@seed-hypermedia/client 0.0.130 → 0.0.132
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/apps.mjs +4 -4
- package/dist/auto-link.mjs +5 -5
- package/dist/block-diff.d.ts +14 -4
- package/dist/blocks-to-markdown.mjs +3 -3
- package/dist/capability.mjs +2 -2
- package/dist/change.d.ts +2 -0
- package/dist/change.mjs +1 -1
- package/dist/{chunk-D3PRDISB.mjs → chunk-325UCLMT.mjs} +3 -3
- package/dist/{chunk-IRP2ZGH3.mjs → chunk-6QBB3P3Q.mjs} +10 -6
- package/dist/{chunk-QU6XHE3U.mjs → chunk-DGNAMVGH.mjs} +5 -2
- package/dist/{chunk-2XNVA2GK.mjs → chunk-ETIDW7ZJ.mjs} +1 -1
- package/dist/{chunk-ANR3R5NH.mjs → chunk-FU7FIYHI.mjs} +1 -1
- package/dist/{chunk-HY4NWSHF.mjs → chunk-H2R4GYNV.mjs} +4 -3
- package/dist/{chunk-2LSZJ2IM.mjs → chunk-HL43SJUP.mjs} +1 -1
- package/dist/{chunk-JM4WXPLC.mjs → chunk-IFELP3LQ.mjs} +1 -1
- package/dist/{chunk-IXSAJRZA.mjs → chunk-JQKYF5NB.mjs} +3 -3
- package/dist/{chunk-O5MHN2EO.mjs → chunk-KM2NR4YA.mjs} +1 -0
- package/dist/{chunk-RPBGROOJ.mjs → chunk-LDCWJXIP.mjs} +1 -1
- package/dist/{chunk-JRJ6U6B2.mjs → chunk-NEUDKUBC.mjs} +1 -1
- package/dist/{chunk-4JFL3SUQ.mjs → chunk-Q7CWMEBZ.mjs} +1 -1
- package/dist/{chunk-QLR4OWHG.mjs → chunk-QS6PIRUE.mjs} +1 -1
- package/dist/{chunk-QRSUQQTZ.mjs → chunk-T7SWLR32.mjs} +2 -2
- package/dist/{chunk-WD332LPF.mjs → chunk-VSMUWHIY.mjs} +1 -1
- package/dist/{chunk-NWOYBZWP.mjs → chunk-Y4PWAEJ5.mjs} +2 -2
- package/dist/{chunk-APL23ACF.mjs → chunk-YRNPRWYG.mjs} +1 -1
- package/dist/{chunk-ETQZ6PRJ.mjs → chunk-Z7VKSY7P.mjs} +3 -3
- package/dist/client.d.ts +2 -0
- package/dist/client.mjs +3 -3
- package/dist/comment.mjs +2 -2
- package/dist/create-document.mjs +2 -2
- package/dist/document-state.mjs +2 -2
- package/dist/editorblock-to-hmblock.mjs +2 -2
- package/dist/hm-resolver.mjs +2 -2
- package/dist/hm-types.d.ts +9 -0
- package/dist/hm-types.mjs +1 -1
- package/dist/hmblock-to-editorblock.mjs +2 -2
- package/dist/index.mjs +16 -16
- package/dist/pdf-to-blocks.mjs +3 -3
- package/dist/prepare-change.d.ts +6 -0
- package/dist/prepare-change.mjs +4 -4
- package/dist/resource-read.mjs +5 -5
- package/dist/schema-engine.mjs +2 -2
- package/dist/schema-registry.generated.mjs +1 -1
- package/dist/schema-resolve.mjs +4 -4
- package/dist/schema-subtypes.mjs +4 -4
- package/dist/schema-types.generated.d.ts +2 -0
- package/dist/signed-blob.mjs +2 -2
- package/dist/tei-to-blocks.mjs +2 -2
- package/dist/unicode.mjs +1 -1
- package/package.json +1 -1
package/dist/apps.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
documentUpdateBlobs
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6QBB3P3Q.mjs";
|
|
4
4
|
import "./chunk-CBELM7KX.mjs";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-KM2NR4YA.mjs";
|
|
6
6
|
import "./chunk-PJ2RFT5A.mjs";
|
|
7
7
|
import {
|
|
8
8
|
resolveEditableDocument
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QS6PIRUE.mjs";
|
|
10
10
|
import {
|
|
11
11
|
computeReplaceOps,
|
|
12
12
|
createBlocksMap,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
hmIdPathToEntityQueryPath,
|
|
20
20
|
packHmId,
|
|
21
21
|
unpackHmId
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-DGNAMVGH.mjs";
|
|
23
23
|
import "./chunk-AHQWDCHV.mjs";
|
|
24
24
|
import "./chunk-7P6ASYW6.mjs";
|
|
25
25
|
|
package/dist/auto-link.mjs
CHANGED
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
documentContainsLinkToChild,
|
|
5
5
|
documentHasSelfQuery,
|
|
6
6
|
shouldAutoLinkParent
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-325UCLMT.mjs";
|
|
8
|
+
import "./chunk-6QBB3P3Q.mjs";
|
|
9
9
|
import "./chunk-CBELM7KX.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-KM2NR4YA.mjs";
|
|
11
11
|
import "./chunk-PJ2RFT5A.mjs";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-QS6PIRUE.mjs";
|
|
13
13
|
import "./chunk-LVAHHQIK.mjs";
|
|
14
14
|
import "./chunk-DR3HJ6BV.mjs";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-DGNAMVGH.mjs";
|
|
16
16
|
import "./chunk-AHQWDCHV.mjs";
|
|
17
17
|
import "./chunk-7P6ASYW6.mjs";
|
|
18
18
|
export {
|
package/dist/block-diff.d.ts
CHANGED
|
@@ -68,13 +68,23 @@ export declare function matchBlockIds(oldNodes: APIBlockNode[], newNodes: BlockN
|
|
|
68
68
|
*/
|
|
69
69
|
export declare function rebindTableIdentities(oldNodes: APIBlockNode[], newNodes: BlockNode[]): BlockNode[];
|
|
70
70
|
/**
|
|
71
|
-
* Compare the new block tree against the old blocks map and produce
|
|
72
|
-
*
|
|
71
|
+
* Compare the new block tree against the old blocks map and produce the
|
|
72
|
+
* DocumentOperations that turn one into the other:
|
|
73
73
|
*
|
|
74
|
-
* - ReplaceBlock for new or content-changed blocks
|
|
75
|
-
* - MoveBlocks for
|
|
74
|
+
* - ReplaceBlock for new or content-changed blocks (an unchanged block gets none)
|
|
75
|
+
* - MoveBlocks for a level whose order changed (an unchanged level gets none)
|
|
76
76
|
* - DeleteBlocks for blocks removed from the document
|
|
77
77
|
*
|
|
78
|
+
* The replaces are minimal; the moves are not. A native MoveBlocks carries no
|
|
79
|
+
* anchor: it places its blocks at the start of the parent's children, in the
|
|
80
|
+
* order listed. So a level whose order changed in any way (a block added,
|
|
81
|
+
* removed or moved) is listed whole, the blocks already in place included.
|
|
82
|
+
* An update sent through `PrepareDocumentChange` (documentUpdateBlobs)
|
|
83
|
+
* drops the moves that change nothing, so the stored Change is minimal there;
|
|
84
|
+
* a Change built from these ops directly (createChangeOps) stores them all.
|
|
85
|
+
* Skipping unchanged blocks here still matters on the daemon path: it writes
|
|
86
|
+
* a block with a whole-number attribute again even when it is equal.
|
|
87
|
+
*
|
|
78
88
|
* The delete pass is global: every old block whose id does not appear
|
|
79
89
|
* anywhere in the new tree is deleted, including descendants of deleted
|
|
80
90
|
* blocks (so removing a table row also removes its cells, leaving no
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
emitFrontmatter,
|
|
8
8
|
parseDraftFilename,
|
|
9
9
|
slugify
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-Y4PWAEJ5.mjs";
|
|
11
|
+
import "./chunk-Q7CWMEBZ.mjs";
|
|
12
|
+
import "./chunk-DGNAMVGH.mjs";
|
|
13
13
|
import "./chunk-AHQWDCHV.mjs";
|
|
14
14
|
import "./chunk-7P6ASYW6.mjs";
|
|
15
15
|
export {
|
package/dist/capability.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCapability,
|
|
3
3
|
resolveCapability
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LDCWJXIP.mjs";
|
|
5
5
|
import "./chunk-LVAHHQIK.mjs";
|
|
6
6
|
import "./chunk-GBSWXJGU.mjs";
|
|
7
7
|
import "./chunk-3TPCJCVO.mjs";
|
|
8
8
|
import "./chunk-DR3HJ6BV.mjs";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-DGNAMVGH.mjs";
|
|
10
10
|
import "./chunk-AHQWDCHV.mjs";
|
|
11
11
|
import "./chunk-7P6ASYW6.mjs";
|
|
12
12
|
export {
|
package/dist/change.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export type CreateChangeOpsInput = {
|
|
|
38
38
|
depth?: number;
|
|
39
39
|
/** Timestamp (defaults to Date.now()) */
|
|
40
40
|
ts?: bigint;
|
|
41
|
+
/** Optional human-readable description of the change, like a commit message. */
|
|
42
|
+
message?: string;
|
|
41
43
|
};
|
|
42
44
|
/**
|
|
43
45
|
* Build unsigned change CBOR bytes from native ops.
|
package/dist/change.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
documentUpdateBlobs
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6QBB3P3Q.mjs";
|
|
4
4
|
import {
|
|
5
5
|
resolveDocumentState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QS6PIRUE.mjs";
|
|
7
7
|
import {
|
|
8
8
|
entityQueryPathToHmIdPath,
|
|
9
9
|
packHmId,
|
|
10
10
|
unpackHmId
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DGNAMVGH.mjs";
|
|
12
12
|
|
|
13
13
|
// src/auto-link.ts
|
|
14
14
|
function documentContainsLinkToChild(document, childId) {
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
createChangeOps,
|
|
7
7
|
signDocumentChange,
|
|
8
8
|
visibilityToCbor
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KM2NR4YA.mjs";
|
|
10
10
|
import {
|
|
11
11
|
createVersionRef
|
|
12
12
|
} from "./chunk-PJ2RFT5A.mjs";
|
|
13
13
|
import {
|
|
14
14
|
sameDocumentVersion
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QS6PIRUE.mjs";
|
|
16
16
|
|
|
17
17
|
// src/prepare-change.ts
|
|
18
18
|
import { decode as cborDecode } from "@ipld/dag-cbor";
|
|
@@ -364,7 +364,8 @@ async function prepareDocumentUpdateBlobs(input) {
|
|
|
364
364
|
baseVersion: input.baseVersion,
|
|
365
365
|
changes,
|
|
366
366
|
capability: input.capability,
|
|
367
|
-
visibility: input.visibility
|
|
367
|
+
visibility: input.visibility,
|
|
368
|
+
message: input.message
|
|
368
369
|
},
|
|
369
370
|
{ signal: input.signal }
|
|
370
371
|
);
|
|
@@ -417,7 +418,8 @@ async function clientBuiltDocumentUpdateBlobs(input) {
|
|
|
417
418
|
genesisCid: CID.parse(input.state.genesis),
|
|
418
419
|
deps: input.state.heads.map((head) => CID.parse(head)),
|
|
419
420
|
depth,
|
|
420
|
-
ts: BigInt(headTs !== void 0 && Number.isFinite(headTs) && headTs >= now ? headTs + 1 : now)
|
|
421
|
+
ts: BigInt(headTs !== void 0 && Number.isFinite(headTs) && headTs >= now ? headTs + 1 : now),
|
|
422
|
+
message: input.message
|
|
421
423
|
});
|
|
422
424
|
const change = await createChange(unsignedBytes, input.signer);
|
|
423
425
|
const generation = keptGeneration(input.currentGeneration, Number(ts));
|
|
@@ -463,7 +465,8 @@ async function documentUpdateBlobs(input) {
|
|
|
463
465
|
capability: input.capability,
|
|
464
466
|
currentGeneration: input.currentGeneration,
|
|
465
467
|
visibility: input.visibility,
|
|
466
|
-
now: input.now
|
|
468
|
+
now: input.now,
|
|
469
|
+
message: input.message
|
|
467
470
|
});
|
|
468
471
|
return { ...built, builtBy: "local", localReason };
|
|
469
472
|
};
|
|
@@ -499,7 +502,8 @@ async function documentUpdateBlobs(input) {
|
|
|
499
502
|
baseVersion: state.version,
|
|
500
503
|
changes,
|
|
501
504
|
capability: input.capability,
|
|
502
|
-
visibility: input.visibility
|
|
505
|
+
visibility: input.visibility,
|
|
506
|
+
message: input.message
|
|
503
507
|
},
|
|
504
508
|
{ signal: abort.signal }
|
|
505
509
|
);
|
|
@@ -1258,7 +1258,8 @@ var HMRawDocumentChangeSchema = z.object({
|
|
|
1258
1258
|
id: z.string().optional(),
|
|
1259
1259
|
author: z.string().optional(),
|
|
1260
1260
|
deps: z.array(z.string()).optional(),
|
|
1261
|
-
createTime: z.string().optional()
|
|
1261
|
+
createTime: z.string().optional(),
|
|
1262
|
+
message: z.string().optional()
|
|
1262
1263
|
});
|
|
1263
1264
|
var HMListChangesOutputSchema = z.object({
|
|
1264
1265
|
changes: z.array(HMRawDocumentChangeSchema),
|
|
@@ -1460,7 +1461,9 @@ var HMPrepareDocumentChangeInputSchema = z.object({
|
|
|
1460
1461
|
baseVersion: z.string().optional(),
|
|
1461
1462
|
changes: z.array(ProtoDocumentChangeSchema),
|
|
1462
1463
|
capability: z.string().optional(),
|
|
1463
|
-
visibility: z.number().int().optional()
|
|
1464
|
+
visibility: z.number().int().optional(),
|
|
1465
|
+
/** Optional human-readable description of the change, like a commit message. */
|
|
1466
|
+
message: z.string().optional()
|
|
1464
1467
|
});
|
|
1465
1468
|
var HMPrepareDocumentChangeOutputSchema = z.object({
|
|
1466
1469
|
unsignedChange: z.custom((val) => ArrayBuffer.isView(val) && "byteLength" in val, {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
createDocumentChange,
|
|
8
8
|
createHomeGenesisChange,
|
|
9
9
|
signDocumentChange
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KM2NR4YA.mjs";
|
|
11
11
|
import {
|
|
12
12
|
createVersionRef
|
|
13
13
|
} from "./chunk-PJ2RFT5A.mjs";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
HMActionSchema,
|
|
16
16
|
HMRequestSchema,
|
|
17
17
|
packHmId
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-DGNAMVGH.mjs";
|
|
19
19
|
|
|
20
20
|
// src/client.ts
|
|
21
21
|
import { encode as cborEncode } from "@ipld/dag-cbor";
|
|
@@ -292,7 +292,8 @@ function createSeedClient(baseUrl, options) {
|
|
|
292
292
|
baseVersion: input.baseVersion,
|
|
293
293
|
changes: input.changes,
|
|
294
294
|
capability: input.capability,
|
|
295
|
-
visibility: input.visibility
|
|
295
|
+
visibility: input.visibility,
|
|
296
|
+
message: input.message
|
|
296
297
|
};
|
|
297
298
|
const { unsignedChange } = await request("PrepareDocumentChange", prepareInput);
|
|
298
299
|
const { publishInput, changeCid, genesis, generation } = await signDocumentChange(
|
|
@@ -10,17 +10,17 @@ import {
|
|
|
10
10
|
schemaForCid,
|
|
11
11
|
structFields,
|
|
12
12
|
validate
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NEUDKUBC.mjs";
|
|
14
14
|
import {
|
|
15
15
|
HM_SCHEMAS
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-T7SWLR32.mjs";
|
|
17
17
|
import {
|
|
18
18
|
parseCidString
|
|
19
19
|
} from "./chunk-VWSAFDOL.mjs";
|
|
20
20
|
import {
|
|
21
21
|
packHmId,
|
|
22
22
|
unpackHmId
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-DGNAMVGH.mjs";
|
|
24
24
|
|
|
25
25
|
// src/schema-resolve.ts
|
|
26
26
|
var DAG_CBOR_CODE = 113;
|
|
@@ -29,6 +29,7 @@ function createChangeOps(input) {
|
|
|
29
29
|
unsigned.deps = input.deps ?? [];
|
|
30
30
|
unsigned.depth = input.depth ?? 1;
|
|
31
31
|
}
|
|
32
|
+
if (input.message) unsigned.message = input.message;
|
|
32
33
|
return { unsignedBytes: cborEncode(unsigned), ts };
|
|
33
34
|
}
|
|
34
35
|
async function createChange(unsignedBytes, signer) {
|