@learncard/network-plugin 2.3.0 → 2.4.1

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.
@@ -1290,6 +1290,8 @@ var require_helpers_cjs_development = __commonJS({
1290
1290
  LCNNotificationValidator: () => LCNNotificationValidator2,
1291
1291
  LCNProfileConnectionStatusEnum: () => LCNProfileConnectionStatusEnum2,
1292
1292
  LCNProfileDisplayValidator: () => LCNProfileDisplayValidator2,
1293
+ LCNProfileManagerQueryValidator: () => LCNProfileManagerQueryValidator2,
1294
+ LCNProfileManagerValidator: () => LCNProfileManagerValidator2,
1293
1295
  LCNProfileQueryValidator: () => LCNProfileQueryValidator2,
1294
1296
  LCNProfileValidator: () => LCNProfileValidator2,
1295
1297
  LCNSigningAuthorityForUserValidator: () => LCNSigningAuthorityForUserValidator2,
@@ -1302,6 +1304,8 @@ var require_helpers_cjs_development = __commonJS({
1302
1304
  PaginatedConsentFlowTransactionsValidator: () => PaginatedConsentFlowTransactionsValidator2,
1303
1305
  PaginatedEncryptedCredentialRecordsValidator: () => PaginatedEncryptedCredentialRecordsValidator2,
1304
1306
  PaginatedEncryptedRecordsValidator: () => PaginatedEncryptedRecordsValidator2,
1307
+ PaginatedLCNProfileManagersValidator: () => PaginatedLCNProfileManagersValidator2,
1308
+ PaginatedLCNProfilesAndManagersValidator: () => PaginatedLCNProfilesAndManagersValidator2,
1305
1309
  PaginatedLCNProfilesValidator: () => PaginatedLCNProfilesValidator2,
1306
1310
  PaginationOptionsValidator: () => PaginationOptionsValidator2,
1307
1311
  PaginationResponseValidator: () => PaginationResponseValidator2,
@@ -5172,6 +5176,32 @@ var require_helpers_cjs_development = __commonJS({
5172
5176
  "PENDING_REQUEST_RECEIVED",
5173
5177
  "NOT_CONNECTED"
5174
5178
  ]);
5179
+ var LCNProfileManagerValidator2 = mod2.object({
5180
+ id: mod2.string(),
5181
+ created: mod2.string(),
5182
+ displayName: mod2.string().default("").optional(),
5183
+ shortBio: mod2.string().default("").optional(),
5184
+ bio: mod2.string().default("").optional(),
5185
+ email: mod2.string().optional(),
5186
+ image: mod2.string().optional(),
5187
+ heroImage: mod2.string().optional()
5188
+ });
5189
+ var PaginatedLCNProfileManagersValidator2 = PaginationResponseValidator2.extend({
5190
+ records: LCNProfileManagerValidator2.extend({ did: mod2.string() }).array()
5191
+ });
5192
+ var LCNProfileManagerQueryValidator2 = mod2.object({
5193
+ id: StringQuery2,
5194
+ displayName: StringQuery2,
5195
+ shortBio: StringQuery2,
5196
+ bio: StringQuery2,
5197
+ email: StringQuery2
5198
+ }).partial();
5199
+ var PaginatedLCNProfilesAndManagersValidator2 = PaginationResponseValidator2.extend({
5200
+ records: mod2.object({
5201
+ profile: LCNProfileValidator2,
5202
+ manager: LCNProfileManagerValidator2.extend({ did: mod2.string() }).optional()
5203
+ }).array()
5204
+ });
5175
5205
  var SentCredentialInfoValidator2 = mod2.object({
5176
5206
  uri: mod2.string(),
5177
5207
  to: mod2.string(),
@@ -5190,6 +5220,7 @@ var require_helpers_cjs_development = __commonJS({
5190
5220
  canEditChildren: mod2.string(),
5191
5221
  canRevokeChildren: mod2.string(),
5192
5222
  canManageChildrenPermissions: mod2.string(),
5223
+ canManageChildrenProfiles: mod2.boolean().default(false).optional(),
5193
5224
  canViewAnalytics: mod2.boolean()
5194
5225
  });
5195
5226
  var LCNBoostStatus2 = mod2.enum(["DRAFT", "LIVE"]);
@@ -9346,6 +9377,32 @@ var LCNProfileConnectionStatusEnum = mod.enum([
9346
9377
  "PENDING_REQUEST_RECEIVED",
9347
9378
  "NOT_CONNECTED"
9348
9379
  ]);
9380
+ var LCNProfileManagerValidator = mod.object({
9381
+ id: mod.string(),
9382
+ created: mod.string(),
9383
+ displayName: mod.string().default("").optional(),
9384
+ shortBio: mod.string().default("").optional(),
9385
+ bio: mod.string().default("").optional(),
9386
+ email: mod.string().optional(),
9387
+ image: mod.string().optional(),
9388
+ heroImage: mod.string().optional()
9389
+ });
9390
+ var PaginatedLCNProfileManagersValidator = PaginationResponseValidator.extend({
9391
+ records: LCNProfileManagerValidator.extend({ did: mod.string() }).array()
9392
+ });
9393
+ var LCNProfileManagerQueryValidator = mod.object({
9394
+ id: StringQuery,
9395
+ displayName: StringQuery,
9396
+ shortBio: StringQuery,
9397
+ bio: StringQuery,
9398
+ email: StringQuery
9399
+ }).partial();
9400
+ var PaginatedLCNProfilesAndManagersValidator = PaginationResponseValidator.extend({
9401
+ records: mod.object({
9402
+ profile: LCNProfileValidator,
9403
+ manager: LCNProfileManagerValidator.extend({ did: mod.string() }).optional()
9404
+ }).array()
9405
+ });
9349
9406
  var SentCredentialInfoValidator = mod.object({
9350
9407
  uri: mod.string(),
9351
9408
  to: mod.string(),
@@ -9364,6 +9421,7 @@ var BoostPermissionsValidator = mod.object({
9364
9421
  canEditChildren: mod.string(),
9365
9422
  canRevokeChildren: mod.string(),
9366
9423
  canManageChildrenPermissions: mod.string(),
9424
+ canManageChildrenProfiles: mod.boolean().default(false).optional(),
9367
9425
  canViewAnalytics: mod.boolean()
9368
9426
  });
9369
9427
  var LCNBoostStatus = mod.enum(["DRAFT", "LIVE"]);
@@ -9656,12 +9714,39 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
9656
9714
  did = newDid;
9657
9715
  return newDid;
9658
9716
  },
9717
+ createManagedProfile: async (_learnCard, profile) => {
9718
+ const newDid = await client.profileManager.createManagedProfile.mutate(profile);
9719
+ return newDid;
9720
+ },
9721
+ createProfileManager: async (_learnCard, profile) => {
9722
+ if (!userData)
9723
+ throw new Error("Please make an account first!");
9724
+ const newDid = await client.profileManager.createProfileManager.mutate(profile);
9725
+ return newDid;
9726
+ },
9727
+ createChildProfileManager: async (_learnCard, parentUri, profile) => {
9728
+ if (!userData)
9729
+ throw new Error("Please make an account first!");
9730
+ const newDid = await client.profileManager.createChildProfileManager.mutate({
9731
+ parentUri,
9732
+ profile
9733
+ });
9734
+ return newDid;
9735
+ },
9659
9736
  createManagedServiceProfile: async (_learnCard, profile) => {
9660
9737
  if (!userData)
9661
9738
  throw new Error("Please make an account first!");
9662
9739
  const newDid = await client.profile.createManagedServiceProfile.mutate(profile);
9663
9740
  return newDid;
9664
9741
  },
9742
+ getAvailableProfiles: async (_learnCard, options = {}) => {
9743
+ if (!userData)
9744
+ throw new Error("Please make an account first!");
9745
+ return client.profile.getAvailableProfiles.query(options);
9746
+ },
9747
+ getManagedProfiles: async (_learnCard, options = {}) => {
9748
+ return client.profileManager.getManagedProfiles.query(options);
9749
+ },
9665
9750
  getManagedServiceProfiles: async (_learnCard, options = {}) => {
9666
9751
  if (!userData)
9667
9752
  throw new Error("Please make an account first!");
@@ -9677,6 +9762,9 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
9677
9762
  }
9678
9763
  return false;
9679
9764
  },
9765
+ updateProfileManagerProfile: async (_learnCard, manager) => {
9766
+ return client.profileManager.updateProfileManager.mutate(manager);
9767
+ },
9680
9768
  deleteProfile: async () => {
9681
9769
  if (!userData)
9682
9770
  throw new Error("Account does not exist!");
@@ -9693,6 +9781,11 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
9693
9781
  return client.profile.getProfile.query();
9694
9782
  return client.profile.getOtherProfile.query({ profileId });
9695
9783
  },
9784
+ getProfileManagerProfile: async (_learnCard, id) => {
9785
+ if (!id)
9786
+ return client.profileManager.getProfileManager.query();
9787
+ return client.profileManager.getOtherProfileManager.query({ id });
9788
+ },
9696
9789
  searchProfiles: async (_learnCard, input = "", {
9697
9790
  limit = 25,
9698
9791
  includeSelf = false,
@@ -9983,6 +10076,11 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
9983
10076
  throw new Error("Please make an account first!");
9984
10077
  return client.boost.getBoostRecipientCount.query({ uri, includeUnacceptedBoosts });
9985
10078
  },
10079
+ getBoostChildrenProfileManagers: async (_learnCard, uri, options) => {
10080
+ if (!userData)
10081
+ throw new Error("Please make an account first!");
10082
+ return client.boost.getChildrenProfileManagers.query({ uri, ...options });
10083
+ },
9986
10084
  updateBoost: async (_learnCard, uri, updates, credential) => {
9987
10085
  if (!userData)
9988
10086
  throw new Error("Please make an account first!");
@@ -10008,17 +10106,26 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
10008
10106
  throw new Error("Please make an account first!");
10009
10107
  if (!profileId)
10010
10108
  return client.boost.updateBoostPermissions.query({ uri, updates });
10011
- return client.boost.updateOtherBoostPermissions.query({ uri, profileId, updates });
10109
+ const result = await client.boost.updateOtherBoostPermissions.query({ uri, profileId, updates });
10110
+ if (result)
10111
+ await _learnCard.invoke.clearDidWebCache?.();
10112
+ return result;
10012
10113
  },
10013
10114
  addBoostAdmin: async (_learnCard, uri, profileId) => {
10014
10115
  if (!userData)
10015
10116
  throw new Error("Please make an account first!");
10016
- return client.boost.addBoostAdmin.mutate({ uri, profileId });
10117
+ const result = await client.boost.addBoostAdmin.mutate({ uri, profileId });
10118
+ if (result)
10119
+ await _learnCard.invoke.clearDidWebCache?.();
10120
+ return result;
10017
10121
  },
10018
10122
  removeBoostAdmin: async (_learnCard, uri, profileId) => {
10019
10123
  if (!userData)
10020
10124
  throw new Error("Please make an account first!");
10021
- return client.boost.removeBoostAdmin.mutate({ uri, profileId });
10125
+ const result = await client.boost.removeBoostAdmin.mutate({ uri, profileId });
10126
+ if (result)
10127
+ await _learnCard.invoke.clearDidWebCache?.();
10128
+ return result;
10022
10129
  },
10023
10130
  deleteBoost: async (_learnCard, uri) => {
10024
10131
  if (!userData)