@seed-hypermedia/client 0.0.55 → 0.0.57

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.
@@ -1096,6 +1096,23 @@ var HMListDomainsRequestSchema = z.object({
1096
1096
  input: HMListDomainsInputSchema,
1097
1097
  output: HMListDomainsOutputSchema
1098
1098
  });
1099
+ var HMDiscoveryStatusInputSchema = z.object({
1100
+ uid: z.string(),
1101
+ path: z.array(z.string()),
1102
+ version: z.string().optional(),
1103
+ /** Accept any discovered version as success, not just `version`. */
1104
+ latest: z.boolean().optional()
1105
+ });
1106
+ var HMDiscoveryStatusOutputSchema = z.object({
1107
+ state: z.enum(["pending", "found", "failed"]),
1108
+ version: z.string().optional(),
1109
+ error: z.string().optional()
1110
+ });
1111
+ var HMDiscoveryStatusRequestSchema = z.object({
1112
+ key: z.literal("DiscoveryStatus"),
1113
+ input: HMDiscoveryStatusInputSchema,
1114
+ output: HMDiscoveryStatusOutputSchema
1115
+ });
1099
1116
  var HMGetRequestSchema = z.discriminatedUnion("key", [
1100
1117
  HMResourceRequestSchema,
1101
1118
  HMResourceMetadataRequestSchema,
@@ -1121,7 +1138,8 @@ var HMGetRequestSchema = z.discriminatedUnion("key", [
1121
1138
  HMInteractionSummaryRequestSchema,
1122
1139
  HMListCommentVersionsRequestSchema,
1123
1140
  HMGetDomainRequestSchema,
1124
- HMListDomainsRequestSchema
1141
+ HMListDomainsRequestSchema,
1142
+ HMDiscoveryStatusRequestSchema
1125
1143
  ]);
1126
1144
  var HMActionSchema = z.discriminatedUnion("key", [
1127
1145
  HMPublishBlobsRequestSchema,
@@ -1153,6 +1171,7 @@ var HMRequestSchema = z.discriminatedUnion("key", [
1153
1171
  HMListCommentVersionsRequestSchema,
1154
1172
  HMGetDomainRequestSchema,
1155
1173
  HMListDomainsRequestSchema,
1174
+ HMDiscoveryStatusRequestSchema,
1156
1175
  HMPublishBlobsRequestSchema,
1157
1176
  HMPrepareDocumentChangeRequestSchema
1158
1177
  ]);
@@ -1478,6 +1497,9 @@ export {
1478
1497
  HMListDomainsInputSchema,
1479
1498
  HMListDomainsOutputSchema,
1480
1499
  HMListDomainsRequestSchema,
1500
+ HMDiscoveryStatusInputSchema,
1501
+ HMDiscoveryStatusOutputSchema,
1502
+ HMDiscoveryStatusRequestSchema,
1481
1503
  HMGetRequestSchema,
1482
1504
  HMActionSchema,
1483
1505
  HMRequestSchema,
@@ -35162,6 +35162,98 @@ export declare const HMListDomainsRequestSchema: z.ZodObject<{
35162
35162
  };
35163
35163
  }>;
35164
35164
  export type HMListDomainsRequest = z.infer<typeof HMListDomainsRequestSchema>;
35165
+ export declare const HMDiscoveryStatusInputSchema: z.ZodObject<{
35166
+ uid: z.ZodString;
35167
+ path: z.ZodArray<z.ZodString, "many">;
35168
+ version: z.ZodOptional<z.ZodString>;
35169
+ /** Accept any discovered version as success, not just `version`. */
35170
+ latest: z.ZodOptional<z.ZodBoolean>;
35171
+ }, "strip", z.ZodTypeAny, {
35172
+ path: string[];
35173
+ uid: string;
35174
+ version?: string | undefined;
35175
+ latest?: boolean | undefined;
35176
+ }, {
35177
+ path: string[];
35178
+ uid: string;
35179
+ version?: string | undefined;
35180
+ latest?: boolean | undefined;
35181
+ }>;
35182
+ export type HMDiscoveryStatusInput = z.infer<typeof HMDiscoveryStatusInputSchema>;
35183
+ export declare const HMDiscoveryStatusOutputSchema: z.ZodObject<{
35184
+ state: z.ZodEnum<["pending", "found", "failed"]>;
35185
+ version: z.ZodOptional<z.ZodString>;
35186
+ error: z.ZodOptional<z.ZodString>;
35187
+ }, "strip", z.ZodTypeAny, {
35188
+ state: "pending" | "found" | "failed";
35189
+ version?: string | undefined;
35190
+ error?: string | undefined;
35191
+ }, {
35192
+ state: "pending" | "found" | "failed";
35193
+ version?: string | undefined;
35194
+ error?: string | undefined;
35195
+ }>;
35196
+ export type HMDiscoveryStatusOutput = z.infer<typeof HMDiscoveryStatusOutputSchema>;
35197
+ export declare const HMDiscoveryStatusRequestSchema: z.ZodObject<{
35198
+ key: z.ZodLiteral<"DiscoveryStatus">;
35199
+ input: z.ZodObject<{
35200
+ uid: z.ZodString;
35201
+ path: z.ZodArray<z.ZodString, "many">;
35202
+ version: z.ZodOptional<z.ZodString>;
35203
+ /** Accept any discovered version as success, not just `version`. */
35204
+ latest: z.ZodOptional<z.ZodBoolean>;
35205
+ }, "strip", z.ZodTypeAny, {
35206
+ path: string[];
35207
+ uid: string;
35208
+ version?: string | undefined;
35209
+ latest?: boolean | undefined;
35210
+ }, {
35211
+ path: string[];
35212
+ uid: string;
35213
+ version?: string | undefined;
35214
+ latest?: boolean | undefined;
35215
+ }>;
35216
+ output: z.ZodObject<{
35217
+ state: z.ZodEnum<["pending", "found", "failed"]>;
35218
+ version: z.ZodOptional<z.ZodString>;
35219
+ error: z.ZodOptional<z.ZodString>;
35220
+ }, "strip", z.ZodTypeAny, {
35221
+ state: "pending" | "found" | "failed";
35222
+ version?: string | undefined;
35223
+ error?: string | undefined;
35224
+ }, {
35225
+ state: "pending" | "found" | "failed";
35226
+ version?: string | undefined;
35227
+ error?: string | undefined;
35228
+ }>;
35229
+ }, "strip", z.ZodTypeAny, {
35230
+ key: "DiscoveryStatus";
35231
+ input: {
35232
+ path: string[];
35233
+ uid: string;
35234
+ version?: string | undefined;
35235
+ latest?: boolean | undefined;
35236
+ };
35237
+ output: {
35238
+ state: "pending" | "found" | "failed";
35239
+ version?: string | undefined;
35240
+ error?: string | undefined;
35241
+ };
35242
+ }, {
35243
+ key: "DiscoveryStatus";
35244
+ input: {
35245
+ path: string[];
35246
+ uid: string;
35247
+ version?: string | undefined;
35248
+ latest?: boolean | undefined;
35249
+ };
35250
+ output: {
35251
+ state: "pending" | "found" | "failed";
35252
+ version?: string | undefined;
35253
+ error?: string | undefined;
35254
+ };
35255
+ }>;
35256
+ export type HMDiscoveryStatusRequest = z.infer<typeof HMDiscoveryStatusRequestSchema>;
35165
35257
  export declare const HMGetRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodObject<{
35166
35258
  key: z.ZodLiteral<"Resource">;
35167
35259
  input: z.ZodObject<{
@@ -47296,6 +47388,64 @@ export declare const HMGetRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodOb
47296
47388
  lastError: string | null;
47297
47389
  }[];
47298
47390
  };
47391
+ }>, z.ZodObject<{
47392
+ key: z.ZodLiteral<"DiscoveryStatus">;
47393
+ input: z.ZodObject<{
47394
+ uid: z.ZodString;
47395
+ path: z.ZodArray<z.ZodString, "many">;
47396
+ version: z.ZodOptional<z.ZodString>;
47397
+ /** Accept any discovered version as success, not just `version`. */
47398
+ latest: z.ZodOptional<z.ZodBoolean>;
47399
+ }, "strip", z.ZodTypeAny, {
47400
+ path: string[];
47401
+ uid: string;
47402
+ version?: string | undefined;
47403
+ latest?: boolean | undefined;
47404
+ }, {
47405
+ path: string[];
47406
+ uid: string;
47407
+ version?: string | undefined;
47408
+ latest?: boolean | undefined;
47409
+ }>;
47410
+ output: z.ZodObject<{
47411
+ state: z.ZodEnum<["pending", "found", "failed"]>;
47412
+ version: z.ZodOptional<z.ZodString>;
47413
+ error: z.ZodOptional<z.ZodString>;
47414
+ }, "strip", z.ZodTypeAny, {
47415
+ state: "pending" | "found" | "failed";
47416
+ version?: string | undefined;
47417
+ error?: string | undefined;
47418
+ }, {
47419
+ state: "pending" | "found" | "failed";
47420
+ version?: string | undefined;
47421
+ error?: string | undefined;
47422
+ }>;
47423
+ }, "strip", z.ZodTypeAny, {
47424
+ key: "DiscoveryStatus";
47425
+ input: {
47426
+ path: string[];
47427
+ uid: string;
47428
+ version?: string | undefined;
47429
+ latest?: boolean | undefined;
47430
+ };
47431
+ output: {
47432
+ state: "pending" | "found" | "failed";
47433
+ version?: string | undefined;
47434
+ error?: string | undefined;
47435
+ };
47436
+ }, {
47437
+ key: "DiscoveryStatus";
47438
+ input: {
47439
+ path: string[];
47440
+ uid: string;
47441
+ version?: string | undefined;
47442
+ latest?: boolean | undefined;
47443
+ };
47444
+ output: {
47445
+ state: "pending" | "found" | "failed";
47446
+ version?: string | undefined;
47447
+ error?: string | undefined;
47448
+ };
47299
47449
  }>]>;
47300
47450
  export type HMGetRequest = z.infer<typeof HMGetRequestSchema>;
47301
47451
  export declare const HMActionSchema: z.ZodDiscriminatedUnion<"key", [z.ZodObject<{
@@ -60202,6 +60352,64 @@ export declare const HMRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodObjec
60202
60352
  lastError: string | null;
60203
60353
  }[];
60204
60354
  };
60355
+ }>, z.ZodObject<{
60356
+ key: z.ZodLiteral<"DiscoveryStatus">;
60357
+ input: z.ZodObject<{
60358
+ uid: z.ZodString;
60359
+ path: z.ZodArray<z.ZodString, "many">;
60360
+ version: z.ZodOptional<z.ZodString>;
60361
+ /** Accept any discovered version as success, not just `version`. */
60362
+ latest: z.ZodOptional<z.ZodBoolean>;
60363
+ }, "strip", z.ZodTypeAny, {
60364
+ path: string[];
60365
+ uid: string;
60366
+ version?: string | undefined;
60367
+ latest?: boolean | undefined;
60368
+ }, {
60369
+ path: string[];
60370
+ uid: string;
60371
+ version?: string | undefined;
60372
+ latest?: boolean | undefined;
60373
+ }>;
60374
+ output: z.ZodObject<{
60375
+ state: z.ZodEnum<["pending", "found", "failed"]>;
60376
+ version: z.ZodOptional<z.ZodString>;
60377
+ error: z.ZodOptional<z.ZodString>;
60378
+ }, "strip", z.ZodTypeAny, {
60379
+ state: "pending" | "found" | "failed";
60380
+ version?: string | undefined;
60381
+ error?: string | undefined;
60382
+ }, {
60383
+ state: "pending" | "found" | "failed";
60384
+ version?: string | undefined;
60385
+ error?: string | undefined;
60386
+ }>;
60387
+ }, "strip", z.ZodTypeAny, {
60388
+ key: "DiscoveryStatus";
60389
+ input: {
60390
+ path: string[];
60391
+ uid: string;
60392
+ version?: string | undefined;
60393
+ latest?: boolean | undefined;
60394
+ };
60395
+ output: {
60396
+ state: "pending" | "found" | "failed";
60397
+ version?: string | undefined;
60398
+ error?: string | undefined;
60399
+ };
60400
+ }, {
60401
+ key: "DiscoveryStatus";
60402
+ input: {
60403
+ path: string[];
60404
+ uid: string;
60405
+ version?: string | undefined;
60406
+ latest?: boolean | undefined;
60407
+ };
60408
+ output: {
60409
+ state: "pending" | "found" | "failed";
60410
+ version?: string | undefined;
60411
+ error?: string | undefined;
60412
+ };
60205
60413
  }>, z.ZodObject<{
60206
60414
  key: z.ZodLiteral<"PublishBlobs">;
60207
60415
  input: z.ZodObject<{
package/dist/hm-types.mjs CHANGED
@@ -47,6 +47,9 @@ import {
47
47
  HMContactRecordSchema,
48
48
  HMContactSchema,
49
49
  HMContactSubscribeSchema,
50
+ HMDiscoveryStatusInputSchema,
51
+ HMDiscoveryStatusOutputSchema,
52
+ HMDiscoveryStatusRequestSchema,
50
53
  HMDocumentInfoSchema,
51
54
  HMDocumentMetadataSchema,
52
55
  HMDocumentSchema,
@@ -179,7 +182,7 @@ import {
179
182
  toNumber,
180
183
  unpackHmId,
181
184
  unpackedHmIdSchema
182
- } from "./chunk-64F47WK6.mjs";
185
+ } from "./chunk-RJAN7AV6.mjs";
183
186
  export {
184
187
  BackgroundColorAnnotationSchema,
185
188
  BlockRangeSchema,
@@ -229,6 +232,9 @@ export {
229
232
  HMContactRecordSchema,
230
233
  HMContactSchema,
231
234
  HMContactSubscribeSchema,
235
+ HMDiscoveryStatusInputSchema,
236
+ HMDiscoveryStatusOutputSchema,
237
+ HMDiscoveryStatusRequestSchema,
232
238
  HMDocumentInfoSchema,
233
239
  HMDocumentMetadataSchema,
234
240
  HMDocumentSchema,
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  serializeBlockRange,
18
18
  toNumber,
19
19
  unpackHmId
20
- } from "./chunk-64F47WK6.mjs";
20
+ } from "./chunk-RJAN7AV6.mjs";
21
21
 
22
22
  // src/capability.ts
23
23
  import { encode as cborEncode2 } from "@ipld/dag-cbor";
@@ -383,6 +383,12 @@ var QUERY_PARAM_SERIALIZERS = {
383
383
  }),
384
384
  ListCapabilities: (input) => ({
385
385
  targetId: packHmId(input.targetId)
386
+ }),
387
+ DiscoveryStatus: (input) => ({
388
+ uid: input.uid,
389
+ path: input.path.join("/"),
390
+ ...input.version ? { v: input.version } : {},
391
+ ...input.latest ? { l: "" } : {}
386
392
  })
387
393
  };
388
394
  function createSeedClient(baseUrl, options) {
@@ -2771,7 +2777,7 @@ function tokenize(markdown) {
2771
2777
  }
2772
2778
  if (line.trim().startsWith("```")) {
2773
2779
  const fenceContent = line.trim().slice(3).trim();
2774
- const { text: language, id } = stripBlockId(fenceContent);
2780
+ const { text: language, id: id2 } = stripBlockId(fenceContent);
2775
2781
  const codeLines = [];
2776
2782
  i++;
2777
2783
  while (i < lines.length && !lines[i].trim().startsWith("```")) {
@@ -2779,13 +2785,13 @@ function tokenize(markdown) {
2779
2785
  i++;
2780
2786
  }
2781
2787
  i++;
2782
- blocks.push({ kind: "code", language, text: codeLines.join("\n"), id });
2788
+ blocks.push({ kind: "code", language, text: codeLines.join("\n"), id: id2 });
2783
2789
  pendingContainerId = void 0;
2784
2790
  continue;
2785
2791
  }
2786
2792
  if (line.trim().startsWith("$$")) {
2787
2793
  const fenceContent = line.trim().slice(2).trim();
2788
- const { id } = stripBlockId(fenceContent);
2794
+ const { id: id2 } = stripBlockId(fenceContent);
2789
2795
  const mathLines = [];
2790
2796
  i++;
2791
2797
  while (i < lines.length && !lines[i].trim().startsWith("$$")) {
@@ -2793,14 +2799,14 @@ function tokenize(markdown) {
2793
2799
  i++;
2794
2800
  }
2795
2801
  i++;
2796
- blocks.push({ kind: "math", text: mathLines.join("\n"), id });
2802
+ blocks.push({ kind: "math", text: mathLines.join("\n"), id: id2 });
2797
2803
  pendingContainerId = void 0;
2798
2804
  continue;
2799
2805
  }
2800
- const headingMatch = line.match(/^(#{1,6})\s+(.+)$/);
2806
+ const headingMatch = line.trim().match(/^(#{1,6})\s+(.+)$/);
2801
2807
  if (headingMatch) {
2802
- const { text, id } = stripBlockId(headingMatch[2]);
2803
- blocks.push({ kind: "heading", level: headingMatch[1].length, text, id });
2808
+ const { text, id: id2 } = stripBlockId(headingMatch[2]);
2809
+ blocks.push({ kind: "heading", level: headingMatch[1].length, text, id: id2 });
2804
2810
  i++;
2805
2811
  pendingContainerId = void 0;
2806
2812
  continue;
@@ -2809,11 +2815,11 @@ function tokenize(markdown) {
2809
2815
  if (imageMatch) {
2810
2816
  let url = imageMatch[2];
2811
2817
  const trailing = imageMatch[3] || "";
2812
- const { id } = stripBlockId(trailing);
2818
+ const { id: id2 } = stripBlockId(trailing);
2813
2819
  if (url && !url.match(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//)) {
2814
2820
  url = `file://${url}`;
2815
2821
  }
2816
- blocks.push({ kind: "image", alt: imageMatch[1], url, id });
2822
+ blocks.push({ kind: "image", alt: imageMatch[1], url, id: id2 });
2817
2823
  i++;
2818
2824
  pendingContainerId = void 0;
2819
2825
  continue;
@@ -2832,8 +2838,8 @@ function tokenize(markdown) {
2832
2838
  const items = [];
2833
2839
  while (i < lines.length && /^[-*+]\s+/.test(lines[i].trim())) {
2834
2840
  const raw = lines[i].trim().replace(/^[-*+]\s+/, "");
2835
- const { text, id } = stripBlockId(raw);
2836
- items.push({ text, id });
2841
+ const { text, id: id2 } = stripBlockId(raw);
2842
+ items.push({ text, id: id2 });
2837
2843
  i++;
2838
2844
  }
2839
2845
  blocks.push({ kind: "ul", items, containerId: pendingContainerId });
@@ -2844,8 +2850,8 @@ function tokenize(markdown) {
2844
2850
  const items = [];
2845
2851
  while (i < lines.length && /^\d+\.\s+/.test(lines[i].trim())) {
2846
2852
  const raw = lines[i].trim().replace(/^\d+\.\s+/, "");
2847
- const { text, id } = stripBlockId(raw);
2848
- items.push({ text, id });
2853
+ const { text, id: id2 } = stripBlockId(raw);
2854
+ items.push({ text, id: id2 });
2849
2855
  i++;
2850
2856
  }
2851
2857
  blocks.push({ kind: "ol", items, containerId: pendingContainerId });
@@ -2857,13 +2863,15 @@ function tokenize(markdown) {
2857
2863
  paraLines.push(lines[i]);
2858
2864
  i++;
2859
2865
  }
2860
- if (paraLines.length > 0) {
2861
- const firstLine = paraLines[0];
2862
- const { text: cleanFirst, id } = stripBlockId(firstLine);
2863
- paraLines[0] = cleanFirst;
2864
- blocks.push({ kind: "paragraph", text: paraLines.join("\n"), id });
2865
- pendingContainerId = void 0;
2866
+ if (paraLines.length === 0) {
2867
+ paraLines.push(line);
2868
+ i++;
2866
2869
  }
2870
+ const firstLine = paraLines[0];
2871
+ const { text: cleanFirst, id } = stripBlockId(firstLine);
2872
+ paraLines[0] = cleanFirst;
2873
+ blocks.push({ kind: "paragraph", text: paraLines.join("\n"), id });
2874
+ pendingContainerId = void 0;
2867
2875
  }
2868
2876
  return blocks;
2869
2877
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-hypermedia/client",
3
- "version": "0.0.55",
3
+ "version": "0.0.57",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/seed-hypermedia/seed",