@seed-hypermedia/client 0.0.88 → 0.0.90
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.mjs +3 -3
- package/dist/blocks-to-markdown.mjs +2 -2
- package/dist/capability.mjs +2 -2
- package/dist/{chunk-BMPK76B2.mjs → chunk-4HP5N4I7.mjs} +3 -3
- package/dist/{chunk-J45O2Y7E.mjs → chunk-HNQDRHGQ.mjs} +2 -2
- package/dist/{chunk-W3MTG26Q.mjs → chunk-JODNNMBZ.mjs} +4 -1
- package/dist/{chunk-I273FRIR.mjs → chunk-RRXP7SCF.mjs} +1 -1
- package/dist/{chunk-7QKG43UV.mjs → chunk-T7WF36LU.mjs} +1 -1
- package/dist/{chunk-GVFAXUKA.mjs → chunk-UFLGAJWJ.mjs} +29 -7
- package/dist/{chunk-STKAE4YB.mjs → chunk-UTZ42CJC.mjs} +1 -1
- package/dist/{chunk-GIO2JLKT.mjs → chunk-VNZHLLJE.mjs} +31 -0
- package/dist/{chunk-ZVJGJE2L.mjs → chunk-W7AGZEC2.mjs} +1 -1
- package/dist/{chunk-GN76IN3M.mjs → chunk-XXUI3VKA.mjs} +1 -1
- package/dist/{chunk-DVJ3XGXS.mjs → chunk-Z2S7TL5U.mjs} +1 -1
- package/dist/{chunk-IW5GLPEG.mjs → chunk-Z72PGJKG.mjs} +1 -1
- package/dist/{chunk-7OWFPOHI.mjs → chunk-ZNV6NTUU.mjs} +1 -1
- package/dist/client.mjs +2 -2
- 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.mjs +2 -2
- package/dist/hm-types.d.ts +1490 -49
- package/dist/hm-types.mjs +9 -1
- package/dist/hmblock-to-editorblock.mjs +2 -2
- package/dist/index.mjs +13 -13
- package/dist/pdf-to-blocks.mjs +3 -3
- package/dist/resource-read.mjs +4 -4
- package/dist/tei-to-blocks.mjs +2 -2
- package/dist/unicode.mjs +1 -1
- package/package.json +1 -1
package/dist/auto-link.mjs
CHANGED
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
documentContainsLinkToChild,
|
|
5
5
|
documentHasSelfQuery,
|
|
6
6
|
shouldAutoLinkParent
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HNQDRHGQ.mjs";
|
|
8
8
|
import "./chunk-O5MHN2EO.mjs";
|
|
9
9
|
import "./chunk-PJ2RFT5A.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-UTZ42CJC.mjs";
|
|
11
11
|
import "./chunk-LVAHHQIK.mjs";
|
|
12
12
|
import "./chunk-DR3HJ6BV.mjs";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-VNZHLLJE.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-UFLGAJWJ.mjs";
|
|
11
|
+
import "./chunk-VNZHLLJE.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-RRXP7SCF.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-VNZHLLJE.mjs";
|
|
9
9
|
import "./chunk-3TPCJCVO.mjs";
|
|
10
10
|
import "./chunk-7P6ASYW6.mjs";
|
|
11
11
|
export {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Z2S7TL5U.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createSeedClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JODNNMBZ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
unpackHmId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VNZHLLJE.mjs";
|
|
10
10
|
|
|
11
11
|
// src/resource-read.ts
|
|
12
12
|
async function resolveIdWithClient(rawId, options = {}) {
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
} from "./chunk-PJ2RFT5A.mjs";
|
|
8
8
|
import {
|
|
9
9
|
resolveDocumentState
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UTZ42CJC.mjs";
|
|
11
11
|
import {
|
|
12
12
|
entityQueryPathToHmIdPath,
|
|
13
13
|
packHmId,
|
|
14
14
|
unpackHmId
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VNZHLLJE.mjs";
|
|
16
16
|
|
|
17
17
|
// src/auto-link.ts
|
|
18
18
|
import { CID } from "multiformats/cid";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
HMActionSchema,
|
|
16
16
|
HMRequestSchema,
|
|
17
17
|
packHmId
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-VNZHLLJE.mjs";
|
|
19
19
|
|
|
20
20
|
// src/client.ts
|
|
21
21
|
import { encode as cborEncode } from "@ipld/dag-cbor";
|
|
@@ -81,6 +81,9 @@ var QUERY_PARAM_SERIALIZERS = {
|
|
|
81
81
|
ListCapabilities: (input) => ({
|
|
82
82
|
targetId: packHmId(input.targetId)
|
|
83
83
|
}),
|
|
84
|
+
ListRefs: (input) => ({
|
|
85
|
+
targetId: packHmId(input.targetId)
|
|
86
|
+
}),
|
|
84
87
|
DiscoveryStatus: (input) => ({
|
|
85
88
|
uid: input.uid,
|
|
86
89
|
path: input.path.join("/"),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeQuerySort,
|
|
3
3
|
unpackHmId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VNZHLLJE.mjs";
|
|
5
5
|
|
|
6
6
|
// src/blocks-to-markdown.ts
|
|
7
7
|
import { stringify as stringifyYaml } from "yaml";
|
|
@@ -485,10 +485,31 @@ async function contentToResolvedMarkdown(content, options) {
|
|
|
485
485
|
}
|
|
486
486
|
async function documentToResolvedMarkdownWithContext(doc, ctx) {
|
|
487
487
|
const lines = [emitFrontmatter(doc.metadata || {})];
|
|
488
|
-
const body = await blockNodesToResolvedMarkdown(doc
|
|
488
|
+
const body = await blockNodesToResolvedMarkdown(resolvedDocumentContent(doc), ctx);
|
|
489
489
|
if (body) lines.push(body);
|
|
490
490
|
return lines.join("\n");
|
|
491
491
|
}
|
|
492
|
+
function resolvedDocumentContent(doc) {
|
|
493
|
+
var _a, _b;
|
|
494
|
+
const content = doc.content || [];
|
|
495
|
+
const root = content[0];
|
|
496
|
+
if (!doc.account || content.length !== 1 || (root == null ? void 0 : root.block.type) !== "Query") return content;
|
|
497
|
+
const query = (_a = root.block.attributes) == null ? void 0 : _a.query;
|
|
498
|
+
const include = (_b = query == null ? void 0 : query.includes) == null ? void 0 : _b[0];
|
|
499
|
+
if ((query == null ? void 0 : query.includes.length) !== 1 || !include || include.space || include.path) return content;
|
|
500
|
+
return [
|
|
501
|
+
{
|
|
502
|
+
...root,
|
|
503
|
+
block: {
|
|
504
|
+
...root.block,
|
|
505
|
+
attributes: {
|
|
506
|
+
...root.block.attributes,
|
|
507
|
+
query: { ...query, includes: [{ ...include, space: doc.account, path: doc.path }] }
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
];
|
|
512
|
+
}
|
|
492
513
|
async function blockNodesToResolvedMarkdown(nodes, ctx) {
|
|
493
514
|
const lines = [];
|
|
494
515
|
for (const node of nodes) {
|
|
@@ -590,7 +611,7 @@ async function resolveBlockEmbed(block, depth, ctx) {
|
|
|
590
611
|
}
|
|
591
612
|
}
|
|
592
613
|
async function resolveQuery(block, depth, ctx) {
|
|
593
|
-
var _a;
|
|
614
|
+
var _a, _b;
|
|
594
615
|
const ind = resolvedIndent(depth);
|
|
595
616
|
try {
|
|
596
617
|
const attrs = block.attributes;
|
|
@@ -599,6 +620,7 @@ async function resolveQuery(block, depth, ctx) {
|
|
|
599
620
|
let sort;
|
|
600
621
|
let limit;
|
|
601
622
|
if (queryConfig == null ? void 0 : queryConfig.includes) {
|
|
623
|
+
if (!((_a = queryConfig.includes[0]) == null ? void 0 : _a.space)) return ind + "<!-- Query: no space specified -->";
|
|
602
624
|
includes = queryConfig.includes.map((inc) => ({
|
|
603
625
|
space: inc.space,
|
|
604
626
|
path: inc.path,
|
|
@@ -623,10 +645,10 @@ async function resolveQuery(block, depth, ctx) {
|
|
|
623
645
|
sort: (sort == null ? void 0 : sort.length) ? sort : [{ term: "updated", reverse: true }],
|
|
624
646
|
limit: limit || 10
|
|
625
647
|
});
|
|
626
|
-
if (!((
|
|
648
|
+
if (!((_b = results == null ? void 0 : results.results) == null ? void 0 : _b.length)) return ind + "<!-- Query: no results -->";
|
|
627
649
|
return results.results.map((doc) => {
|
|
628
|
-
var _a2,
|
|
629
|
-
const name = ((_a2 = doc.metadata) == null ? void 0 : _a2.name) || ((
|
|
650
|
+
var _a2, _b2;
|
|
651
|
+
const name = ((_a2 = doc.metadata) == null ? void 0 : _a2.name) || ((_b2 = doc.id.path) == null ? void 0 : _b2.join("/")) || doc.id.uid;
|
|
630
652
|
return ind + `- [${name}](${doc.id.id})`;
|
|
631
653
|
}).join("\n");
|
|
632
654
|
} catch (error) {
|
|
@@ -716,7 +738,7 @@ async function resolveEmbeddedResource(link, ctx) {
|
|
|
716
738
|
resolved = {
|
|
717
739
|
label: ((_a = resource.document.metadata) == null ? void 0 : _a.name) || fallbackDocLabel(id),
|
|
718
740
|
type: "document",
|
|
719
|
-
content: resource.document
|
|
741
|
+
content: resolvedDocumentContent(resource.document),
|
|
720
742
|
version: id.version || resource.document.version,
|
|
721
743
|
latestVersion: resource.document.version
|
|
722
744
|
};
|
|
@@ -1085,6 +1085,31 @@ var HMListCapabilitiesRequestSchema = z.object({
|
|
|
1085
1085
|
input: HMListCapabilitiesInputSchema,
|
|
1086
1086
|
output: HMListCapabilitiesOutputSchema
|
|
1087
1087
|
});
|
|
1088
|
+
var HMRawRefSchema = z.object({
|
|
1089
|
+
id: z.string().optional(),
|
|
1090
|
+
account: z.string().optional(),
|
|
1091
|
+
path: z.string().optional(),
|
|
1092
|
+
target: z.object({
|
|
1093
|
+
version: z.object({ genesis: z.string().optional(), version: z.string().optional() }).optional(),
|
|
1094
|
+
redirect: z.object({ account: z.string().optional(), path: z.string().optional(), republish: z.boolean().optional() }).optional(),
|
|
1095
|
+
tombstone: z.object({}).optional()
|
|
1096
|
+
}).optional(),
|
|
1097
|
+
signer: z.string().optional(),
|
|
1098
|
+
capability: z.string().optional(),
|
|
1099
|
+
timestamp: z.string().optional(),
|
|
1100
|
+
generationInfo: z.object({ genesis: z.string().optional(), generation: z.string().optional() }).optional()
|
|
1101
|
+
});
|
|
1102
|
+
var HMListRefsOutputSchema = z.object({
|
|
1103
|
+
refs: z.array(HMRawRefSchema)
|
|
1104
|
+
});
|
|
1105
|
+
var HMListRefsInputSchema = z.object({
|
|
1106
|
+
targetId: unpackedHmIdSchema
|
|
1107
|
+
});
|
|
1108
|
+
var HMListRefsRequestSchema = z.object({
|
|
1109
|
+
key: z.literal("ListRefs"),
|
|
1110
|
+
input: HMListRefsInputSchema,
|
|
1111
|
+
output: HMListRefsOutputSchema
|
|
1112
|
+
});
|
|
1088
1113
|
var HMListDocumentCollaboratorsInputSchema = z.object({
|
|
1089
1114
|
targetId: unpackedHmIdSchema
|
|
1090
1115
|
});
|
|
@@ -1295,6 +1320,7 @@ var HMGetRequestSchema = z.discriminatedUnion("key", [
|
|
|
1295
1320
|
HMListCitationsRequestSchema,
|
|
1296
1321
|
HMListChangesRequestSchema,
|
|
1297
1322
|
HMListCapabilitiesRequestSchema,
|
|
1323
|
+
HMListRefsRequestSchema,
|
|
1298
1324
|
HMListDocumentCollaboratorsRequestSchema,
|
|
1299
1325
|
HMInteractionSummaryRequestSchema,
|
|
1300
1326
|
HMListCommentVersionsRequestSchema,
|
|
@@ -1328,6 +1354,7 @@ var HMRequestSchema = z.discriminatedUnion("key", [
|
|
|
1328
1354
|
HMListCitationsRequestSchema,
|
|
1329
1355
|
HMListChangesRequestSchema,
|
|
1330
1356
|
HMListCapabilitiesRequestSchema,
|
|
1357
|
+
HMListRefsRequestSchema,
|
|
1331
1358
|
HMListDocumentCollaboratorsRequestSchema,
|
|
1332
1359
|
HMInteractionSummaryRequestSchema,
|
|
1333
1360
|
HMListCommentVersionsRequestSchema,
|
|
@@ -1642,6 +1669,10 @@ export {
|
|
|
1642
1669
|
HMListCapabilitiesOutputSchema,
|
|
1643
1670
|
HMListCapabilitiesInputSchema,
|
|
1644
1671
|
HMListCapabilitiesRequestSchema,
|
|
1672
|
+
HMRawRefSchema,
|
|
1673
|
+
HMListRefsOutputSchema,
|
|
1674
|
+
HMListRefsInputSchema,
|
|
1675
|
+
HMListRefsRequestSchema,
|
|
1645
1676
|
HMListDocumentCollaboratorsInputSchema,
|
|
1646
1677
|
HMListDocumentCollaboratorsOutputSchema,
|
|
1647
1678
|
HMListDocumentCollaboratorsRequestSchema,
|
package/dist/client.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSeedClient,
|
|
3
3
|
deserializeQueryString
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JODNNMBZ.mjs";
|
|
5
5
|
import "./chunk-CBELM7KX.mjs";
|
|
6
6
|
import "./chunk-O5MHN2EO.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-VNZHLLJE.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-T7WF36LU.mjs";
|
|
8
8
|
import "./chunk-JKKS35IS.mjs";
|
|
9
9
|
import "./chunk-LVAHHQIK.mjs";
|
|
10
10
|
import "./chunk-DR3HJ6BV.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-VNZHLLJE.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-UTZ42CJC.mjs";
|
|
8
|
+
import "./chunk-VNZHLLJE.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-XXUI3VKA.mjs";
|
|
5
5
|
import "./chunk-JKKS35IS.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-VNZHLLJE.mjs";
|
|
7
7
|
import "./chunk-7P6ASYW6.mjs";
|
|
8
8
|
export {
|
|
9
9
|
editorBlockToHMBlock,
|
package/dist/hm-resolver.mjs
CHANGED