@learncard/learn-cloud-plugin 2.0.12 → 2.0.14

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.
@@ -15683,20 +15683,35 @@ var getLearnCloudPlugin = /* @__PURE__ */ __name(async (initialLearnCard, url, u
15683
15683
  },
15684
15684
  read: {
15685
15685
  get: async (_learnCard, uri) => {
15686
+ learnCard.debug?.("LearnCloud read.get", uri);
15686
15687
  if (!uri)
15687
15688
  return void 0;
15688
15689
  const parts = uri.split(":");
15690
+ learnCard.debug?.("LearnCloud read.get parts:", parts);
15689
15691
  if (parts.length !== 5)
15690
15692
  return void 0;
15691
15693
  const [lc, method, uriUrl] = parts;
15692
- if (lc !== "lc" || method !== "cloud")
15694
+ if (lc !== "lc" || method !== "cloud") {
15695
+ learnCard.debug?.("LearnCloud read.get not cloud URI!", { lc, method });
15693
15696
  return void 0;
15694
- if (uriUrl.replace(/https?:\/\//g, "") !== url.replace(/https?:\\/g, "").replace(/:/g, "%3A")) {
15695
- const fullUrl = uriUrl.startsWith("http") ? uriUrl : `http${uriUrl.includes("http") ? "" : "s"}://${uriUrl}`;
15697
+ }
15698
+ if (uriUrl.replace(/https?:\/\//g, "") !== url.replace(/https?:\/\//g, "").replace(/:/g, "%3A")) {
15699
+ const fullUrl = (uriUrl.startsWith("http") ? uriUrl : `http${uriUrl.includes("http") || uriUrl.includes("localhost") ? "" : "s"}://${uriUrl}`).replaceAll("%3A", ":");
15700
+ learnCard.debug?.("LearnCloud read.get different LearnCloud!", {
15701
+ uriUrl,
15702
+ url,
15703
+ fullUrl,
15704
+ comparison: {
15705
+ a: uriUrl.replace(/https?:\/\//g, ""),
15706
+ b: url.replace(/https?:\/\//g, "").replace(/:/g, "%3A")
15707
+ }
15708
+ });
15696
15709
  const otherClient = await getOtherClient(fullUrl);
15697
15710
  try {
15698
15711
  const result = await otherClient.storage.resolve.query({ uri });
15712
+ learnCard.debug?.("LearnCloud read.get result", result);
15699
15713
  const decryptedResult = await _learnCard.invoke.getDIDObject().decryptDagJWE(result);
15714
+ learnCard.debug?.("LearnCloud read.get decryptedResult", decryptedResult);
15700
15715
  return await VCValidator.or(VPValidator).parseAsync(decryptedResult);
15701
15716
  } catch (error) {
15702
15717
  _learnCard.debug?.(error);
@@ -15705,7 +15720,9 @@ var getLearnCloudPlugin = /* @__PURE__ */ __name(async (initialLearnCard, url, u
15705
15720
  }
15706
15721
  try {
15707
15722
  const result = await client.storage.resolve.query({ uri });
15723
+ learnCard.debug?.("LearnCloud read.get result", result);
15708
15724
  const decryptedResult = await _learnCard.invoke.getDIDObject().decryptDagJWE(result);
15725
+ learnCard.debug?.("LearnCloud read.get decryptedResult", decryptedResult);
15709
15726
  return await VCValidator.or(VPValidator).parseAsync(decryptedResult);
15710
15727
  } catch (error) {
15711
15728
  _learnCard.debug?.(error);