buckyos 0.7.155 → 0.7.157

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.
@@ -474,6 +474,16 @@ function formatObjectUrl(url) {
474
474
  return url.url;
475
475
  }
476
476
  }
477
+ function objectEndpoint(url, origin, currentZone) {
478
+ const base = origin.replace(/\/+$/, "");
479
+ if (url.kind === "obj")
480
+ return `${base}/kapi/${url.host.name}/obj${formatObjectUrl(url).slice(`obj://${url.host.name}`.length)}`;
481
+ if (url.kind === "cyfs_path" && (url.zone === null || url.zone === currentZone))
482
+ return `${base}/kapi/dfs/obj${url.path.replace(/\/+$/, "")}`;
483
+ if (url.kind === "web")
484
+ return url.url;
485
+ return null;
486
+ }
477
487
  function normalizeObjectUrl(input) {
478
488
  return formatObjectUrl(parseObjectUrl(input));
479
489
  }
@@ -691,6 +701,7 @@ const object_url = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
691
701
  objEventPattern,
692
702
  objServiceUrl,
693
703
  objectDid,
704
+ objectEndpoint,
694
705
  objectEventKey,
695
706
  objectEventPattern,
696
707
  objectSegments,
@@ -30627,4 +30638,4 @@ export {
30627
30638
  NOTIFY_SESSION_PREFIX as y,
30628
30639
  NOTIFY_CHOICE_CONTROL_ID as z
30629
30640
  };
30630
- //# sourceMappingURL=executor_client-78ad0749.mjs.map
30641
+ //# sourceMappingURL=executor_client-ef98b975.mjs.map