@learncard/ceramic-plugin 1.1.20 → 1.1.22

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.
@@ -37057,7 +37057,7 @@ var require_src3 = __commonJS({
37057
37057
  });
37058
37058
 
37059
37059
  // src/ceramic.ts
37060
- var import_lodash6 = __toESM(require_lodash());
37060
+ var import_lodash6 = __toESM(require_lodash(), 1);
37061
37061
 
37062
37062
  // ../../../node_modules/.pnpm/did-resolver@3.2.2/node_modules/did-resolver/lib/resolver.module.js
37063
37063
  function _catch(body, recover) {
@@ -50305,7 +50305,7 @@ __name(_CeramicClient, "CeramicClient");
50305
50305
  var CeramicClient = _CeramicClient;
50306
50306
 
50307
50307
  // src/ceramic.ts
50308
- import { VCValidator, VPValidator } from "@learncard/types";
50308
+ import { VCValidator, VPValidator, isStoredCredentialEnvelope } from "@learncard/types";
50309
50309
 
50310
50310
  // src/helpers.ts
50311
50311
  var streamIdToCeramicURI = /* @__PURE__ */ __name((id) => `lc:ceramic:${id}`, "streamIdToCeramicURI");
@@ -63461,6 +63461,9 @@ var getCeramicPlugin = /* @__PURE__ */ __name(async (learnCard, { ceramicEndpoin
63461
63461
  await VCValidator.or(VPValidator).parseAsync(vc);
63462
63462
  return streamIdToCeramicURI(await publishContentToCeramic(vc, {}, {}, encryption));
63463
63463
  }, "uploadCredential");
63464
+ const envelopeRejection = /* @__PURE__ */ __name((envelope) => new Error(
63465
+ `Ceramic does not support format-tagged credential envelopes (got format="${envelope.format}"). Use LearnCloud or the LearnCard Network store for non-W3C credentials (SD-JWT-VC, mDoc, etc.).`
63466
+ ), "envelopeRejection");
63464
63467
  return {
63465
63468
  name: "Ceramic",
63466
63469
  displayName: "Ceramic",
@@ -63468,10 +63471,12 @@ var getCeramicPlugin = /* @__PURE__ */ __name(async (learnCard, { ceramicEndpoin
63468
63471
  store: {
63469
63472
  upload: /* @__PURE__ */ __name(async (_learnCard, vc) => {
63470
63473
  _learnCard.debug?.("learnCard.store.Ceramic.upload");
63474
+ if (isStoredCredentialEnvelope(vc)) throw envelopeRejection(vc);
63471
63475
  return uploadCredential(vc);
63472
63476
  }, "upload"),
63473
63477
  uploadEncrypted: /* @__PURE__ */ __name(async (_learnCard, vc, params) => {
63474
63478
  _learnCard.debug?.("learnCard.store.Ceramic.uploadEncrypted");
63479
+ if (isStoredCredentialEnvelope(vc)) throw envelopeRejection(vc);
63475
63480
  return uploadCredential(vc, {
63476
63481
  encrypt: true,
63477
63482
  controllersCanDecrypt: true,