@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.
@@ -1255,6 +1255,7 @@ var require_helpers_cjs_development = __commonJS({
1255
1255
  JWERecipientValidator: () => JWERecipientValidator2,
1256
1256
  JWEValidator: () => JWEValidator2,
1257
1257
  JWKValidator: () => JWKValidator2,
1258
+ JWKWithPrivateKeyValidator: () => JWKWithPrivateKeyValidator2,
1258
1259
  KnownAchievementTypeValidator: () => KnownAchievementTypeValidator2,
1259
1260
  LCNBoostClaimLinkOptionsValidator: () => LCNBoostClaimLinkOptionsValidator2,
1260
1261
  LCNBoostClaimLinkSigningAuthorityValidator: () => LCNBoostClaimLinkSigningAuthorityValidator2,
@@ -4795,8 +4796,9 @@ var require_helpers_cjs_development = __commonJS({
4795
4796
  x: mod2.string(),
4796
4797
  y: mod2.string().optional(),
4797
4798
  n: mod2.string().optional(),
4798
- d: mod2.string()
4799
+ d: mod2.string().optional()
4799
4800
  });
4801
+ var JWKWithPrivateKeyValidator2 = JWKValidator2.omit({ d: true }).extend({ d: mod2.string() });
4800
4802
  var JWERecipientHeaderValidator2 = mod2.object({
4801
4803
  alg: mod2.string(),
4802
4804
  iv: mod2.string(),
@@ -5274,6 +5276,7 @@ var require_helpers_cjs_development = __commonJS({
5274
5276
  image: mod2.string().optional(),
5275
5277
  uri: mod2.string(),
5276
5278
  needsGuardianConsent: mod2.boolean().optional(),
5279
+ redirectUrl: mod2.string().optional(),
5277
5280
  createdAt: mod2.string(),
5278
5281
  updatedAt: mod2.string(),
5279
5282
  expiresAt: mod2.string().optional()
@@ -8998,8 +9001,9 @@ var JWKValidator = mod.object({
8998
9001
  x: mod.string(),
8999
9002
  y: mod.string().optional(),
9000
9003
  n: mod.string().optional(),
9001
- d: mod.string()
9004
+ d: mod.string().optional()
9002
9005
  });
9006
+ var JWKWithPrivateKeyValidator = JWKValidator.omit({ d: true }).extend({ d: mod.string() });
9003
9007
  var JWERecipientHeaderValidator = mod.object({
9004
9008
  alg: mod.string(),
9005
9009
  iv: mod.string(),
@@ -9477,6 +9481,7 @@ var ConsentFlowContractDetailsValidator = mod.object({
9477
9481
  image: mod.string().optional(),
9478
9482
  uri: mod.string(),
9479
9483
  needsGuardianConsent: mod.boolean().optional(),
9484
+ redirectUrl: mod.string().optional(),
9480
9485
  createdAt: mod.string(),
9481
9486
  updatedAt: mod.string(),
9482
9487
  expiresAt: mod.string().optional()
@@ -10085,7 +10090,11 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
10085
10090
  throw new Error("Please make an account first!");
10086
10091
  if (!profileId)
10087
10092
  return client.boost.updateBoostPermissions.query({ uri, updates });
10088
- const result = await client.boost.updateOtherBoostPermissions.query({ uri, profileId, updates });
10093
+ const result = await client.boost.updateOtherBoostPermissions.query({
10094
+ uri,
10095
+ profileId,
10096
+ updates
10097
+ });
10089
10098
  if (result)
10090
10099
  await _learnCard.invoke.clearDidWebCache?.();
10091
10100
  return result;
@@ -10249,6 +10258,40 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
10249
10258
  verifyConsent: async (_learnCard, uri, profileId) => {
10250
10259
  return client.contracts.verifyConsent.query({ uri, profileId });
10251
10260
  },
10261
+ addDidMetadata: async (_learnCard, metadata) => {
10262
+ if (!userData)
10263
+ throw new Error("Please make an account first!");
10264
+ const result = await client.didMetadata.addDidMetadata.mutate(metadata);
10265
+ if (result)
10266
+ await _learnCard.invoke.clearDidWebCache?.();
10267
+ return result;
10268
+ },
10269
+ getDidMetadata: async (_learnCard, id) => {
10270
+ if (!userData)
10271
+ throw new Error("Please make an account first!");
10272
+ return client.didMetadata.getDidMetadata.query({ id });
10273
+ },
10274
+ getMyDidMetadata: async () => {
10275
+ if (!userData)
10276
+ throw new Error("Please make an account first!");
10277
+ return client.didMetadata.getMyDidMetadata.query();
10278
+ },
10279
+ updateDidMetadata: async (_learnCard, id, updates) => {
10280
+ if (!userData)
10281
+ throw new Error("Please make an account first!");
10282
+ const result = await client.didMetadata.updateDidMetadata.mutate({ id, updates });
10283
+ if (result)
10284
+ await _learnCard.invoke.clearDidWebCache?.();
10285
+ return result;
10286
+ },
10287
+ deleteDidMetadata: async (_learnCard, id) => {
10288
+ if (!userData)
10289
+ throw new Error("Please make an account first!");
10290
+ const result = await client.didMetadata.deleteDidMetadata.mutate({ id });
10291
+ if (result)
10292
+ await _learnCard.invoke.clearDidWebCache?.();
10293
+ return result;
10294
+ },
10252
10295
  resolveFromLCN: async (_learnCard, uri) => {
10253
10296
  const result = await client.storage.resolve.query({ uri });
10254
10297
  return UnsignedVCValidator.or(VCValidator).or(VPValidator).or(JWEValidator).or(ConsentFlowContractValidator).or(ConsentFlowTermsValidator).parseAsync(result);