@learncard/network-plugin 2.13.14 → 2.13.16
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.cjs +51 -6
- package/dist/lcn-plugin.cjs.development.cjs.map +2 -2
- package/dist/lcn-plugin.cjs.production.min.cjs +7 -7
- package/dist/lcn-plugin.cjs.production.min.cjs.map +3 -3
- package/dist/lcn-plugin.esm.js +51 -6
- package/dist/lcn-plugin.esm.js.map +2 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/types.d.ts +5 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -15
- package/src/plugin.ts +25 -4
- package/src/test/index.test.ts +132 -14
- package/src/types.ts +6 -0
|
@@ -15627,6 +15627,31 @@ var LCNPublicProfileValidator = LCNProfileValidator.pick({
|
|
|
15627
15627
|
isServiceProfile: true,
|
|
15628
15628
|
display: true
|
|
15629
15629
|
});
|
|
15630
|
+
var LCNConnectionPromptStatusValidator = external_exports.enum(["PENDING", "SKIPPED", "CONNECTED"]);
|
|
15631
|
+
var LCNConnectionPromptSurfaceValidator = external_exports.enum(["POST_CLAIM", "NOTIFICATION"]);
|
|
15632
|
+
var LCNConnectionPromptActionStatusValidator = external_exports.enum([
|
|
15633
|
+
"PENDING",
|
|
15634
|
+
"SKIPPED",
|
|
15635
|
+
"CONNECTED",
|
|
15636
|
+
"STALE"
|
|
15637
|
+
]);
|
|
15638
|
+
var LCNConnectionPromptValidator = external_exports.object({
|
|
15639
|
+
promptId: external_exports.string().uuid(),
|
|
15640
|
+
status: LCNConnectionPromptStatusValidator,
|
|
15641
|
+
surface: LCNConnectionPromptSurfaceValidator,
|
|
15642
|
+
triggerId: external_exports.string(),
|
|
15643
|
+
triggeredAt: external_exports.iso.datetime(),
|
|
15644
|
+
updatedAt: external_exports.iso.datetime(),
|
|
15645
|
+
counterpart: LCNPublicProfileValidator
|
|
15646
|
+
});
|
|
15647
|
+
var LCNConnectionPromptActionResultValidator = external_exports.object({
|
|
15648
|
+
promptId: external_exports.string().uuid(),
|
|
15649
|
+
status: LCNConnectionPromptActionStatusValidator
|
|
15650
|
+
});
|
|
15651
|
+
var LCNConnectionPromptMetadataValidator = external_exports.object({
|
|
15652
|
+
promptId: external_exports.string().uuid(),
|
|
15653
|
+
counterpartProfileId: external_exports.string()
|
|
15654
|
+
});
|
|
15630
15655
|
var LCNAuthedProfileValidator = LCNPublicProfileValidator.extend({
|
|
15631
15656
|
bio: LCNProfileValidator.shape.bio,
|
|
15632
15657
|
websiteLink: LCNProfileValidator.shape.websiteLink,
|
|
@@ -15635,7 +15660,8 @@ var LCNAuthedProfileValidator = LCNPublicProfileValidator.extend({
|
|
|
15635
15660
|
did: LCNProfileValidator.shape.did
|
|
15636
15661
|
});
|
|
15637
15662
|
var LCNConnectionProfileValidator = LCNAuthedProfileValidator.extend({
|
|
15638
|
-
email: LCNProfileValidator.shape.email
|
|
15663
|
+
email: LCNProfileValidator.shape.email,
|
|
15664
|
+
connectedAt: external_exports.iso.datetime().optional().describe("When the viewer and this profile became connected.")
|
|
15639
15665
|
});
|
|
15640
15666
|
var LCNVisibleProfileValidator = external_exports.union([
|
|
15641
15667
|
LCNConnectionProfileValidator.strict(),
|
|
@@ -16191,12 +16217,15 @@ var LCNNotificationInboxValidator = external_exports.object({
|
|
|
16191
16217
|
}),
|
|
16192
16218
|
timestamp: external_exports.iso.datetime().optional()
|
|
16193
16219
|
});
|
|
16220
|
+
var LCNNotificationMetadataValidator = external_exports.object({
|
|
16221
|
+
connectionPrompt: LCNConnectionPromptMetadataValidator.optional()
|
|
16222
|
+
}).catchall(external_exports.unknown());
|
|
16194
16223
|
var LCNNotificationDataValidator = external_exports.object({
|
|
16195
16224
|
vcUris: external_exports.array(external_exports.string()).optional(),
|
|
16196
16225
|
vpUris: external_exports.array(external_exports.string()).optional(),
|
|
16197
16226
|
transaction: ConsentFlowTransactionValidator.optional(),
|
|
16198
16227
|
inbox: LCNNotificationInboxValidator.optional(),
|
|
16199
|
-
metadata:
|
|
16228
|
+
metadata: LCNNotificationMetadataValidator.optional()
|
|
16200
16229
|
}).loose();
|
|
16201
16230
|
var LCNNotificationValidator = external_exports.object({
|
|
16202
16231
|
type: LCNNotificationTypeEnumValidator,
|
|
@@ -17926,6 +17955,22 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiTokenOrOptions, opt
|
|
|
17926
17955
|
await ensureUser();
|
|
17927
17956
|
return client.profile.acceptConnectionRequest.mutate({ profileId });
|
|
17928
17957
|
}, "acceptConnectionRequest"),
|
|
17958
|
+
getPendingConnectionPrompts: /* @__PURE__ */ __name(async (_learnCard) => {
|
|
17959
|
+
await ensureUser();
|
|
17960
|
+
return client.profile.pendingConnectionPrompts.query();
|
|
17961
|
+
}, "getPendingConnectionPrompts"),
|
|
17962
|
+
getConnectionPromptStatus: /* @__PURE__ */ __name(async (_learnCard, promptId) => {
|
|
17963
|
+
await ensureUser();
|
|
17964
|
+
return client.profile.connectionPromptStatus.query({ promptId });
|
|
17965
|
+
}, "getConnectionPromptStatus"),
|
|
17966
|
+
skipConnectionPrompt: /* @__PURE__ */ __name(async (_learnCard, promptId) => {
|
|
17967
|
+
await ensureUser();
|
|
17968
|
+
return client.profile.skipConnectionPrompt.mutate({ promptId });
|
|
17969
|
+
}, "skipConnectionPrompt"),
|
|
17970
|
+
connectWithConnectionPrompt: /* @__PURE__ */ __name(async (_learnCard, promptId) => {
|
|
17971
|
+
await ensureUser();
|
|
17972
|
+
return client.profile.connectWithConnectionPrompt.mutate({ promptId });
|
|
17973
|
+
}, "connectWithConnectionPrompt"),
|
|
17929
17974
|
getConnections: /* @__PURE__ */ __name(async (_learnCard) => {
|
|
17930
17975
|
console.warn(
|
|
17931
17976
|
"The getConnections method is deprecated! Please use getPaginatedConnections instead!"
|
|
@@ -19283,7 +19328,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiTokenOrOptions, opt
|
|
|
19283
19328
|
}, "getActivityChain"),
|
|
19284
19329
|
isServiceTrusted: /* @__PURE__ */ __name(async (_learnCard, serviceDid) => {
|
|
19285
19330
|
const trustedServices = await client.federation.getTrustedServices.query({});
|
|
19286
|
-
return trustedServices.some(
|
|
19331
|
+
return trustedServices.some(
|
|
19332
|
+
(service) => service.did === serviceDid
|
|
19333
|
+
);
|
|
19287
19334
|
}, "isServiceTrusted"),
|
|
19288
19335
|
getTrustedServices: /* @__PURE__ */ __name(async () => {
|
|
19289
19336
|
return client.federation.getTrustedServices.query({});
|
|
@@ -19339,9 +19386,7 @@ var getVerifyBoostPlugin = /* @__PURE__ */ __name(async (learnCard, trustedBoost
|
|
|
19339
19386
|
const boostCredential = credential?.boostCredential;
|
|
19340
19387
|
try {
|
|
19341
19388
|
if (boostCredential) {
|
|
19342
|
-
const verifyBoostCredential = await learnCard.invoke.verifyCredential(
|
|
19343
|
-
boostCredential
|
|
19344
|
-
);
|
|
19389
|
+
const verifyBoostCredential = await learnCard.invoke.verifyCredential(boostCredential);
|
|
19345
19390
|
const boostCredentialErrors = verifyBoostCredential.errors ?? [];
|
|
19346
19391
|
if (verifyBoostCredential.status?.length) {
|
|
19347
19392
|
verificationCheck.status = [
|