@seed-hypermedia/client 0.0.82 → 0.0.84
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/auto-link.d.ts +3 -4
- package/dist/auto-link.mjs +4 -4
- package/dist/blocks-to-markdown.mjs +2 -2
- package/dist/capability.mjs +2 -2
- package/dist/change.d.ts +2 -0
- package/dist/change.mjs +1 -1
- package/dist/{chunk-MZENVC36.mjs → chunk-5OEUIK3L.mjs} +1 -1
- package/dist/{chunk-C42YWLL2.mjs → chunk-73JZJ5YC.mjs} +1 -1
- package/dist/{chunk-WGOIXGRU.mjs → chunk-7UTCJZPQ.mjs} +3 -3
- package/dist/{chunk-IREIRKVP.mjs → chunk-IQONPGLX.mjs} +1 -1
- package/dist/{chunk-LCKCG574.mjs → chunk-LMWLJHSM.mjs} +1 -1
- package/dist/{chunk-BO2QSSIU.mjs → chunk-LQMTE724.mjs} +1 -1
- package/dist/{chunk-AIQJ6BI3.mjs → chunk-MTGPGNGT.mjs} +1 -1
- package/dist/{chunk-RCVLNXG6.mjs → chunk-NGLLI4HI.mjs} +9 -8
- package/dist/{chunk-55OXHA27.mjs → chunk-PEG3UOMI.mjs} +5 -3
- package/dist/{chunk-2OMSCQ56.mjs → chunk-Q2NA774U.mjs} +1 -1
- package/dist/{chunk-MZUGCZJ6.mjs → chunk-Q7YPP3WO.mjs} +43 -11
- package/dist/{chunk-D2LTD2KZ.mjs → chunk-TSUQYYH6.mjs} +15 -1
- package/dist/{chunk-JT57MV7Y.mjs → chunk-W7H2UYQL.mjs} +2 -0
- package/dist/{chunk-TET43O3D.mjs → chunk-X4VXKKMT.mjs} +8 -7
- package/dist/client.d.ts +7 -1
- package/dist/client.mjs +3 -3
- package/dist/comment.mjs +2 -2
- package/dist/document-state.mjs +2 -2
- package/dist/editorblock-to-hmblock.mjs +2 -2
- package/dist/hm-resolver.d.ts +2 -0
- package/dist/hm-resolver.mjs +2 -2
- package/dist/hm-types.d.ts +227 -114
- package/dist/hm-types.mjs +5 -1
- package/dist/hmblock-to-editorblock.mjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +14 -14
- package/dist/pdf-to-blocks.mjs +3 -3
- package/dist/resource-read.mjs +5 -5
- package/dist/tei-to-blocks.mjs +2 -2
- package/dist/unicode.mjs +1 -1
- package/package.json +1 -1
package/dist/auto-link.d.ts
CHANGED
|
@@ -22,10 +22,9 @@ export declare function documentContainsLinkToChild(document: HMDocument, childI
|
|
|
22
22
|
* Check if a document has a self-referential Query block
|
|
23
23
|
* (a query to itself that would automatically include children).
|
|
24
24
|
*
|
|
25
|
-
* A query block is self-referential when
|
|
26
|
-
*
|
|
27
|
-
* the
|
|
28
|
-
* represents an unconfigured query block, which the editor renders empty.
|
|
25
|
+
* A query block is self-referential when its target is implicit/empty or one
|
|
26
|
+
* of its `query.includes` entries targets the document. New Collections use
|
|
27
|
+
* the implicit empty target until it is resolved against their published ID.
|
|
29
28
|
*/
|
|
30
29
|
export declare function documentHasSelfQuery(document: HMDocument, documentId: UnpackedHypermediaId): boolean;
|
|
31
30
|
/**
|
package/dist/auto-link.mjs
CHANGED
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
documentContainsLinkToChild,
|
|
5
5
|
documentHasSelfQuery,
|
|
6
6
|
shouldAutoLinkParent
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-PEG3UOMI.mjs";
|
|
8
|
+
import "./chunk-W7H2UYQL.mjs";
|
|
9
9
|
import "./chunk-PJ2RFT5A.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-73JZJ5YC.mjs";
|
|
11
11
|
import "./chunk-LVAHHQIK.mjs";
|
|
12
12
|
import "./chunk-DR3HJ6BV.mjs";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-Q7YPP3WO.mjs";
|
|
14
14
|
import "./chunk-7P6ASYW6.mjs";
|
|
15
15
|
export {
|
|
16
16
|
autoLinkChildToParent,
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
emitFrontmatter,
|
|
8
8
|
parseDraftFilename,
|
|
9
9
|
slugify
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-X4VXKKMT.mjs";
|
|
11
|
+
import "./chunk-Q7YPP3WO.mjs";
|
|
12
12
|
import "./chunk-7P6ASYW6.mjs";
|
|
13
13
|
export {
|
|
14
14
|
blocksToMarkdown,
|
package/dist/capability.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCapability,
|
|
3
3
|
resolveCapability
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LQMTE724.mjs";
|
|
5
5
|
import "./chunk-LVAHHQIK.mjs";
|
|
6
6
|
import "./chunk-NBCHK76Q.mjs";
|
|
7
7
|
import "./chunk-DR3HJ6BV.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-Q7YPP3WO.mjs";
|
|
9
9
|
import "./chunk-3TPCJCVO.mjs";
|
|
10
10
|
import "./chunk-7P6ASYW6.mjs";
|
|
11
11
|
export {
|
package/dist/change.d.ts
CHANGED
|
@@ -134,5 +134,7 @@ export type SignDocumentChangeInput = {
|
|
|
134
134
|
*/
|
|
135
135
|
export declare function signDocumentChange(input: SignDocumentChangeInput, signer: AnySigner): Promise<{
|
|
136
136
|
changeCid: CID;
|
|
137
|
+
genesis: string;
|
|
138
|
+
generation: number;
|
|
137
139
|
publishInput: HMPublishBlobsInput;
|
|
138
140
|
}>;
|
package/dist/change.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TSUQYYH6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createSeedClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NGLLI4HI.mjs";
|
|
7
7
|
import {
|
|
8
8
|
unpackHmId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Q7YPP3WO.mjs";
|
|
10
10
|
|
|
11
11
|
// src/resource-read.ts
|
|
12
12
|
async function resolveIdWithClient(rawId, options = {}) {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
createDocumentChange,
|
|
8
8
|
createGenesisChange,
|
|
9
9
|
signDocumentChange
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-W7H2UYQL.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-Q7YPP3WO.mjs";
|
|
19
19
|
|
|
20
20
|
// src/client.ts
|
|
21
21
|
import { encode as cborEncode } from "@ipld/dag-cbor";
|
|
@@ -178,7 +178,7 @@ function createSeedClient(baseUrl, options) {
|
|
|
178
178
|
async function publishDocument(input, signer) {
|
|
179
179
|
if (!input.genesis && !input.baseVersion && !input.path) {
|
|
180
180
|
const genesisChange = await createGenesisChange(signer);
|
|
181
|
-
const
|
|
181
|
+
const generation2 = input.generation != null ? Number(input.generation) : 1;
|
|
182
182
|
if (input.changes.every((change) => {
|
|
183
183
|
var _a;
|
|
184
184
|
return ((_a = change.op) == null ? void 0 : _a.case) === "setMetadata";
|
|
@@ -198,7 +198,7 @@ function createSeedClient(baseUrl, options) {
|
|
|
198
198
|
path: "",
|
|
199
199
|
genesis: genesisChange.cid.toString(),
|
|
200
200
|
version: contentChange.cid.toString(),
|
|
201
|
-
generation,
|
|
201
|
+
generation: generation2,
|
|
202
202
|
capability: input.capability
|
|
203
203
|
},
|
|
204
204
|
signer
|
|
@@ -210,7 +210,7 @@ function createSeedClient(baseUrl, options) {
|
|
|
210
210
|
...ref.blobs
|
|
211
211
|
]
|
|
212
212
|
});
|
|
213
|
-
return;
|
|
213
|
+
return { version: contentChange.cid.toString(), genesis: genesisChange.cid.toString(), generation: generation2 };
|
|
214
214
|
}
|
|
215
215
|
const genesisRef = await createVersionRef(
|
|
216
216
|
{
|
|
@@ -218,7 +218,7 @@ function createSeedClient(baseUrl, options) {
|
|
|
218
218
|
path: "",
|
|
219
219
|
genesis: genesisChange.cid.toString(),
|
|
220
220
|
version: genesisChange.cid.toString(),
|
|
221
|
-
generation,
|
|
221
|
+
generation: generation2,
|
|
222
222
|
capability: input.capability
|
|
223
223
|
},
|
|
224
224
|
signer
|
|
@@ -230,7 +230,7 @@ function createSeedClient(baseUrl, options) {
|
|
|
230
230
|
...input,
|
|
231
231
|
baseVersion: genesisChange.cid.toString(),
|
|
232
232
|
genesis: genesisChange.cid.toString(),
|
|
233
|
-
generation
|
|
233
|
+
generation: generation2
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
236
|
const prepareInput = {
|
|
@@ -242,7 +242,7 @@ function createSeedClient(baseUrl, options) {
|
|
|
242
242
|
visibility: input.visibility
|
|
243
243
|
};
|
|
244
244
|
const { unsignedChange } = await request("PrepareDocumentChange", prepareInput);
|
|
245
|
-
const { publishInput } = await signDocumentChange(
|
|
245
|
+
const { publishInput, changeCid, genesis, generation } = await signDocumentChange(
|
|
246
246
|
{
|
|
247
247
|
account: input.account,
|
|
248
248
|
path: input.path,
|
|
@@ -255,6 +255,7 @@ function createSeedClient(baseUrl, options) {
|
|
|
255
255
|
signer
|
|
256
256
|
);
|
|
257
257
|
await publish(publishInput);
|
|
258
|
+
return { version: changeCid.toString(), genesis, generation };
|
|
258
259
|
}
|
|
259
260
|
return {
|
|
260
261
|
baseUrl: normalizedBaseUrl,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createChange,
|
|
3
3
|
createChangeOps
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-W7H2UYQL.mjs";
|
|
5
5
|
import {
|
|
6
6
|
createVersionRef
|
|
7
7
|
} from "./chunk-PJ2RFT5A.mjs";
|
|
8
8
|
import {
|
|
9
9
|
resolveDocumentState
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-73JZJ5YC.mjs";
|
|
11
11
|
import {
|
|
12
12
|
entityQueryPathToHmIdPath,
|
|
13
13
|
packHmId,
|
|
14
14
|
unpackHmId
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-Q7YPP3WO.mjs";
|
|
16
16
|
|
|
17
17
|
// src/auto-link.ts
|
|
18
18
|
import { CID } from "multiformats/cid";
|
|
@@ -49,6 +49,7 @@ function documentHasSelfQuery(document, documentId) {
|
|
|
49
49
|
const parentPathStr = (documentId.path || []).join("/");
|
|
50
50
|
function isSelfMatch(include) {
|
|
51
51
|
if (!include) return false;
|
|
52
|
+
if (!include.space && !include.path) return true;
|
|
52
53
|
if (include.space !== documentId.uid) return false;
|
|
53
54
|
const includePath = entityQueryPathToHmIdPath(include.path);
|
|
54
55
|
return (includePath || []).join("/") === parentPathStr;
|
|
@@ -58,6 +59,7 @@ function documentHasSelfQuery(document, documentId) {
|
|
|
58
59
|
for (const node of nodes) {
|
|
59
60
|
if (node.block.type === "Query") {
|
|
60
61
|
const includes = (_b = (_a = node.block.attributes) == null ? void 0 : _a.query) == null ? void 0 : _b.includes;
|
|
62
|
+
if (!includes || includes.length === 0) return true;
|
|
61
63
|
if (includes == null ? void 0 : includes.some(isSelfMatch)) return true;
|
|
62
64
|
}
|
|
63
65
|
if (node.children && searchBlocks(node.children)) return true;
|
|
@@ -36,6 +36,9 @@ var HMQueryTableColumnSchema = z.object({
|
|
|
36
36
|
});
|
|
37
37
|
var HMQueryTableConfigSchema = z.object({
|
|
38
38
|
columns: z.array(HMQueryTableColumnSchema),
|
|
39
|
+
// Legacy `sorting` field from the pre-unification table config. Sort now lives
|
|
40
|
+
// in the query's `sort` field; this is tolerated (and ignored) so old
|
|
41
|
+
// persisted documents still validate without crashing.
|
|
39
42
|
sorting: z.array(z.object({ id: z.string(), desc: z.boolean() })).optional()
|
|
40
43
|
});
|
|
41
44
|
var baseAnnotationProperties = {
|
|
@@ -474,17 +477,33 @@ var HMQueryInclusionSchema = z.object({
|
|
|
474
477
|
path: z.string().optional(),
|
|
475
478
|
mode: z.union([z.literal("Children"), z.literal("AllDescendants")])
|
|
476
479
|
});
|
|
480
|
+
var legacySortTermMap = {
|
|
481
|
+
Title: "title",
|
|
482
|
+
Path: "path",
|
|
483
|
+
CreateTime: "created",
|
|
484
|
+
UpdateTime: "updated",
|
|
485
|
+
DisplayTime: "displayTime",
|
|
486
|
+
ActivityTime: "activity"
|
|
487
|
+
};
|
|
488
|
+
var legacyTimeSortTerms = /* @__PURE__ */ new Set(["CreateTime", "UpdateTime", "DisplayTime", "ActivityTime"]);
|
|
489
|
+
function normalizeQuerySortEntry(entry) {
|
|
490
|
+
const rawTerm = entry.term ?? "updated";
|
|
491
|
+
let reverse = entry.reverse ?? false;
|
|
492
|
+
const mapped = legacySortTermMap[rawTerm];
|
|
493
|
+
if (mapped !== void 0) {
|
|
494
|
+
if (legacyTimeSortTerms.has(rawTerm)) reverse = !reverse;
|
|
495
|
+
return { term: mapped, reverse };
|
|
496
|
+
}
|
|
497
|
+
return { term: rawTerm, reverse };
|
|
498
|
+
}
|
|
499
|
+
function normalizeQuerySort(sort) {
|
|
500
|
+
if (!Array.isArray(sort)) return [];
|
|
501
|
+
return sort.map(normalizeQuerySortEntry);
|
|
502
|
+
}
|
|
477
503
|
var HMQuerySortSchema = z.object({
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
z.literal("Title"),
|
|
482
|
-
z.literal("CreateTime"),
|
|
483
|
-
z.literal("UpdateTime"),
|
|
484
|
-
z.literal("DisplayTime"),
|
|
485
|
-
z.literal("ActivityTime")
|
|
486
|
-
])
|
|
487
|
-
});
|
|
504
|
+
term: z.string().optional(),
|
|
505
|
+
reverse: z.boolean().optional()
|
|
506
|
+
}).transform(normalizeQuerySortEntry);
|
|
488
507
|
var HMQuerySchema = z.object({
|
|
489
508
|
includes: z.array(HMQueryInclusionSchema),
|
|
490
509
|
sort: z.array(HMQuerySortSchema).optional(),
|
|
@@ -742,6 +761,10 @@ var HMNavigationItemSchema = z.object({
|
|
|
742
761
|
link: z.string()
|
|
743
762
|
});
|
|
744
763
|
var HMDraftContentSchema = z.object({
|
|
764
|
+
/** Baselines superseded by reference maintenance; stale autosaves must not restore them. */
|
|
765
|
+
maintenancePreviousDeps: z.array(z.array(z.string())).optional(),
|
|
766
|
+
/** Monotonic local maintenance epoch; prevents stale same-version autosaves. */
|
|
767
|
+
maintenanceRevision: z.number().int().nonnegative().default(0),
|
|
745
768
|
content: z.array(z.any()),
|
|
746
769
|
// EditorBlock validation is handled elsewhere
|
|
747
770
|
deps: z.array(z.string().min(1)).default([]),
|
|
@@ -752,12 +775,19 @@ var HMDraftContentSchema = z.object({
|
|
|
752
775
|
* auto-rebase classifier to distinguish locally-edited blocks from incoming
|
|
753
776
|
* remote edits. Persisted so reload-after-rebase keeps the touch history.
|
|
754
777
|
*/
|
|
778
|
+
removedChildDocumentIds: z.array(z.string()).optional(),
|
|
755
779
|
mineTouchedIds: z.array(z.string()).optional(),
|
|
756
780
|
/**
|
|
757
781
|
* Snapshot of the published HMBlockNode[] tree at the time the draft was
|
|
758
782
|
* started (or last rebased). Acts as the merge base for three-way diff.
|
|
759
783
|
*/
|
|
760
|
-
baseBlocks: z.array(z.any()).optional()
|
|
784
|
+
baseBlocks: z.array(z.any()).optional(),
|
|
785
|
+
/**
|
|
786
|
+
* Optional path the user picked for this not-yet-published draft via the
|
|
787
|
+
* rename affordance in the publish popover. Persisted so it survives reloads
|
|
788
|
+
* and is honored at publish time instead of the title-derived slug.
|
|
789
|
+
*/
|
|
790
|
+
publishPath: z.array(z.string()).optional()
|
|
761
791
|
});
|
|
762
792
|
var HMDraftMetaBaseSchema = z.object({
|
|
763
793
|
id: z.string(),
|
|
@@ -1487,6 +1517,8 @@ export {
|
|
|
1487
1517
|
HMSiteMemberSchema,
|
|
1488
1518
|
HMAccountsMetadataSchema,
|
|
1489
1519
|
HMQueryInclusionSchema,
|
|
1520
|
+
normalizeQuerySortEntry,
|
|
1521
|
+
normalizeQuerySort,
|
|
1490
1522
|
HMQuerySortSchema,
|
|
1491
1523
|
HMQuerySchema,
|
|
1492
1524
|
HMBlockTableSchema,
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
entityQueryPathToHmIdPath,
|
|
3
3
|
parseFragment,
|
|
4
4
|
unpackHmId
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Q7YPP3WO.mjs";
|
|
6
6
|
|
|
7
7
|
// src/hm-resolver.ts
|
|
8
8
|
async function resolveHypermediaUrl(url, opts) {
|
|
@@ -66,8 +66,21 @@ async function resolveHypermediaUrl(url, opts) {
|
|
|
66
66
|
}
|
|
67
67
|
throw error;
|
|
68
68
|
}
|
|
69
|
+
if ((opts == null ? void 0 : opts.requireSuccessfulResponse) && response.status !== 200) {
|
|
70
|
+
throw new Error(`Hypermedia URL resolution failed with HTTP ${response.status}`);
|
|
71
|
+
}
|
|
69
72
|
if (response.status === 200) {
|
|
70
73
|
const rawId = response.headers.get("x-hypermedia-id");
|
|
74
|
+
if ((opts == null ? void 0 : opts.requireSuccessfulResponse) && !rawId && [
|
|
75
|
+
"x-hypermedia-id",
|
|
76
|
+
"x-hypermedia-version",
|
|
77
|
+
"x-hypermedia-title",
|
|
78
|
+
"x-hypermedia-target",
|
|
79
|
+
"x-hypermedia-authors",
|
|
80
|
+
"x-hypermedia-type"
|
|
81
|
+
].some((header) => response.headers.has(header))) {
|
|
82
|
+
throw new Error("Missing Hypermedia identity response header");
|
|
83
|
+
}
|
|
71
84
|
const id = rawId ? decodeURIComponent(rawId) : null;
|
|
72
85
|
const version = response.headers.get("x-hypermedia-version");
|
|
73
86
|
const encodedTitle = response.headers.get("x-hypermedia-title");
|
|
@@ -89,6 +102,7 @@ async function resolveHypermediaUrl(url, opts) {
|
|
|
89
102
|
} catch {
|
|
90
103
|
}
|
|
91
104
|
if (!hmId) {
|
|
105
|
+
if (opts == null ? void 0 : opts.requireSuccessfulResponse) throw new Error("Invalid Hypermedia identity response header");
|
|
92
106
|
return null;
|
|
93
107
|
}
|
|
94
108
|
return {
|
|
@@ -118,6 +118,8 @@ async function signDocumentChange(input, signer) {
|
|
|
118
118
|
);
|
|
119
119
|
return {
|
|
120
120
|
changeCid,
|
|
121
|
+
genesis: effectiveGenesis,
|
|
122
|
+
generation: effectiveGeneration,
|
|
121
123
|
publishInput: {
|
|
122
124
|
blobs: [{ data: normalizeBytes(signedBytes), cid: changeCid.toString() }, ...refBlobs.blobs]
|
|
123
125
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
normalizeQuerySort,
|
|
2
3
|
unpackHmId
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Q7YPP3WO.mjs";
|
|
4
5
|
|
|
5
6
|
// src/blocks-to-markdown.ts
|
|
6
7
|
import { stringify as stringifyYaml } from "yaml";
|
|
@@ -589,7 +590,7 @@ async function resolveBlockEmbed(block, depth, ctx) {
|
|
|
589
590
|
}
|
|
590
591
|
}
|
|
591
592
|
async function resolveQuery(block, depth, ctx) {
|
|
592
|
-
var _a
|
|
593
|
+
var _a;
|
|
593
594
|
const ind = resolvedIndent(depth);
|
|
594
595
|
try {
|
|
595
596
|
const attrs = block.attributes;
|
|
@@ -603,7 +604,7 @@ async function resolveQuery(block, depth, ctx) {
|
|
|
603
604
|
path: inc.path,
|
|
604
605
|
mode: inc.mode || "Children"
|
|
605
606
|
}));
|
|
606
|
-
sort = (
|
|
607
|
+
sort = normalizeQuerySort(queryConfig.sort);
|
|
607
608
|
limit = queryConfig.limit;
|
|
608
609
|
} else {
|
|
609
610
|
const space = (attrs == null ? void 0 : attrs.space) || "";
|
|
@@ -619,13 +620,13 @@ async function resolveQuery(block, depth, ctx) {
|
|
|
619
620
|
}
|
|
620
621
|
const results = await ctx.client.request("Query", {
|
|
621
622
|
includes,
|
|
622
|
-
sort: sort
|
|
623
|
+
sort: (sort == null ? void 0 : sort.length) ? sort : [{ term: "updated", reverse: true }],
|
|
623
624
|
limit: limit || 10
|
|
624
625
|
});
|
|
625
|
-
if (!((
|
|
626
|
+
if (!((_a = results == null ? void 0 : results.results) == null ? void 0 : _a.length)) return ind + "<!-- Query: no results -->";
|
|
626
627
|
return results.results.map((doc) => {
|
|
627
|
-
var _a2,
|
|
628
|
-
const name = ((_a2 = doc.metadata) == null ? void 0 : _a2.name) || ((
|
|
628
|
+
var _a2, _b;
|
|
629
|
+
const name = ((_a2 = doc.metadata) == null ? void 0 : _a2.name) || ((_b = doc.id.path) == null ? void 0 : _b.join("/")) || doc.id.uid;
|
|
629
630
|
return ind + `- [${name}](${doc.id.id})`;
|
|
630
631
|
}).join("\n");
|
|
631
632
|
} catch (error) {
|
package/dist/client.d.ts
CHANGED
|
@@ -6,6 +6,12 @@ import type { AnySigner } from './signer';
|
|
|
6
6
|
* If the query contains only a __value key, returns the primitive value directly.
|
|
7
7
|
*/
|
|
8
8
|
export declare function deserializeQueryString<T>(queryString: string, schema: z.ZodType<T>): T;
|
|
9
|
+
/** Identifiers of the signed publication, available before the document index catches up. */
|
|
10
|
+
export type PublishDocumentResult = {
|
|
11
|
+
version: string;
|
|
12
|
+
genesis: string;
|
|
13
|
+
generation: number;
|
|
14
|
+
};
|
|
9
15
|
export type PublishDocumentInput = {
|
|
10
16
|
account: string;
|
|
11
17
|
changes: HMPrepareDocumentChangeInput['changes'];
|
|
@@ -35,7 +41,7 @@ export type SeedClient = {
|
|
|
35
41
|
}>['output']>;
|
|
36
42
|
publish(input: PublishBlobsRequest['input']): Promise<PublishBlobsRequest['output']>;
|
|
37
43
|
publishBlobs(input: PublishBlobsRequest['input']): Promise<PublishBlobsRequest['output']>;
|
|
38
|
-
publishDocument(input: PublishDocumentInput, signer: AnySigner): Promise<
|
|
44
|
+
publishDocument(input: PublishDocumentInput, signer: AnySigner): Promise<PublishDocumentResult>;
|
|
39
45
|
baseUrl: string;
|
|
40
46
|
};
|
|
41
47
|
export declare function createSeedClient(baseUrl: string, options?: SeedClientOptions): SeedClient;
|
package/dist/client.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSeedClient,
|
|
3
3
|
deserializeQueryString
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NGLLI4HI.mjs";
|
|
5
5
|
import "./chunk-CBELM7KX.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-W7H2UYQL.mjs";
|
|
7
7
|
import "./chunk-PJ2RFT5A.mjs";
|
|
8
8
|
import "./chunk-LVAHHQIK.mjs";
|
|
9
9
|
import "./chunk-DR3HJ6BV.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-Q7YPP3WO.mjs";
|
|
11
11
|
import "./chunk-7P6ASYW6.mjs";
|
|
12
12
|
export {
|
|
13
13
|
createSeedClient,
|
package/dist/comment.mjs
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
deleteComment,
|
|
5
5
|
trimTrailingEmptyBlocks,
|
|
6
6
|
updateComment
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IQONPGLX.mjs";
|
|
8
8
|
import "./chunk-N3P7S5YZ.mjs";
|
|
9
9
|
import "./chunk-LVAHHQIK.mjs";
|
|
10
10
|
import "./chunk-DR3HJ6BV.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-Q7YPP3WO.mjs";
|
|
12
12
|
import "./chunk-7P6ASYW6.mjs";
|
|
13
13
|
export {
|
|
14
14
|
commentRecordIdFromBlob,
|
package/dist/document-state.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
followToDocument,
|
|
5
5
|
resolveDocumentState,
|
|
6
6
|
resolveEditableDocument
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-73JZJ5YC.mjs";
|
|
8
|
+
import "./chunk-Q7YPP3WO.mjs";
|
|
9
9
|
import "./chunk-7P6ASYW6.mjs";
|
|
10
10
|
export {
|
|
11
11
|
describeRedirect,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
editorBlockToHMBlock,
|
|
3
3
|
editorBlocksToHMBlockNodes
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Q2NA774U.mjs";
|
|
5
5
|
import "./chunk-N3P7S5YZ.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-Q7YPP3WO.mjs";
|
|
7
7
|
import "./chunk-7P6ASYW6.mjs";
|
|
8
8
|
export {
|
|
9
9
|
editorBlockToHMBlock,
|
package/dist/hm-resolver.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export type DomainResolverFn = (hostname: string) => Promise<DomainResolution>;
|
|
|
15
15
|
export type DomainIdChangedCallback = (domain: string, oldUid: string, newUid: string) => void;
|
|
16
16
|
export type ResolveOptions = {
|
|
17
17
|
domainResolver?: DomainResolverFn;
|
|
18
|
+
/** Distinguish failed HTTP/malformed metadata from a verified ordinary web page. */
|
|
19
|
+
requireSuccessfulResponse?: boolean;
|
|
18
20
|
};
|
|
19
21
|
/**
|
|
20
22
|
* Resolve a web URL to its Hypermedia metadata.
|
package/dist/hm-resolver.mjs
CHANGED