@seed-hypermedia/client 0.0.36 → 0.0.38

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/hm-types.mjs CHANGED
@@ -92,6 +92,9 @@ import {
92
92
  HMListDiscussionsInputSchema,
93
93
  HMListDiscussionsOutputSchema,
94
94
  HMListDiscussionsRequestSchema,
95
+ HMListDocumentCollaboratorsInputSchema,
96
+ HMListDocumentCollaboratorsOutputSchema,
97
+ HMListDocumentCollaboratorsRequestSchema,
95
98
  HMListDomainsInputSchema,
96
99
  HMListDomainsOutputSchema,
97
100
  HMListDomainsRequestSchema,
@@ -169,7 +172,7 @@ import {
169
172
  toNumber,
170
173
  unpackHmId,
171
174
  unpackedHmIdSchema
172
- } from "./chunk-2BRMXRIG.mjs";
175
+ } from "./chunk-PY2VJAIE.mjs";
173
176
  export {
174
177
  BackgroundColorAnnotationSchema,
175
178
  BlockRangeSchema,
@@ -264,6 +267,9 @@ export {
264
267
  HMListDiscussionsInputSchema,
265
268
  HMListDiscussionsOutputSchema,
266
269
  HMListDiscussionsRequestSchema,
270
+ HMListDocumentCollaboratorsInputSchema,
271
+ HMListDocumentCollaboratorsOutputSchema,
272
+ HMListDocumentCollaboratorsRequestSchema,
267
273
  HMListDomainsInputSchema,
268
274
  HMListDomainsOutputSchema,
269
275
  HMListDomainsRequestSchema,
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  serializeBlockRange,
18
18
  toNumber,
19
19
  unpackHmId
20
- } from "./chunk-2BRMXRIG.mjs";
20
+ } from "./chunk-PY2VJAIE.mjs";
21
21
 
22
22
  // src/capability.ts
23
23
  import { encode as cborEncode2 } from "@ipld/dag-cbor";
@@ -2200,15 +2200,17 @@ async function resolveHypermediaUrl(url, opts) {
2200
2200
  const uid = await opts.domainResolver(parsedHostname);
2201
2201
  if (uid) {
2202
2202
  const pathSegments = parsedUrl.pathname.split("/").filter(Boolean);
2203
- const path = pathSegments.length > 0 ? pathSegments : null;
2203
+ const profilePath = resolveProfilePath(uid, pathSegments);
2204
+ const resolvedUid = (profilePath == null ? void 0 : profilePath.uid) || uid;
2205
+ const path = (profilePath == null ? void 0 : profilePath.path) || (pathSegments.length > 0 ? pathSegments : null);
2204
2206
  const version = parsedUrl.searchParams.get("v") || null;
2205
2207
  const pathStr = path ? "/" + path.join("/") : "";
2206
2208
  const siteHostname = parsedUrl.origin;
2207
2209
  return {
2208
- id: `hm://${uid}${pathStr}`,
2210
+ id: `hm://${resolvedUid}${pathStr}`,
2209
2211
  hmId: {
2210
- id: `hm://${uid}${pathStr}`,
2211
- uid,
2212
+ id: `hm://${resolvedUid}${pathStr}`,
2213
+ uid: resolvedUid,
2212
2214
  path,
2213
2215
  version,
2214
2216
  blockRef,
@@ -2288,6 +2290,13 @@ async function resolveId(input, opts) {
2288
2290
  }
2289
2291
  throw new Error(`Invalid Hypermedia ID: ${input}`);
2290
2292
  }
2293
+ function resolveProfilePath(siteUid, pathSegments) {
2294
+ if (pathSegments[0] !== ":profile") return null;
2295
+ return {
2296
+ uid: pathSegments[1] || siteUid,
2297
+ path: [":profile"]
2298
+ };
2299
+ }
2291
2300
 
2292
2301
  // src/file-to-ipfs.ts
2293
2302
  import { MemoryBlockstore } from "blockstore-core/memory";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-hypermedia/client",
3
- "version": "0.0.36",
3
+ "version": "0.0.38",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/seed-hypermedia/seed",