@learncard/network-plugin 1.7.6 → 1.7.8
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/lcn-plugin.cjs.development.js +8 -5
- package/dist/lcn-plugin.cjs.development.js.map +2 -2
- package/dist/lcn-plugin.cjs.production.min.js +1 -1
- package/dist/lcn-plugin.cjs.production.min.js.map +2 -2
- package/dist/lcn-plugin.esm.js +8 -5
- package/dist/lcn-plugin.esm.js.map +2 -2
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -5110,7 +5110,7 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
5110
5110
|
throw new Error("Please make an account first!");
|
|
5111
5111
|
return client.boost.deleteBoost.mutate({ uri });
|
|
5112
5112
|
},
|
|
5113
|
-
sendBoost: async (_learnCard, profileId, boostUri,
|
|
5113
|
+
sendBoost: async (_learnCard, profileId, boostUri, options = { encrypt: true }) => {
|
|
5114
5114
|
if (!userData)
|
|
5115
5115
|
throw new Error("Please make an account first!");
|
|
5116
5116
|
const result = await _learnCard.invoke.resolveFromLCN(boostUri);
|
|
@@ -5120,7 +5120,7 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
5120
5120
|
const targetProfile = await _learnCard.invoke.getProfile(profileId);
|
|
5121
5121
|
if (!targetProfile)
|
|
5122
5122
|
throw new Error("Target profile not found");
|
|
5123
|
-
|
|
5123
|
+
let boost = data.data;
|
|
5124
5124
|
boost.issuanceDate = new Date().toISOString();
|
|
5125
5125
|
boost.issuer = _learnCard.id.did();
|
|
5126
5126
|
if (Array.isArray(boost.credentialSubject)) {
|
|
@@ -5131,11 +5131,13 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
5131
5131
|
} else {
|
|
5132
5132
|
boost.credentialSubject.id = targetProfile.did;
|
|
5133
5133
|
}
|
|
5134
|
-
if (boost?.type?.includes("BoostCredential"))
|
|
5134
|
+
if (boost?.type?.includes("BoostCredential"))
|
|
5135
5135
|
boost.boostId = boostUri;
|
|
5136
|
+
if (typeof options === "object" && options.overideFn) {
|
|
5137
|
+
boost = options.overideFn(boost);
|
|
5136
5138
|
}
|
|
5137
5139
|
const vc = await _learnCard.invoke.issueCredential(boost);
|
|
5138
|
-
if (!encrypt) {
|
|
5140
|
+
if (typeof options === "object" && !options.encrypt || !options) {
|
|
5139
5141
|
return client.boost.sendBoost.mutate({
|
|
5140
5142
|
profileId,
|
|
5141
5143
|
uri: boostUri,
|
|
@@ -5249,7 +5251,8 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
5249
5251
|
resolveFromLCN: async (_learnCard, uri) => {
|
|
5250
5252
|
const result = await client.storage.resolve.query({ uri });
|
|
5251
5253
|
return UnsignedVCValidator.or(VCValidator).or(VPValidator).or(JWEValidator).or(ConsentFlowContractValidator).or(ConsentFlowTermsValidator).parseAsync(result);
|
|
5252
|
-
}
|
|
5254
|
+
},
|
|
5255
|
+
getLCNClient: () => client
|
|
5253
5256
|
}
|
|
5254
5257
|
};
|
|
5255
5258
|
}, "getLearnCardNetworkPlugin");
|