@learncard/network-plugin 2.2.2 → 2.3.0
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 +9 -9
- 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 +3 -3
- package/dist/lcn-plugin.esm.js +9 -9
- package/dist/lcn-plugin.esm.js.map +2 -2
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/lcn-plugin.esm.js
CHANGED
|
@@ -5493,7 +5493,7 @@ var getClient = /* @__PURE__ */ __name2(async (url, didAuthFunction) => {
|
|
|
5493
5493
|
const getChallenges = /* @__PURE__ */ __name2(async (amount = 95 + Math.round((Math.random() - 0.5) * 5)) => {
|
|
5494
5494
|
return challengeRequester.utilities.getChallenges.query({ amount });
|
|
5495
5495
|
}, "getChallenges");
|
|
5496
|
-
challenges =
|
|
5496
|
+
getChallenges().then((result) => challenges = result);
|
|
5497
5497
|
const trpc = createTRPCProxyClient({
|
|
5498
5498
|
transformer: {
|
|
5499
5499
|
input: import_helpers.RegExpTransformer,
|
|
@@ -9554,7 +9554,7 @@ var LCNNotificationValidator = mod.object({
|
|
|
9554
9554
|
|
|
9555
9555
|
// src/plugin.ts
|
|
9556
9556
|
var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) => {
|
|
9557
|
-
|
|
9557
|
+
let did = learnCard.id.did();
|
|
9558
9558
|
learnCard?.debug?.("Adding LearnCardNetwork Plugin");
|
|
9559
9559
|
const client = await getClient(url, async (challenge) => {
|
|
9560
9560
|
const jwt = await learnCard.invoke.getDidAuthVp({ proofFormat: "jwt", challenge });
|
|
@@ -9563,12 +9563,11 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
9563
9563
|
return jwt;
|
|
9564
9564
|
});
|
|
9565
9565
|
let userData;
|
|
9566
|
-
|
|
9567
|
-
userData =
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
}
|
|
9571
|
-
let did = userData?.did || existingDid;
|
|
9566
|
+
const initialQuery = client.profile.getProfile.query().then((result) => {
|
|
9567
|
+
userData = result;
|
|
9568
|
+
if (userData?.did)
|
|
9569
|
+
did = userData.did;
|
|
9570
|
+
});
|
|
9572
9571
|
return {
|
|
9573
9572
|
name: "LearnCard Network",
|
|
9574
9573
|
displayName: "LearnCard Network",
|
|
@@ -9664,6 +9663,7 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
9664
9663
|
return false;
|
|
9665
9664
|
},
|
|
9666
9665
|
getProfile: async (_learnCard, profileId) => {
|
|
9666
|
+
await initialQuery;
|
|
9667
9667
|
if (!profileId)
|
|
9668
9668
|
return client.profile.getProfile.query();
|
|
9669
9669
|
return client.profile.getOtherProfile.query({ profileId });
|
|
@@ -9963,7 +9963,7 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
9963
9963
|
throw new Error("Please make an account first!");
|
|
9964
9964
|
return client.boost.updateBoost.mutate({
|
|
9965
9965
|
uri,
|
|
9966
|
-
updates: { credential, ...updates }
|
|
9966
|
+
updates: { ...credential && { credential }, ...updates }
|
|
9967
9967
|
});
|
|
9968
9968
|
},
|
|
9969
9969
|
getBoostAdmins: async (_learnCard, uri, options = {}) => {
|