@learncard/network-plugin 1.8.8 → 2.0.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.
@@ -1967,11 +1967,14 @@ var ZodString = class extends ZodType {
1967
1967
  const parsedType = this._getType(input);
1968
1968
  if (parsedType !== ZodParsedType.string) {
1969
1969
  const ctx2 = this._getOrReturnCtx(input);
1970
- addIssueToContext(ctx2, {
1971
- code: ZodIssueCode.invalid_type,
1972
- expected: ZodParsedType.string,
1973
- received: ctx2.parsedType
1974
- });
1970
+ addIssueToContext(
1971
+ ctx2,
1972
+ {
1973
+ code: ZodIssueCode.invalid_type,
1974
+ expected: ZodParsedType.string,
1975
+ received: ctx2.parsedType
1976
+ }
1977
+ );
1975
1978
  return INVALID;
1976
1979
  }
1977
1980
  const status = new ParseStatus();
@@ -2977,7 +2980,9 @@ var ZodObject = class extends ZodType {
2977
2980
  const value = ctx.data[key];
2978
2981
  pairs.push({
2979
2982
  key: { status: "valid", value: key },
2980
- value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
2983
+ value: catchall._parse(
2984
+ new ParseInputLazyPath(ctx, value, ctx.path, key)
2985
+ ),
2981
2986
  alwaysSet: key in ctx.data
2982
2987
  });
2983
2988
  }
@@ -4528,11 +4533,13 @@ var AchievementCriteriaValidator = mod.object({
4528
4533
  type: mod.string().optional(),
4529
4534
  narrative: mod.string().optional()
4530
4535
  });
4531
- var ImageValidator = mod.string().or(mod.object({
4532
- id: mod.string(),
4533
- type: mod.string(),
4534
- caption: mod.string().optional()
4535
- }));
4536
+ var ImageValidator = mod.string().or(
4537
+ mod.object({
4538
+ id: mod.string(),
4539
+ type: mod.string(),
4540
+ caption: mod.string().optional()
4541
+ })
4542
+ );
4536
4543
  var GeoCoordinatesValidator = mod.object({
4537
4544
  type: mod.string().min(1).or(mod.string().array().nonempty()),
4538
4545
  latitude: mod.number(),
@@ -4574,29 +4581,31 @@ var IdentifierEntryValidator = mod.object({
4574
4581
  identifier: mod.string(),
4575
4582
  identifierType: IdentifierTypeValidator
4576
4583
  });
4577
- var ProfileValidator = mod.string().or(mod.object({
4578
- id: mod.string().optional(),
4579
- type: mod.string().or(mod.string().array().nonempty().optional()),
4580
- name: mod.string().optional(),
4581
- url: mod.string().optional(),
4582
- phone: mod.string().optional(),
4583
- description: mod.string().optional(),
4584
- endorsement: mod.any().array().optional(),
4585
- image: ImageValidator.optional(),
4586
- email: mod.string().email().optional(),
4587
- address: AddressValidator.optional(),
4588
- otherIdentifier: IdentifierEntryValidator.array().optional(),
4589
- official: mod.string().optional(),
4590
- parentOrg: mod.any().optional(),
4591
- familyName: mod.string().optional(),
4592
- givenName: mod.string().optional(),
4593
- additionalName: mod.string().optional(),
4594
- patronymicName: mod.string().optional(),
4595
- honorificPrefix: mod.string().optional(),
4596
- honorificSuffix: mod.string().optional(),
4597
- familyNamePrefix: mod.string().optional(),
4598
- dateOfBirth: mod.string().optional()
4599
- }).catchall(mod.any()));
4584
+ var ProfileValidator = mod.string().or(
4585
+ mod.object({
4586
+ id: mod.string().optional(),
4587
+ type: mod.string().or(mod.string().array().nonempty().optional()),
4588
+ name: mod.string().optional(),
4589
+ url: mod.string().optional(),
4590
+ phone: mod.string().optional(),
4591
+ description: mod.string().optional(),
4592
+ endorsement: mod.any().array().optional(),
4593
+ image: ImageValidator.optional(),
4594
+ email: mod.string().email().optional(),
4595
+ address: AddressValidator.optional(),
4596
+ otherIdentifier: IdentifierEntryValidator.array().optional(),
4597
+ official: mod.string().optional(),
4598
+ parentOrg: mod.any().optional(),
4599
+ familyName: mod.string().optional(),
4600
+ givenName: mod.string().optional(),
4601
+ additionalName: mod.string().optional(),
4602
+ patronymicName: mod.string().optional(),
4603
+ honorificPrefix: mod.string().optional(),
4604
+ honorificSuffix: mod.string().optional(),
4605
+ familyNamePrefix: mod.string().optional(),
4606
+ dateOfBirth: mod.string().optional()
4607
+ }).catchall(mod.any())
4608
+ );
4600
4609
  var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
4601
4610
  var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() }).catchall(mod.any());
4602
4611
  var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
@@ -4665,15 +4674,17 @@ var JWEValidator = mod.object({
4665
4674
  aad: mod.string().optional(),
4666
4675
  recipients: JWERecipientValidator.array().optional()
4667
4676
  });
4668
- var VerificationMethodValidator = mod.string().or(mod.object({
4669
- "@context": ContextValidator.optional(),
4670
- id: mod.string(),
4671
- type: mod.string(),
4672
- controller: mod.string(),
4673
- publicKeyJwk: JWKValidator.optional(),
4674
- publicKeyBase58: mod.string().optional(),
4675
- blockChainAccountId: mod.string().optional()
4676
- }).catchall(mod.any()));
4677
+ var VerificationMethodValidator = mod.string().or(
4678
+ mod.object({
4679
+ "@context": ContextValidator.optional(),
4680
+ id: mod.string(),
4681
+ type: mod.string(),
4682
+ controller: mod.string(),
4683
+ publicKeyJwk: JWKValidator.optional(),
4684
+ publicKeyBase58: mod.string().optional(),
4685
+ blockChainAccountId: mod.string().optional()
4686
+ }).catchall(mod.any())
4687
+ );
4677
4688
  var ServiceValidator = mod.object({
4678
4689
  id: mod.string(),
4679
4690
  type: mod.string().or(mod.string().array().nonempty()),
@@ -4871,7 +4882,9 @@ var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
4871
4882
  name: mod.string().optional(),
4872
4883
  description: mod.string().optional(),
4873
4884
  image: ImageValidator.optional(),
4874
- credentialSubject: AchievementSubjectValidator.or(AchievementSubjectValidator.array()),
4885
+ credentialSubject: AchievementSubjectValidator.or(
4886
+ AchievementSubjectValidator.array()
4887
+ ),
4875
4888
  endorsement: UnsignedVCValidator.array().optional(),
4876
4889
  evidence: EvidenceValidator.array().optional()
4877
4890
  });
@@ -5100,7 +5113,9 @@ var ConsentFlowTransactionActionValidator = mod.enum([
5100
5113
  ]);
5101
5114
  var ConsentFlowTransactionsQueryValidator = mod.object({
5102
5115
  terms: ConsentFlowTermsQueryValidator.optional(),
5103
- action: ConsentFlowTransactionActionValidator.or(ConsentFlowTransactionActionValidator.array()).optional(),
5116
+ action: ConsentFlowTransactionActionValidator.or(
5117
+ ConsentFlowTransactionActionValidator.array()
5118
+ ).optional(),
5104
5119
  date: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
5105
5120
  expiresAt: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
5106
5121
  oneTime: mod.boolean().optional()
@@ -5301,7 +5316,9 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
5301
5316
  return client.profile.acceptConnectionRequest.mutate({ profileId });
5302
5317
  },
5303
5318
  getConnections: async (_learnCard) => {
5304
- console.warn("The getConnections method is deprecated! Please use getPaginatedConnections instead!");
5319
+ console.warn(
5320
+ "The getConnections method is deprecated! Please use getPaginatedConnections instead!"
5321
+ );
5305
5322
  if (!userData)
5306
5323
  throw new Error("Please make an account first!");
5307
5324
  return client.profile.connections.query();
@@ -5312,7 +5329,9 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
5312
5329
  return client.profile.paginatedConnections.query(options);
5313
5330
  },
5314
5331
  getPendingConnections: async (_learnCard) => {
5315
- console.warn("The getPendingConnections method is deprecated! Please use getPaginatedPendingConnections instead!");
5332
+ console.warn(
5333
+ "The getPendingConnections method is deprecated! Please use getPaginatedPendingConnections instead!"
5334
+ );
5316
5335
  if (!userData)
5317
5336
  throw new Error("Please make an account first!");
5318
5337
  return client.profile.pendingConnections.query();
@@ -5323,7 +5342,9 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
5323
5342
  return client.profile.paginatedPendingConnections.query(options);
5324
5343
  },
5325
5344
  getConnectionRequests: async (_learnCard) => {
5326
- console.warn("The getConnectionRequests method is deprecated! Please use getPaginatedConnectionRequests instead!");
5345
+ console.warn(
5346
+ "The getConnectionRequests method is deprecated! Please use getPaginatedConnectionRequests instead!"
5347
+ );
5327
5348
  if (!userData)
5328
5349
  throw new Error("Please make an account first!");
5329
5350
  return client.profile.connectionRequests.query();
@@ -5441,7 +5462,9 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
5441
5462
  return client.boost.getBoost.query({ uri });
5442
5463
  },
5443
5464
  getBoosts: async (_learnCard, query) => {
5444
- console.warn("The getBoosts method is deprecated! Please use getPaginatedBoosts instead!");
5465
+ console.warn(
5466
+ "The getBoosts method is deprecated! Please use getPaginatedBoosts instead!"
5467
+ );
5445
5468
  if (!userData)
5446
5469
  throw new Error("Please make an account first!");
5447
5470
  return client.boost.getBoosts.query({ query });
@@ -5457,7 +5480,9 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
5457
5480
  return client.boost.getPaginatedBoosts.query(options);
5458
5481
  },
5459
5482
  getBoostRecipients: async (_learnCard, uri, limit = 25, skip = void 0, includeUnacceptedBoosts = true) => {
5460
- console.warn("The getBoostRecipients method is deprecated! Please use getPaginatedBoostRecipients instead!");
5483
+ console.warn(
5484
+ "The getBoostRecipients method is deprecated! Please use getPaginatedBoostRecipients instead!"
5485
+ );
5461
5486
  if (!userData)
5462
5487
  throw new Error("Please make an account first!");
5463
5488
  return client.boost.getBoostRecipients.query({
@@ -5698,13 +5723,20 @@ var getVerifyBoostPlugin = /* @__PURE__ */ __name(async (learnCard, trustedBoost
5698
5723
  description: "Adds a check for validating Boost Credentials.",
5699
5724
  methods: {
5700
5725
  verifyCredential: async (_learnCard, credential, options) => {
5701
- const verificationCheck = await learnCard.invoke.verifyCredential(credential, options);
5726
+ const verificationCheck = await learnCard.invoke.verifyCredential(
5727
+ credential,
5728
+ options
5729
+ );
5702
5730
  const boostCredential = credential?.boostCredential;
5703
5731
  try {
5704
5732
  if (boostCredential) {
5705
- const verifyBoostCredential = await learnCard.invoke.verifyCredential(boostCredential);
5733
+ const verifyBoostCredential = await learnCard.invoke.verifyCredential(
5734
+ boostCredential
5735
+ );
5706
5736
  if (!boostCredential?.boostId && !credential?.boostId) {
5707
- verificationCheck.warnings.push("Boost Authenticity could not be verified: Boost ID metadata is missing.");
5737
+ verificationCheck.warnings.push(
5738
+ "Boost Authenticity could not be verified: Boost ID metadata is missing."
5739
+ );
5708
5740
  }
5709
5741
  if (verifyBoostCredential.errors?.length > 0) {
5710
5742
  verificationCheck.errors = [
@@ -5713,13 +5745,21 @@ var getVerifyBoostPlugin = /* @__PURE__ */ __name(async (learnCard, trustedBoost
5713
5745
  "Boost Credential could not be verified."
5714
5746
  ];
5715
5747
  } else if (boostCredential?.boostId !== credential?.boostId) {
5716
- verificationCheck.errors.push("Boost Authenticity could not be verified: Boost ID metadata is mismatched.");
5748
+ verificationCheck.errors.push(
5749
+ "Boost Authenticity could not be verified: Boost ID metadata is mismatched."
5750
+ );
5717
5751
  } else {
5718
5752
  const trustedBoostIssuer = getTrustedBoostVerifier(credential?.issuer);
5719
5753
  if (trustedBoostIssuer) {
5720
- verificationCheck.checks.push(`Boost is Authentic. Verified by ${trustedBoostIssuer.id}.`);
5754
+ verificationCheck.checks.push(
5755
+ `Boost is Authentic. Verified by ${trustedBoostIssuer.id}.`
5756
+ );
5721
5757
  } else {
5722
- verificationCheck.warnings.push(`Boost Authenticity could not be verified. Issuer is outside of trust network: ${getIssuerDID(credential?.issuer)}`);
5758
+ verificationCheck.warnings.push(
5759
+ `Boost Authenticity could not be verified. Issuer is outside of trust network: ${getIssuerDID(
5760
+ credential?.issuer
5761
+ )}`
5762
+ );
5723
5763
  }
5724
5764
  }
5725
5765
  }