@learncard/network-plugin 2.0.1 → 2.1.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.
@@ -5015,6 +5015,19 @@ var LCNBoostClaimLinkOptionsValidator = mod.object({
5015
5015
  ttlSeconds: mod.number().optional(),
5016
5016
  totalUses: mod.number().optional()
5017
5017
  });
5018
+ var BoostPermissionsValidator = mod.object({
5019
+ role: mod.string(),
5020
+ canEdit: mod.boolean(),
5021
+ canIssue: mod.boolean(),
5022
+ canRevoke: mod.boolean(),
5023
+ canManagePermissions: mod.boolean(),
5024
+ canIssueChildren: mod.string(),
5025
+ canCreateChildren: mod.string(),
5026
+ canEditChildren: mod.string(),
5027
+ canRevokeChildren: mod.string(),
5028
+ canManageChildrenPermissions: mod.string(),
5029
+ canViewAnalytics: mod.boolean()
5030
+ });
5018
5031
  var LCNSigningAuthorityValidator = mod.object({
5019
5032
  endpoint: mod.string()
5020
5033
  });
@@ -5481,6 +5494,14 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
5481
5494
  throw new Error("Please make an account first!");
5482
5495
  return client.boost.createBoost.mutate({ credential, ...metadata });
5483
5496
  },
5497
+ createChildBoost: async (_learnCard, parentUri, credential, metadata) => {
5498
+ if (!userData)
5499
+ throw new Error("Please make an account first!");
5500
+ return client.boost.createChildBoost.mutate({
5501
+ parentUri,
5502
+ boost: { credential, ...metadata }
5503
+ });
5504
+ },
5484
5505
  getBoost: async (_learnCard, uri) => {
5485
5506
  if (!userData)
5486
5507
  throw new Error("Please make an account first!");
@@ -5504,6 +5525,36 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
5504
5525
  throw new Error("Please make an account first!");
5505
5526
  return client.boost.getPaginatedBoosts.query(options);
5506
5527
  },
5528
+ getBoostChildren: async (_learnCard, uri, options) => {
5529
+ if (!userData)
5530
+ throw new Error("Please make an account first!");
5531
+ return client.boost.getBoostChildren.query({ uri, ...options });
5532
+ },
5533
+ countBoostChildren: async (_learnCard, uri, options) => {
5534
+ if (!userData)
5535
+ throw new Error("Please make an account first!");
5536
+ return client.boost.countBoostChildren.query({ uri, ...options });
5537
+ },
5538
+ getBoostParents: async (_learnCard, uri, options) => {
5539
+ if (!userData)
5540
+ throw new Error("Please make an account first!");
5541
+ return client.boost.getBoostParents.query({ uri, ...options });
5542
+ },
5543
+ countBoostParents: async (_learnCard, uri, options) => {
5544
+ if (!userData)
5545
+ throw new Error("Please make an account first!");
5546
+ return client.boost.countBoostParents.query({ uri, ...options });
5547
+ },
5548
+ makeBoostParent: async (_learnCard, uris) => {
5549
+ if (!userData)
5550
+ throw new Error("Please make an account first!");
5551
+ return client.boost.makeBoostParent.mutate(uris);
5552
+ },
5553
+ removeBoostParent: async (_learnCard, uris) => {
5554
+ if (!userData)
5555
+ throw new Error("Please make an account first!");
5556
+ return client.boost.removeBoostParent.mutate(uris);
5557
+ },
5507
5558
  getBoostRecipients: async (_learnCard, uri, limit = 25, skip = void 0, includeUnacceptedBoosts = true) => {
5508
5559
  console.warn(
5509
5560
  "The getBoostRecipients method is deprecated! Please use getPaginatedBoostRecipients instead!"
@@ -5545,6 +5596,20 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
5545
5596
  throw new Error("Please make an account first!");
5546
5597
  return client.boost.getBoostAdmins.query({ uri, ...options });
5547
5598
  },
5599
+ getBoostPermissions: async (_learnCard, uri, profileId) => {
5600
+ if (!userData)
5601
+ throw new Error("Please make an account first!");
5602
+ if (!profileId)
5603
+ return client.boost.getBoostPermissions.query({ uri });
5604
+ return client.boost.getOtherBoostPermissions.query({ uri, profileId });
5605
+ },
5606
+ updateBoostPermissions: async (_learnCard, uri, updates, profileId) => {
5607
+ if (!userData)
5608
+ throw new Error("Please make an account first!");
5609
+ if (!profileId)
5610
+ return client.boost.updateBoostPermissions.query({ uri, updates });
5611
+ return client.boost.updateOtherBoostPermissions.query({ uri, profileId, updates });
5612
+ },
5548
5613
  addBoostAdmin: async (_learnCard, uri, profileId) => {
5549
5614
  if (!userData)
5550
5615
  throw new Error("Please make an account first!");