@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
package/dist/lcn-plugin.esm.js
CHANGED
|
@@ -5086,7 +5086,7 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
5086
5086
|
throw new Error("Please make an account first!");
|
|
5087
5087
|
return client.boost.deleteBoost.mutate({ uri });
|
|
5088
5088
|
},
|
|
5089
|
-
sendBoost: async (_learnCard, profileId, boostUri,
|
|
5089
|
+
sendBoost: async (_learnCard, profileId, boostUri, options = { encrypt: true }) => {
|
|
5090
5090
|
if (!userData)
|
|
5091
5091
|
throw new Error("Please make an account first!");
|
|
5092
5092
|
const result = await _learnCard.invoke.resolveFromLCN(boostUri);
|
|
@@ -5096,7 +5096,7 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
5096
5096
|
const targetProfile = await _learnCard.invoke.getProfile(profileId);
|
|
5097
5097
|
if (!targetProfile)
|
|
5098
5098
|
throw new Error("Target profile not found");
|
|
5099
|
-
|
|
5099
|
+
let boost = data.data;
|
|
5100
5100
|
boost.issuanceDate = new Date().toISOString();
|
|
5101
5101
|
boost.issuer = _learnCard.id.did();
|
|
5102
5102
|
if (Array.isArray(boost.credentialSubject)) {
|
|
@@ -5107,11 +5107,13 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
5107
5107
|
} else {
|
|
5108
5108
|
boost.credentialSubject.id = targetProfile.did;
|
|
5109
5109
|
}
|
|
5110
|
-
if (boost?.type?.includes("BoostCredential"))
|
|
5110
|
+
if (boost?.type?.includes("BoostCredential"))
|
|
5111
5111
|
boost.boostId = boostUri;
|
|
5112
|
+
if (typeof options === "object" && options.overideFn) {
|
|
5113
|
+
boost = options.overideFn(boost);
|
|
5112
5114
|
}
|
|
5113
5115
|
const vc = await _learnCard.invoke.issueCredential(boost);
|
|
5114
|
-
if (!encrypt) {
|
|
5116
|
+
if (typeof options === "object" && !options.encrypt || !options) {
|
|
5115
5117
|
return client.boost.sendBoost.mutate({
|
|
5116
5118
|
profileId,
|
|
5117
5119
|
uri: boostUri,
|
|
@@ -5225,7 +5227,8 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
5225
5227
|
resolveFromLCN: async (_learnCard, uri) => {
|
|
5226
5228
|
const result = await client.storage.resolve.query({ uri });
|
|
5227
5229
|
return UnsignedVCValidator.or(VCValidator).or(VPValidator).or(JWEValidator).or(ConsentFlowContractValidator).or(ConsentFlowTermsValidator).parseAsync(result);
|
|
5228
|
-
}
|
|
5230
|
+
},
|
|
5231
|
+
getLCNClient: () => client
|
|
5229
5232
|
}
|
|
5230
5233
|
};
|
|
5231
5234
|
}, "getLearnCardNetworkPlugin");
|