@learncard/network-plugin 2.10.12 → 2.10.13
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.
- package/dist/lcn-plugin.cjs.development.js +44 -3
- package/dist/lcn-plugin.cjs.development.js.map +2 -2
- package/dist/lcn-plugin.cjs.production.min.js +9 -9
- package/dist/lcn-plugin.cjs.production.min.js.map +3 -3
- package/dist/lcn-plugin.esm.js +44 -3
- package/dist/lcn-plugin.esm.js.map +2 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/types.d.ts +16 -12
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
package/dist/lcn-plugin.esm.js
CHANGED
|
@@ -13565,6 +13565,8 @@ var LCNProfileDisplayValidator = external_exports.object({
|
|
|
13565
13565
|
idBackgroundColor: external_exports.string().optional(),
|
|
13566
13566
|
repeatIdBackgroundImage: external_exports.boolean().optional()
|
|
13567
13567
|
});
|
|
13568
|
+
var ProfileVisibilityEnum = external_exports.enum(["public", "connections_only", "private"]);
|
|
13569
|
+
var AllowConnectionRequestsEnum = external_exports.enum(["anyone", "invite_only"]);
|
|
13568
13570
|
var LCNProfileValidator = external_exports.object({
|
|
13569
13571
|
profileId: external_exports.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),
|
|
13570
13572
|
displayName: external_exports.string().default("").describe("Human-readable display name for the profile."),
|
|
@@ -13572,6 +13574,9 @@ var LCNProfileValidator = external_exports.object({
|
|
|
13572
13574
|
bio: external_exports.string().default("").describe("Longer bio for the profile."),
|
|
13573
13575
|
did: external_exports.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
|
|
13574
13576
|
isPrivate: external_exports.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
|
|
13577
|
+
profileVisibility: ProfileVisibilityEnum.default("public").optional().describe("Profile visibility: 'public', 'connections_only', or 'private'."),
|
|
13578
|
+
showEmail: external_exports.boolean().default(false).optional().describe("Whether to show email to connections."),
|
|
13579
|
+
allowConnectionRequests: AllowConnectionRequestsEnum.default("anyone").optional().describe("Who can send connection requests: 'anyone' or 'invite_only'."),
|
|
13575
13580
|
email: external_exports.string().optional().describe("Contact email address for the profile. (deprecated)"),
|
|
13576
13581
|
image: external_exports.string().optional().describe("Profile image URL for the profile."),
|
|
13577
13582
|
heroImage: external_exports.string().optional().describe("Hero image URL for the profile."),
|
|
@@ -13586,6 +13591,32 @@ var LCNProfileValidator = external_exports.object({
|
|
|
13586
13591
|
country: external_exports.string().optional().describe("Country for the profile."),
|
|
13587
13592
|
approved: external_exports.boolean().optional().describe("Approval status for the profile.")
|
|
13588
13593
|
});
|
|
13594
|
+
var LCNPublicProfileValidator = LCNProfileValidator.pick({
|
|
13595
|
+
profileId: true,
|
|
13596
|
+
displayName: true,
|
|
13597
|
+
shortBio: true,
|
|
13598
|
+
image: true,
|
|
13599
|
+
heroImage: true,
|
|
13600
|
+
type: true,
|
|
13601
|
+
isServiceProfile: true,
|
|
13602
|
+
display: true
|
|
13603
|
+
});
|
|
13604
|
+
var LCNAuthedProfileValidator = LCNPublicProfileValidator.extend({
|
|
13605
|
+
bio: LCNProfileValidator.shape.bio,
|
|
13606
|
+
websiteLink: LCNProfileValidator.shape.websiteLink,
|
|
13607
|
+
role: LCNProfileValidator.shape.role,
|
|
13608
|
+
highlightedCredentials: LCNProfileValidator.shape.highlightedCredentials,
|
|
13609
|
+
did: LCNProfileValidator.shape.did
|
|
13610
|
+
});
|
|
13611
|
+
var LCNConnectionProfileValidator = LCNAuthedProfileValidator.extend({
|
|
13612
|
+
email: LCNProfileValidator.shape.email
|
|
13613
|
+
});
|
|
13614
|
+
var LCNVisibleProfileValidator = external_exports.union([
|
|
13615
|
+
LCNConnectionProfileValidator.strict(),
|
|
13616
|
+
LCNAuthedProfileValidator.strict(),
|
|
13617
|
+
LCNPublicProfileValidator.strict(),
|
|
13618
|
+
LCNProfileValidator
|
|
13619
|
+
]);
|
|
13589
13620
|
var LCNProfileQueryValidator = external_exports.object({
|
|
13590
13621
|
profileId: StringQuery,
|
|
13591
13622
|
displayName: StringQuery,
|
|
@@ -13599,6 +13630,9 @@ var LCNProfileQueryValidator = external_exports.object({
|
|
|
13599
13630
|
var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
|
|
13600
13631
|
records: LCNProfileValidator.array()
|
|
13601
13632
|
});
|
|
13633
|
+
var PaginatedVisibleLCNProfilesValidator = PaginationResponseValidator.extend({
|
|
13634
|
+
records: LCNVisibleProfileValidator.array()
|
|
13635
|
+
});
|
|
13602
13636
|
var LCNProfileConnectionStatusEnum = external_exports.enum([
|
|
13603
13637
|
"CONNECTED",
|
|
13604
13638
|
"PENDING_REQUEST_SENT",
|
|
@@ -13732,7 +13766,7 @@ var PaginatedBoostsValidator = PaginationResponseValidator.extend({
|
|
|
13732
13766
|
records: BoostValidator.array()
|
|
13733
13767
|
});
|
|
13734
13768
|
var BoostRecipientValidator = external_exports.object({
|
|
13735
|
-
to:
|
|
13769
|
+
to: LCNVisibleProfileValidator,
|
|
13736
13770
|
from: external_exports.string(),
|
|
13737
13771
|
received: external_exports.string().optional(),
|
|
13738
13772
|
uri: external_exports.string().optional()
|
|
@@ -13741,7 +13775,7 @@ var PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({
|
|
|
13741
13775
|
records: BoostRecipientValidator.array()
|
|
13742
13776
|
});
|
|
13743
13777
|
var BoostRecipientWithChildrenValidator = external_exports.object({
|
|
13744
|
-
to:
|
|
13778
|
+
to: LCNVisibleProfileValidator,
|
|
13745
13779
|
from: external_exports.string(),
|
|
13746
13780
|
received: external_exports.string().optional(),
|
|
13747
13781
|
boostUris: external_exports.array(external_exports.string()),
|
|
@@ -15236,6 +15270,9 @@ var renderTemplateJson = /* @__PURE__ */ __name((jsonString, templateData) => {
|
|
|
15236
15270
|
const unescapedTemplate = jsonString.replace(/\{\{([^{}]+)\}\}/g, "{{{$1}}}");
|
|
15237
15271
|
return mustache_default.render(unescapedTemplate, preparedData);
|
|
15238
15272
|
}, "renderTemplateJson");
|
|
15273
|
+
var hasDid = /* @__PURE__ */ __name((profile) => {
|
|
15274
|
+
return !!profile && "did" in profile && typeof profile.did === "string" && profile.did.length > 0;
|
|
15275
|
+
}, "hasDid");
|
|
15239
15276
|
async function getLearnCardNetworkPlugin(learnCard, url2, apiTokenOrOptions, options) {
|
|
15240
15277
|
const apiToken = typeof apiTokenOrOptions === "string" ? apiTokenOrOptions : void 0;
|
|
15241
15278
|
const guardianApprovalGetter = (typeof apiTokenOrOptions === "object" ? apiTokenOrOptions?.guardianApprovalGetter : void 0) ?? options?.guardianApprovalGetter;
|
|
@@ -15566,6 +15603,7 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiTokenOrOptions, opt
|
|
|
15566
15603
|
}
|
|
15567
15604
|
const target = await _learnCard.invoke.getProfile(profileId);
|
|
15568
15605
|
if (!target) throw new Error("Could not find target account");
|
|
15606
|
+
if (!hasDid(target)) throw new Error("Could not find target DID");
|
|
15569
15607
|
const credential = await _learnCard.invoke.createDagJwe(vc, [
|
|
15570
15608
|
_learnCard.id.did(),
|
|
15571
15609
|
target.did
|
|
@@ -15610,6 +15648,7 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiTokenOrOptions, opt
|
|
|
15610
15648
|
}
|
|
15611
15649
|
const target = await _learnCard.invoke.getProfile(profileId);
|
|
15612
15650
|
if (!target) throw new Error("Could not find target account");
|
|
15651
|
+
if (!hasDid(target)) throw new Error("Could not find target DID");
|
|
15613
15652
|
const presentation = await _learnCard.invoke.createDagJwe(vp, [
|
|
15614
15653
|
_learnCard.id.did(),
|
|
15615
15654
|
target.did
|
|
@@ -15864,6 +15903,7 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiTokenOrOptions, opt
|
|
|
15864
15903
|
if (!data.success) throw new Error("Did not get a valid boost from URI");
|
|
15865
15904
|
const targetProfile = await _learnCard.invoke.getProfile(profileId);
|
|
15866
15905
|
if (!targetProfile) throw new Error("Target profile not found");
|
|
15906
|
+
if (!hasDid(targetProfile)) throw new Error("Target profile has no DID");
|
|
15867
15907
|
let boost = data.data;
|
|
15868
15908
|
if (isVC2Format(boost)) {
|
|
15869
15909
|
boost.validFrom = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -15978,7 +16018,8 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiTokenOrOptions, opt
|
|
|
15978
16018
|
targetDid = recipient;
|
|
15979
16019
|
} else {
|
|
15980
16020
|
const targetProfile = await _learnCard.invoke.getProfile(recipient);
|
|
15981
|
-
if (!targetProfile)
|
|
16021
|
+
if (!hasDid(targetProfile))
|
|
16022
|
+
return client.boost.send.mutate(input);
|
|
15982
16023
|
targetDid = targetProfile.did;
|
|
15983
16024
|
}
|
|
15984
16025
|
let boost = data.data;
|