@learncard/network-plugin 2.4.3 → 2.4.5

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.
@@ -1280,6 +1280,7 @@ var require_helpers_cjs_development = __commonJS({
1280
1280
  JWERecipientValidator: () => JWERecipientValidator2,
1281
1281
  JWEValidator: () => JWEValidator2,
1282
1282
  JWKValidator: () => JWKValidator2,
1283
+ JWKWithPrivateKeyValidator: () => JWKWithPrivateKeyValidator2,
1283
1284
  KnownAchievementTypeValidator: () => KnownAchievementTypeValidator2,
1284
1285
  LCNBoostClaimLinkOptionsValidator: () => LCNBoostClaimLinkOptionsValidator2,
1285
1286
  LCNBoostClaimLinkSigningAuthorityValidator: () => LCNBoostClaimLinkSigningAuthorityValidator2,
@@ -4820,8 +4821,9 @@ var require_helpers_cjs_development = __commonJS({
4820
4821
  x: mod2.string(),
4821
4822
  y: mod2.string().optional(),
4822
4823
  n: mod2.string().optional(),
4823
- d: mod2.string()
4824
+ d: mod2.string().optional()
4824
4825
  });
4826
+ var JWKWithPrivateKeyValidator2 = JWKValidator2.omit({ d: true }).extend({ d: mod2.string() });
4825
4827
  var JWERecipientHeaderValidator2 = mod2.object({
4826
4828
  alg: mod2.string(),
4827
4829
  iv: mod2.string(),
@@ -5299,6 +5301,7 @@ var require_helpers_cjs_development = __commonJS({
5299
5301
  image: mod2.string().optional(),
5300
5302
  uri: mod2.string(),
5301
5303
  needsGuardianConsent: mod2.boolean().optional(),
5304
+ redirectUrl: mod2.string().optional(),
5302
5305
  createdAt: mod2.string(),
5303
5306
  updatedAt: mod2.string(),
5304
5307
  expiresAt: mod2.string().optional()
@@ -9023,8 +9026,9 @@ var JWKValidator = mod.object({
9023
9026
  x: mod.string(),
9024
9027
  y: mod.string().optional(),
9025
9028
  n: mod.string().optional(),
9026
- d: mod.string()
9029
+ d: mod.string().optional()
9027
9030
  });
9031
+ var JWKWithPrivateKeyValidator = JWKValidator.omit({ d: true }).extend({ d: mod.string() });
9028
9032
  var JWERecipientHeaderValidator = mod.object({
9029
9033
  alg: mod.string(),
9030
9034
  iv: mod.string(),
@@ -9502,6 +9506,7 @@ var ConsentFlowContractDetailsValidator = mod.object({
9502
9506
  image: mod.string().optional(),
9503
9507
  uri: mod.string(),
9504
9508
  needsGuardianConsent: mod.boolean().optional(),
9509
+ redirectUrl: mod.string().optional(),
9505
9510
  createdAt: mod.string(),
9506
9511
  updatedAt: mod.string(),
9507
9512
  expiresAt: mod.string().optional()
@@ -10110,7 +10115,11 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
10110
10115
  throw new Error("Please make an account first!");
10111
10116
  if (!profileId)
10112
10117
  return client.boost.updateBoostPermissions.query({ uri, updates });
10113
- const result = await client.boost.updateOtherBoostPermissions.query({ uri, profileId, updates });
10118
+ const result = await client.boost.updateOtherBoostPermissions.query({
10119
+ uri,
10120
+ profileId,
10121
+ updates
10122
+ });
10114
10123
  if (result)
10115
10124
  await _learnCard.invoke.clearDidWebCache?.();
10116
10125
  return result;
@@ -10274,6 +10283,40 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
10274
10283
  verifyConsent: async (_learnCard, uri, profileId) => {
10275
10284
  return client.contracts.verifyConsent.query({ uri, profileId });
10276
10285
  },
10286
+ addDidMetadata: async (_learnCard, metadata) => {
10287
+ if (!userData)
10288
+ throw new Error("Please make an account first!");
10289
+ const result = await client.didMetadata.addDidMetadata.mutate(metadata);
10290
+ if (result)
10291
+ await _learnCard.invoke.clearDidWebCache?.();
10292
+ return result;
10293
+ },
10294
+ getDidMetadata: async (_learnCard, id) => {
10295
+ if (!userData)
10296
+ throw new Error("Please make an account first!");
10297
+ return client.didMetadata.getDidMetadata.query({ id });
10298
+ },
10299
+ getMyDidMetadata: async () => {
10300
+ if (!userData)
10301
+ throw new Error("Please make an account first!");
10302
+ return client.didMetadata.getMyDidMetadata.query();
10303
+ },
10304
+ updateDidMetadata: async (_learnCard, id, updates) => {
10305
+ if (!userData)
10306
+ throw new Error("Please make an account first!");
10307
+ const result = await client.didMetadata.updateDidMetadata.mutate({ id, updates });
10308
+ if (result)
10309
+ await _learnCard.invoke.clearDidWebCache?.();
10310
+ return result;
10311
+ },
10312
+ deleteDidMetadata: async (_learnCard, id) => {
10313
+ if (!userData)
10314
+ throw new Error("Please make an account first!");
10315
+ const result = await client.didMetadata.deleteDidMetadata.mutate({ id });
10316
+ if (result)
10317
+ await _learnCard.invoke.clearDidWebCache?.();
10318
+ return result;
10319
+ },
10277
10320
  resolveFromLCN: async (_learnCard, uri) => {
10278
10321
  const result = await client.storage.resolve.query({ uri });
10279
10322
  return UnsignedVCValidator.or(VCValidator).or(VPValidator).or(JWEValidator).or(ConsentFlowContractValidator).or(ConsentFlowTermsValidator).parseAsync(result);