@learncard/network-plugin 2.13.4 → 2.13.6

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/src/types.ts ADDED
@@ -0,0 +1,908 @@
1
+ import type { LCNClient } from '@learncard/network-brain-client';
2
+ import {
3
+ LCNProfile,
4
+ LCNVisibleProfile,
5
+ LCNProfileConnectionStatusEnum,
6
+ LCNProfileManager,
7
+ UnsignedVC,
8
+ VC,
9
+ VP,
10
+ SentCredentialInfo,
11
+ JWE,
12
+ Boost,
13
+ BoostQuery,
14
+ LCNSigningAuthorityForUserType,
15
+ LCNBoostClaimLinkSigningAuthorityType,
16
+ LCNBoostClaimLinkOptionsType,
17
+ PaginationOptionsType,
18
+ PaginatedBoostsType,
19
+ PaginatedBoostRecipientsType,
20
+ PaginatedBoostRecipientsWithChildrenType,
21
+ PaginatedLCNProfiles,
22
+ PaginatedVisibleLCNProfiles,
23
+ ConsentFlowContract,
24
+ ConsentFlowContractQuery,
25
+ ConsentFlowTerms,
26
+ ConsentFlowTermsQuery,
27
+ PaginatedConsentFlowContracts,
28
+ PaginatedConsentFlowTerms,
29
+ ConsentFlowContractDetails,
30
+ PaginatedConsentFlowTransactions,
31
+ ConsentFlowTransactionsQuery,
32
+ HolderExportMetadata,
33
+ PaginatedConsentFlowData,
34
+ ConsentFlowDataQuery,
35
+ BoostRecipientInfo,
36
+ BoostPermissions,
37
+ LCNProfileQuery,
38
+ LCNProfileManagerQuery,
39
+ PaginatedLCNProfileManagers,
40
+ PaginatedLCNProfilesAndManagers,
41
+ DidDocument,
42
+ ClaimHook,
43
+ ClaimHookQuery,
44
+ PaginatedClaimHooksType,
45
+ ConsentFlowDataForDidQuery,
46
+ PaginatedConsentFlowDataForDid,
47
+ PaginatedContractCredentials,
48
+ AutoBoostConfig,
49
+ SendInput,
50
+ SendResponse,
51
+ AuthGrantType,
52
+ AuthGrantQuery,
53
+ IssueInboxCredentialType,
54
+ InboxCredentialType,
55
+ PaginatedInboxCredentialsType,
56
+ PaginatedSkillFrameworksType,
57
+ ContactMethodQueryType,
58
+ ContactMethodType,
59
+ InboxCredentialQuery,
60
+ IssueInboxCredentialResponseType,
61
+ // Shared Skills/Frameworks/Tags (non-flat)
62
+ TagType,
63
+ SkillFrameworkType,
64
+ SkillFrameworkQuery,
65
+ SkillType,
66
+ SkillQuery,
67
+ PaginatedSkillTree,
68
+ FrameworkWithSkills,
69
+ SyncFrameworkInput,
70
+ AddTagInput,
71
+ LinkProviderFrameworkInputType,
72
+ CreateManagedSkillFrameworkInput,
73
+ CreateManagedSkillFrameworkBatchInput,
74
+ UpdateSkillFrameworkInput,
75
+ CreateSkillInput,
76
+ CreateSkillsBatchInput,
77
+ UpdateSkillInput,
78
+ DeleteSkillInput,
79
+ ReplaceSkillFrameworkSkillsInput,
80
+ ReplaceSkillFrameworkSkillsResult,
81
+ CountSkillsInput,
82
+ CountSkillsResult,
83
+ GetFullSkillTreeInput,
84
+ GetFullSkillTreeResult,
85
+ GetSkillPathInput,
86
+ GetSkillPathResult,
87
+ SkillSemanticSearchInput,
88
+ SkillSemanticSearchResult,
89
+ // Integrations
90
+ LCNIntegration,
91
+ LCNIntegrationCreateType,
92
+ LCNIntegrationUpdateType,
93
+ LCNIntegrationQueryType,
94
+ PaginatedLCNIntegrationsType,
95
+ // App Store
96
+ AppStoreListing,
97
+ AppStoreListingCreateType,
98
+ AppStoreListingUpdateType,
99
+ AppListingStatus,
100
+ PromotionLevel,
101
+ PaginatedAppStoreListings,
102
+ PaginatedInstalledApps,
103
+ AppEvent,
104
+ AppEventResponse,
105
+ // Activity
106
+ CredentialActivityEventType,
107
+ CredentialActivityRecord,
108
+ PaginatedCredentialActivities,
109
+ CredentialActivityStats,
110
+ BitstringCredentialStatusPurpose,
111
+ BitstringCredentialStatusEntry,
112
+ } from '@learncard/types';
113
+ import { Plugin } from '@learncard/core';
114
+ import { ProofOptions } from '@learncard/didkit-plugin';
115
+ import { VerifyExtension } from '@learncard/vc-plugin';
116
+
117
+ export type { BitstringCredentialStatusPurpose, BitstringCredentialStatusEntry };
118
+
119
+ /** @group LearnCardNetwork Plugin */
120
+ export type LearnCardNetworkPluginDependentMethods = {
121
+ getDidAuthVp: (options?: ProofOptions) => Promise<VP | string>;
122
+ issueCredential: (
123
+ credential: UnsignedVC,
124
+ signingOptions?: Partial<ProofOptions>
125
+ ) => Promise<VC>;
126
+ clearDidWebCache?: () => Promise<void>;
127
+ createDagJwe: (cleartext: any, recipients: string[]) => Promise<JWE>;
128
+ decryptDagJwe: (jwe: JWE, jwks: any[]) => Promise<any>;
129
+ resolveDid: (did: string) => Promise<DidDocument>;
130
+ };
131
+
132
+ /** @group LearnCardNetwork Plugin */
133
+ export type LearnCardNetworkPluginMethods = {
134
+ createProfile: (
135
+ profile: Omit<LCNProfile, 'did' | 'isServiceProfile'> & { authToken?: string }
136
+ ) => Promise<string>;
137
+ createServiceProfile: (
138
+ profile: Omit<LCNProfile, 'did' | 'isServiceProfile'>
139
+ ) => Promise<string>;
140
+ createManagedProfile: (profile: Omit<LCNProfile, 'did'>) => Promise<string>;
141
+ createProfileManager: (profile: Omit<LCNProfileManager, 'id' | 'created'>) => Promise<string>;
142
+ createChildProfileManager: (
143
+ parentUri: string,
144
+ profile: Omit<LCNProfileManager, 'id' | 'created'>
145
+ ) => Promise<string>;
146
+ createManagedServiceProfile: (
147
+ profile: Omit<LCNProfile, 'did' | 'isServiceProfile'>
148
+ ) => Promise<string>;
149
+ getAvailableProfiles: (
150
+ options?: Partial<PaginationOptionsType> & { query?: LCNProfileQuery }
151
+ ) => Promise<PaginatedLCNProfilesAndManagers>;
152
+ getManagedProfiles: (
153
+ options?: Partial<PaginationOptionsType> & { query?: LCNProfileQuery }
154
+ ) => Promise<PaginatedLCNProfiles>;
155
+ claimPendingGuardianLinks: () => Promise<
156
+ Array<{ childProfileId: string; childDisplayName: string; managerId: string | null }>
157
+ >;
158
+ getMyManagedChildren: () => Promise<LCNProfile[]>;
159
+ getMyGuardians: () => Promise<LCNProfile[]>;
160
+ removeManagesRelationship: (profileId: string) => Promise<boolean>;
161
+ getManagedServiceProfiles: (
162
+ options: Partial<PaginationOptionsType> & { id?: string }
163
+ ) => Promise<PaginatedLCNProfiles>;
164
+ updateProfile: (
165
+ profile: Partial<Omit<LCNProfile, 'did' | 'isServiceProfile'>>
166
+ ) => Promise<boolean>;
167
+ updateProfileManagerProfile: (
168
+ manager: Partial<Omit<LCNProfileManager, 'id' | 'created'>>
169
+ ) => Promise<boolean>;
170
+ deleteProfile: () => Promise<boolean>;
171
+ getProfile: (profileId?: string) => Promise<LCNVisibleProfile | undefined>;
172
+ getProfileManagerProfile: (id?: string) => Promise<LCNProfileManager | undefined>;
173
+ searchProfiles: (
174
+ profileId?: string,
175
+ options?: {
176
+ limit?: number;
177
+ includeSelf?: boolean;
178
+ includeConnectionStatus?: boolean;
179
+ includeServiceProfiles?: boolean;
180
+ }
181
+ ) => Promise<(LCNVisibleProfile & { connectionStatus?: LCNProfileConnectionStatusEnum })[]>;
182
+ connectWith: (profileId: string) => Promise<boolean>;
183
+ connectWithExpiredInvite: (profileId: string) => Promise<boolean>;
184
+ connectWithInvite: (profileId: string, challenge: string) => Promise<boolean>;
185
+ cancelConnectionRequest: (profileId: string) => Promise<boolean>;
186
+ disconnectWith: (profileId: string) => Promise<boolean>;
187
+ acceptConnectionRequest: (id: string) => Promise<boolean>;
188
+ /** @deprecated Use getPaginatedConnections */
189
+ getConnections: () => Promise<LCNVisibleProfile[]>;
190
+ getPaginatedConnections: (
191
+ options?: PaginationOptionsType
192
+ ) => Promise<PaginatedVisibleLCNProfiles>;
193
+ /** @deprecated Use getPaginatedPendingConnections */
194
+ getPendingConnections: () => Promise<LCNVisibleProfile[]>;
195
+ getPaginatedPendingConnections: (
196
+ options?: PaginationOptionsType
197
+ ) => Promise<PaginatedVisibleLCNProfiles>;
198
+ /** @deprecated Use getPaginatedConnectionRequests */
199
+ getConnectionRequests: () => Promise<LCNVisibleProfile[]>;
200
+ getPaginatedConnectionRequests: (
201
+ options?: PaginationOptionsType
202
+ ) => Promise<PaginatedVisibleLCNProfiles>;
203
+ generateInvite: (
204
+ challenge?: string,
205
+ expiration?: number,
206
+ maxUses?: number
207
+ ) => Promise<{ profileId: string; challenge: string; expiresIn: number | null }>;
208
+
209
+ listInvites: () => Promise<
210
+ {
211
+ challenge: string;
212
+ expiresIn: number | null;
213
+ usesRemaining: number | null;
214
+ maxUses: number | null;
215
+ }[]
216
+ >;
217
+
218
+ invalidateInvite: (challenge: string) => Promise<boolean>;
219
+
220
+ blockProfile: (profileId: string) => Promise<boolean>;
221
+ unblockProfile: (profileId: string) => Promise<boolean>;
222
+ getBlockedProfiles: () => Promise<LCNVisibleProfile[]>;
223
+
224
+ sendCredential: (
225
+ profileId: string,
226
+ vc: UnsignedVC | VC,
227
+ metadataOrEncrypt?: Record<string, unknown> | boolean,
228
+ encrypt?: boolean
229
+ ) => Promise<string>;
230
+ acceptCredential: (
231
+ uri: string,
232
+ options?: {
233
+ skipNotification?: boolean;
234
+ metadata?: Record<string, unknown>;
235
+ }
236
+ ) => Promise<boolean>;
237
+ getReceivedCredentials: (from?: string) => Promise<SentCredentialInfo[]>;
238
+ getRevokedCredentials: () => Promise<string[]>;
239
+ getSentCredentials: (to?: string) => Promise<SentCredentialInfo[]>;
240
+ getIncomingCredentials: (from?: string) => Promise<SentCredentialInfo[]>;
241
+ deleteCredential: (uri: string) => Promise<boolean>;
242
+
243
+ sendPresentation: (profileId: string, vp: VP, encrypt?: boolean) => Promise<string>;
244
+ acceptPresentation: (uri: string) => Promise<boolean>;
245
+ getReceivedPresentations: (from?: string) => Promise<SentCredentialInfo[]>;
246
+ getSentPresentations: (to?: string) => Promise<SentCredentialInfo[]>;
247
+ getIncomingPresentations: (from?: string) => Promise<SentCredentialInfo[]>;
248
+ deletePresentation: (uri: string) => Promise<boolean>;
249
+
250
+ createBoost: (
251
+ credential: VC | UnsignedVC,
252
+ metadata?: Partial<Omit<Boost, 'uri'>> & {
253
+ skills?: { frameworkId: string; id: string; proficiencyLevel?: number }[];
254
+ }
255
+ ) => Promise<string>;
256
+ createChildBoost: (
257
+ parentUri: string,
258
+ credential: VC | UnsignedVC,
259
+ metadata?: Partial<Omit<Boost, 'uri'>> & {
260
+ skills?: { frameworkId: string; id: string; proficiencyLevel?: number }[];
261
+ }
262
+ ) => Promise<string>;
263
+ getBoost: (uri: string) => Promise<Boost & { boost: UnsignedVC }>;
264
+ getBoostSkills: (uri: string) => Promise<(SkillType & { proficiencyLevel?: number })[]>;
265
+ getBoostFrameworks: (
266
+ uri: string,
267
+ options?: { limit?: number; cursor?: string | null; query?: SkillFrameworkQuery }
268
+ ) => Promise<PaginatedSkillFrameworksType>;
269
+ getSkillsAvailableForBoost: (uri: string) => Promise<
270
+ {
271
+ framework: SkillFrameworkType;
272
+ skills: Omit<SkillType, 'createdAt' | 'updatedAt'>[];
273
+ }[]
274
+ >;
275
+ searchSkillsAvailableForBoost: (
276
+ uri: string,
277
+ query: SkillQuery,
278
+ options?: { limit?: number; cursor?: string | null }
279
+ ) => Promise<{ records: SkillType[]; hasMore: boolean; cursor: string | null }>;
280
+ /** @deprecated Use getPaginatedBoosts */
281
+ getBoosts: (query?: BoostQuery) => Promise<{ name?: string; uri: string }[]>;
282
+ getPaginatedBoosts: (
283
+ options?: PaginationOptionsType & { query?: BoostQuery }
284
+ ) => Promise<PaginatedBoostsType>;
285
+ countBoosts: (query?: BoostQuery) => Promise<number>;
286
+ getBoostChildren: (
287
+ uri: string,
288
+ options?: PaginationOptionsType & { query?: BoostQuery; numberOfGenerations?: number }
289
+ ) => Promise<PaginatedBoostsType>;
290
+ countBoostChildren: (
291
+ uri: string,
292
+ options?: { query?: BoostQuery; numberOfGenerations?: number }
293
+ ) => Promise<number>;
294
+ getBoostSiblings: (
295
+ uri: string,
296
+ options?: PaginationOptionsType & { query?: BoostQuery }
297
+ ) => Promise<PaginatedBoostsType>;
298
+ countBoostSiblings: (uri: string, options?: { query?: BoostQuery }) => Promise<number>;
299
+ getFamilialBoosts: (
300
+ uri: string,
301
+ options?: PaginationOptionsType & {
302
+ query?: BoostQuery;
303
+ parentGenerations?: number;
304
+ childGenerations?: number;
305
+ includeExtendedFamily?: boolean;
306
+ }
307
+ ) => Promise<PaginatedBoostsType>;
308
+ countFamilialBoosts: (
309
+ uri: string,
310
+ options?: {
311
+ query?: BoostQuery;
312
+ parentGenerations?: number;
313
+ childGenerations?: number;
314
+ includeExtendedFamily?: boolean;
315
+ }
316
+ ) => Promise<number>;
317
+ getBoostParents: (
318
+ uri: string,
319
+ options?: PaginationOptionsType & {
320
+ query?: BoostQuery;
321
+ numberOfGenerations?: number;
322
+ }
323
+ ) => Promise<PaginatedBoostsType>;
324
+ countBoostParents: (
325
+ uri: string,
326
+ options?: { query?: BoostQuery; numberOfGenerations?: number }
327
+ ) => Promise<number>;
328
+ makeBoostParent: (uris: { parentUri: string; childUri: string }) => Promise<boolean>;
329
+ removeBoostParent: (uris: { parentUri: string; childUri: string }) => Promise<boolean>;
330
+ /** @deprecated Use getPaginatedBoostRecipients */
331
+ getBoostRecipients: (
332
+ uri: string,
333
+ limit?: number,
334
+ skip?: number,
335
+ includeUnacceptedBoosts?: boolean
336
+ ) => Promise<BoostRecipientInfo[]>;
337
+ getPaginatedBoostRecipients: (
338
+ uri: string,
339
+ limit?: number,
340
+ cursor?: string,
341
+ includeUnacceptedBoosts?: boolean,
342
+ query?: LCNProfileQuery
343
+ ) => Promise<PaginatedBoostRecipientsType>;
344
+ getPaginatedBoostRecipientsWithChildren: (
345
+ uri: string,
346
+ limit?: number,
347
+ cursor?: string,
348
+ includeUnacceptedBoosts?: boolean,
349
+ boostQuery?: BoostQuery,
350
+ profileQuery?: LCNProfileQuery,
351
+ numberOfGenerations?: number
352
+ ) => Promise<PaginatedBoostRecipientsWithChildrenType>;
353
+ countBoostRecipientsWithChildren: (
354
+ uri: string,
355
+ includeUnacceptedBoosts?: boolean,
356
+ boostQuery?: BoostQuery,
357
+ profileQuery?: LCNProfileQuery,
358
+ numberOfGenerations?: number
359
+ ) => Promise<number>;
360
+ countBoostRecipients: (uri: string, includeUnacceptedBoosts?: boolean) => Promise<number>;
361
+ getConnectedBoostRecipients: (
362
+ uri: string,
363
+ options?: {
364
+ limit?: number;
365
+ cursor?: string;
366
+ includeUnacceptedBoosts?: boolean;
367
+ query?: LCNProfileQuery;
368
+ }
369
+ ) => Promise<PaginatedBoostRecipientsType>;
370
+ countConnectedBoostRecipients: (
371
+ uri: string,
372
+ includeUnacceptedBoosts?: boolean
373
+ ) => Promise<number>;
374
+ getBoostChildrenProfileManagers: (
375
+ uri: string,
376
+ options?: Partial<PaginationOptionsType> & { query?: LCNProfileManagerQuery }
377
+ ) => Promise<PaginatedLCNProfileManagers>;
378
+ updateBoost: (
379
+ uri: string,
380
+ updates: Partial<Omit<Boost, 'uri'>> & {
381
+ skills?: { frameworkId: string; id: string; proficiencyLevel?: number }[];
382
+ },
383
+ credential?: UnsignedVC | VC
384
+ ) => Promise<boolean>;
385
+ attachFrameworkToBoost: (boostUri: string, frameworkId: string) => Promise<boolean>;
386
+ detachFrameworkFromBoost: (boostUri: string, frameworkId: string) => Promise<boolean>;
387
+ alignBoostSkills: (
388
+ boostUri: string,
389
+ skills: { frameworkId: string; id: string; proficiencyLevel?: number }[]
390
+ ) => Promise<boolean>;
391
+ deleteBoost: (uri: string) => Promise<boolean>;
392
+ getBoostAdmins: (
393
+ uri: string,
394
+ options?: Partial<PaginationOptionsType> & { includeSelf?: boolean }
395
+ ) => Promise<PaginatedVisibleLCNProfiles>;
396
+ getBoostPermissions: (uri: string, profileId?: string) => Promise<BoostPermissions>;
397
+ updateBoostPermissions: (
398
+ uri: string,
399
+ updates: Partial<Omit<BoostPermissions, 'role'>>,
400
+ profileId?: string
401
+ ) => Promise<boolean>;
402
+ addBoostAdmin: (uri: string, profileId: string) => Promise<boolean>;
403
+ removeBoostAdmin: (uri: string, profileId: string) => Promise<boolean>;
404
+ allocateCredentialStatus: (options?: {
405
+ statusPurposes?: BitstringCredentialStatusPurpose[];
406
+ listSize?: number;
407
+ }) => Promise<BitstringCredentialStatusEntry[]>;
408
+ revokeBoostRecipient: (
409
+ boostUri: string,
410
+ recipientProfileId: string,
411
+ credentialUri?: string
412
+ ) => Promise<boolean>;
413
+ suspendBoostRecipient: (
414
+ boostUri: string,
415
+ recipientProfileId: string,
416
+ credentialUri?: string
417
+ ) => Promise<boolean>;
418
+ unsuspendBoostRecipient: (
419
+ boostUri: string,
420
+ recipientProfileId: string,
421
+ credentialUri?: string
422
+ ) => Promise<boolean>;
423
+ sendBoost: (
424
+ profileId: string,
425
+ boostUri: string,
426
+ options?:
427
+ | boolean
428
+ | {
429
+ encrypt?: boolean;
430
+ overideFn?: (boost: UnsignedVC) => UnsignedVC;
431
+ skipNotification?: boolean;
432
+ templateData?: Record<string, unknown>;
433
+ statusPurposes?: BitstringCredentialStatusPurpose[];
434
+ }
435
+ ) => Promise<string>;
436
+
437
+ registerSigningAuthority: (endpoint: string, name: string, did: string) => Promise<boolean>;
438
+ getRegisteredSigningAuthorities: () => Promise<LCNSigningAuthorityForUserType[]>;
439
+ getRegisteredSigningAuthority: (
440
+ endpoint: string,
441
+ name: string
442
+ ) => Promise<LCNSigningAuthorityForUserType | undefined>;
443
+ setPrimaryRegisteredSigningAuthority: (endpoint: string, name: string) => Promise<boolean>;
444
+ getPrimaryRegisteredSigningAuthority: () => Promise<LCNSigningAuthorityForUserType | undefined>;
445
+
446
+ generateClaimLink: (
447
+ boostUri: string,
448
+ claimLinkSA: LCNBoostClaimLinkSigningAuthorityType,
449
+ options?: LCNBoostClaimLinkOptionsType,
450
+ challenge?: string
451
+ ) => Promise<{ boostUri: string; challenge: string }>;
452
+ claimBoostWithLink: (boostUri: string, challenge: string) => Promise<string>;
453
+
454
+ send: (input: SendInput) => Promise<SendResponse>;
455
+
456
+ createContract: (contract: {
457
+ contract: ConsentFlowContract;
458
+ name: string;
459
+ subtitle?: string;
460
+ description?: string;
461
+ image?: string;
462
+ expiresAt?: string;
463
+ writers?: string[];
464
+ autoboosts?: AutoBoostConfig[];
465
+ }) => Promise<string>;
466
+ addAutoBoostsToContract: (
467
+ contractUri: string,
468
+ autoboosts: AutoBoostConfig[]
469
+ ) => Promise<boolean>;
470
+ removeAutoBoostsFromContract: (contractUri: string, boostUris: string[]) => Promise<boolean>;
471
+ getContract: (uri: string) => Promise<ConsentFlowContractDetails>;
472
+ getContracts: (
473
+ options?: Partial<PaginationOptionsType> & { query?: ConsentFlowContractQuery }
474
+ ) => Promise<PaginatedConsentFlowContracts>;
475
+ deleteContract: (uri: string) => Promise<boolean>;
476
+ getConsentFlowData: (
477
+ uri: string,
478
+ options?: Partial<PaginationOptionsType> & { query?: ConsentFlowDataQuery }
479
+ ) => Promise<PaginatedConsentFlowData>;
480
+ getConsentFlowDataForDid: (
481
+ did: string,
482
+ options?: Partial<PaginationOptionsType> & { query?: ConsentFlowDataForDidQuery }
483
+ ) => Promise<PaginatedConsentFlowDataForDid>;
484
+ getAllConsentFlowData: (
485
+ query?: ConsentFlowDataQuery,
486
+ options?: Partial<PaginationOptionsType>
487
+ ) => Promise<PaginatedConsentFlowData>;
488
+ writeCredentialToContract: (
489
+ did: string,
490
+ contractUri: string,
491
+ credential: VC | JWE,
492
+ boostUri: string
493
+ ) => Promise<string>;
494
+
495
+ consentToContract: (
496
+ uri: string,
497
+ terms: {
498
+ terms: ConsentFlowTerms;
499
+ expiresAt?: string;
500
+ oneTime?: boolean;
501
+ },
502
+ recipientToken?: string
503
+ ) => Promise<{ termsUri: string; redirectUrl?: string }>;
504
+ getConsentedContracts: (
505
+ options?: Partial<PaginationOptionsType> & { query?: ConsentFlowTermsQuery }
506
+ ) => Promise<PaginatedConsentFlowTerms>;
507
+ updateContractTerms: (
508
+ uri: string,
509
+ terms: {
510
+ terms: ConsentFlowTerms;
511
+ expiresAt?: string;
512
+ oneTime?: boolean;
513
+ }
514
+ ) => Promise<boolean>;
515
+ withdrawConsent: (uri: string) => Promise<boolean>;
516
+ getConsentFlowTransactions: (
517
+ uri: string,
518
+ options?: Partial<PaginationOptionsType> & { query?: ConsentFlowTransactionsQuery }
519
+ ) => Promise<PaginatedConsentFlowTransactions>;
520
+ getHolderExportMetadata: () => Promise<HolderExportMetadata>;
521
+ getCredentialsForContract: (
522
+ termsUri: string,
523
+ options?: Partial<PaginationOptionsType> & { includeReceived?: boolean }
524
+ ) => Promise<PaginatedContractCredentials>;
525
+ getConsentFlowCredentials: (
526
+ options?: Partial<PaginationOptionsType> & { includeReceived?: boolean }
527
+ ) => Promise<PaginatedContractCredentials>;
528
+
529
+ verifyConsent: (uri: string, profileId: string) => Promise<boolean>;
530
+
531
+ syncCredentialsToContract: (
532
+ termsUri: string,
533
+ categories: Record<string, string[]>
534
+ ) => Promise<boolean>;
535
+
536
+ deleteCredentialFromAllContracts: (deletedUris: string[]) => Promise<{
537
+ contractsUpdated: number;
538
+ removedSharedUris: number;
539
+ }>;
540
+
541
+ sendAiInsightsContractRequest: (
542
+ contractUri: string,
543
+ targetProfileId: string,
544
+ shareLink: string
545
+ ) => Promise<boolean>;
546
+
547
+ sendAiInsightShareRequest: (
548
+ targetProfileId: string,
549
+ shareLink: string,
550
+ childProfileId?: string
551
+ ) => Promise<boolean>;
552
+
553
+ getContractSentRequests: (contractUri: string) => Promise<
554
+ {
555
+ profile: LCNProfile;
556
+ status: 'pending' | 'accepted' | 'denied' | null;
557
+ readStatus?: 'unseen' | 'seen' | null;
558
+ }[]
559
+ >;
560
+
561
+ getRequestStatusForProfile: (
562
+ targetProfileId: string,
563
+ contractId?: string | undefined,
564
+ contractUri?: string | undefined
565
+ ) => Promise<{
566
+ profile: LCNProfile;
567
+ status: 'pending' | 'accepted' | 'denied' | null;
568
+ readStatus?: 'unseen' | 'seen' | null;
569
+ } | null>;
570
+
571
+ getAllContractRequestsForProfile: (targetProfileId: string) => Promise<
572
+ {
573
+ contract: ConsentFlowContract & { uri: string };
574
+ profile: LCNProfile;
575
+ status: 'pending' | 'accepted' | 'denied' | null;
576
+ readStatus?: 'unseen' | 'seen' | null;
577
+ }[]
578
+ >;
579
+
580
+ getSharedInsightsRequestsForProfile: (targetProfileId: string) => Promise<
581
+ {
582
+ profile: LCNProfile;
583
+ status: 'pending' | 'accepted' | 'denied' | null;
584
+ readStatus?: 'unseen' | 'seen' | null;
585
+ }[]
586
+ >;
587
+
588
+ forwardContractRequestToProfile: (
589
+ parentProfileId: string,
590
+ targetProfileId: string,
591
+ contractUri?: string
592
+ ) => Promise<boolean>;
593
+
594
+ markContractRequestAsSeen: (contractUri: string, targetProfileId: string) => Promise<boolean>;
595
+ cancelContractRequest: (contractUri: string, targetProfileId: string) => Promise<boolean>;
596
+
597
+ addDidMetadata: (metadata: Partial<DidDocument>) => Promise<boolean>;
598
+ getDidMetadata: (id: string) => Promise<Partial<DidDocument> | undefined>;
599
+ getMyDidMetadata: () => Promise<Array<Partial<DidDocument> & { id: string }>>;
600
+ updateDidMetadata: (id: string, updates: Partial<DidDocument>) => Promise<boolean>;
601
+ deleteDidMetadata: (id: string) => Promise<boolean>;
602
+
603
+ createClaimHook: (hook: ClaimHook) => Promise<string>;
604
+ getClaimHooksForBoost: (
605
+ options: Partial<PaginationOptionsType> & { uri: string; query?: ClaimHookQuery }
606
+ ) => Promise<PaginatedClaimHooksType>;
607
+ deleteClaimHook: (id: string) => Promise<boolean>;
608
+
609
+ addAuthGrant: (authGrant: Partial<AuthGrantType>) => Promise<string>;
610
+ getAuthGrant: (id: string) => Promise<Partial<AuthGrantType> | undefined>;
611
+ getAuthGrants: (
612
+ options?: Partial<PaginationOptionsType> & { query?: AuthGrantQuery }
613
+ ) => Promise<Partial<AuthGrantType>[] | undefined>;
614
+ deleteAuthGrant: (id: string) => Promise<boolean>;
615
+ updateAuthGrant: (id: string, updates: Partial<AuthGrantType>) => Promise<boolean>;
616
+ revokeAuthGrant: (id: string) => Promise<boolean>;
617
+ getAPITokenForAuthGrant: (id: string) => Promise<string>;
618
+
619
+ sendCredentialViaInbox: (
620
+ issueInboxCredential: IssueInboxCredentialType
621
+ ) => Promise<IssueInboxCredentialResponseType>;
622
+ getMySentInboxCredentials: (
623
+ options?: Partial<PaginationOptionsType> & { query?: InboxCredentialQuery }
624
+ ) => Promise<PaginatedInboxCredentialsType>;
625
+
626
+ getInboxCredential: (id: string) => Promise<InboxCredentialType | null>;
627
+ finalizeInboxCredentials: () => Promise<{
628
+ processed: number;
629
+ claimed: number;
630
+ errors: number;
631
+ guardianPending: number;
632
+ verifiableCredentials: VC[];
633
+ }>;
634
+
635
+ // Guardian Approval
636
+ sendGuardianApprovalEmail: (options: {
637
+ guardianEmail: string;
638
+ ttlHours?: number;
639
+ template?: { id?: string; model?: Record<string, unknown> };
640
+ }) => Promise<{ message: string; approvalUrl: string }>;
641
+ approveGuardianRequest: (token: string) => Promise<{ message: string }>;
642
+ approveGuardianRequestByPath: (token: string) => Promise<{ message: string }>;
643
+ getGuardianPendingCredential: (token: string) => Promise<{
644
+ inboxCredentialId: string;
645
+ guardianStatus: string;
646
+ issuer: { displayName: string; profileId: string };
647
+ credentialName?: string;
648
+ createdAt: string;
649
+ expiresAt: string;
650
+ canApproveInApp: boolean;
651
+ }>;
652
+ sendGuardianChallenge: (token: string) => Promise<{ message: string }>;
653
+ approveGuardianCredential: (
654
+ token: string,
655
+ otpCode: string
656
+ ) => Promise<{ message: string; alreadyLinked: boolean }>;
657
+ rejectGuardianCredential: (token: string, otpCode: string) => Promise<{ message: string }>;
658
+ approveGuardianCredentialInApp: (inboxCredentialId: string) => Promise<{ success: boolean }>;
659
+ rejectGuardianCredentialInApp: (inboxCredentialId: string) => Promise<{ success: boolean }>;
660
+ addContactMethod: (
661
+ contactMethod: ContactMethodQueryType
662
+ ) => Promise<{ message: string; contactMethodId: string; verificationRequired: boolean }>;
663
+ getMyContactMethods: () => Promise<ContactMethodType[]>;
664
+
665
+ setPrimaryContactMethod: (contactMethodId: string) => Promise<{ message: string }>;
666
+ verifyContactMethod: (
667
+ token: string
668
+ ) => Promise<{ message: string; contactMethod: ContactMethodType }>;
669
+ verifyContactMethodWithCredential: (
670
+ proofOfLoginJwt: string
671
+ ) => Promise<{ message: string; contactMethod: ContactMethodType }>;
672
+ removeContactMethod: (contactMethodId: string) => Promise<{ message: string }>;
673
+
674
+ // Skills & Skill Frameworks
675
+ syncFrameworkSkills: (input: SyncFrameworkInput) => Promise<FrameworkWithSkills>;
676
+ listSkillTags: (frameworkId: string, skillId: string) => Promise<TagType[]>;
677
+ addSkillTag: (frameworkId: string, skillId: string, tag: AddTagInput) => Promise<TagType[]>;
678
+ removeSkillTag: (
679
+ frameworkId: string,
680
+ skillId: string,
681
+ slug: string
682
+ ) => Promise<{ success: boolean }>;
683
+
684
+ createManagedSkillFramework: (
685
+ input: CreateManagedSkillFrameworkInput
686
+ ) => Promise<SkillFrameworkType>;
687
+ createManagedSkillFrameworks: (
688
+ input: CreateManagedSkillFrameworkBatchInput
689
+ ) => Promise<SkillFrameworkType[]>;
690
+ createSkillFramework: (input: LinkProviderFrameworkInputType) => Promise<SkillFrameworkType>;
691
+ listMySkillFrameworks: () => Promise<SkillFrameworkType[]>;
692
+ getAllAvailableFrameworks: (options?: {
693
+ limit?: number;
694
+ cursor?: string | null;
695
+ query?: SkillFrameworkQuery;
696
+ }) => Promise<PaginatedSkillFrameworksType>;
697
+ getSkillFrameworkById: (
698
+ id: string,
699
+ options?: { limit?: number; childrenLimit?: number; cursor?: string | null }
700
+ ) => Promise<FrameworkWithSkills>;
701
+ getBoostsThatUseFramework: (
702
+ frameworkId: string,
703
+ options?: { limit?: number; cursor?: string | null; query?: BoostQuery }
704
+ ) => Promise<PaginatedBoostsType>;
705
+ countBoostsThatUseFramework: (
706
+ frameworkId: string,
707
+ options?: { query?: BoostQuery }
708
+ ) => Promise<{ count: number }>;
709
+ getFrameworkSkillTree: (
710
+ frameworkId: string,
711
+ options?: { rootsLimit?: number; childrenLimit?: number; cursor?: string | null }
712
+ ) => Promise<PaginatedSkillTree>;
713
+ getSkillChildren: (
714
+ frameworkId: string,
715
+ skillId: string,
716
+ options?: { limit?: number; cursor?: string | null }
717
+ ) => Promise<PaginatedSkillTree>;
718
+ searchFrameworkSkills: (
719
+ frameworkId: string,
720
+ query: SkillQuery,
721
+ options?: { limit?: number; cursor?: string | null }
722
+ ) => Promise<{ records: SkillType[]; hasMore: boolean; cursor: string | null }>;
723
+ semanticSearchSkills: (input: SkillSemanticSearchInput) => Promise<SkillSemanticSearchResult>;
724
+ updateSkillFramework: (input: UpdateSkillFrameworkInput) => Promise<SkillFrameworkType>;
725
+ deleteSkillFramework: (id: string) => Promise<{ success: boolean }>;
726
+ replaceSkillFrameworkSkills: (
727
+ input: ReplaceSkillFrameworkSkillsInput
728
+ ) => Promise<ReplaceSkillFrameworkSkillsResult>;
729
+ countSkills: (input: CountSkillsInput) => Promise<CountSkillsResult>;
730
+ getFullSkillTree: (input: GetFullSkillTreeInput) => Promise<GetFullSkillTreeResult>;
731
+ getSkillPath: (input: GetSkillPathInput) => Promise<GetSkillPathResult>;
732
+ getSkillFrameworkAdmins: (frameworkId: string) => Promise<LCNProfile[]>;
733
+ addSkillFrameworkAdmin: (
734
+ frameworkId: string,
735
+ profileId: string
736
+ ) => Promise<{ success: boolean }>;
737
+ removeSkillFrameworkAdmin: (
738
+ frameworkId: string,
739
+ profileId: string
740
+ ) => Promise<{ success: boolean }>;
741
+
742
+ getSkill: (frameworkId: string, skillId: string) => Promise<SkillType>;
743
+ createSkill: (input: CreateSkillInput) => Promise<SkillType>;
744
+ createSkills: (input: CreateSkillsBatchInput) => Promise<SkillType[]>;
745
+ updateSkill: (input: UpdateSkillInput) => Promise<SkillType>;
746
+ deleteSkill: (input: DeleteSkillInput) => Promise<{ success: boolean }>;
747
+
748
+ // Integrations
749
+ addIntegration: (integration: LCNIntegrationCreateType) => Promise<string>;
750
+ getIntegration: (id: string) => Promise<LCNIntegration | undefined>;
751
+ getIntegrations: (
752
+ options?: Partial<PaginationOptionsType> & { query?: LCNIntegrationQueryType }
753
+ ) => Promise<PaginatedLCNIntegrationsType>;
754
+ countIntegrations: (options?: { query?: LCNIntegrationQueryType }) => Promise<number>;
755
+ updateIntegration: (id: string, updates: LCNIntegrationUpdateType) => Promise<boolean>;
756
+ deleteIntegration: (id: string) => Promise<boolean>;
757
+ associateListingWithSigningAuthority: (
758
+ listingId: string,
759
+ endpoint: string,
760
+ name: string,
761
+ did: string,
762
+ isPrimary?: boolean
763
+ ) => Promise<boolean>;
764
+ getListingSigningAuthority: (listingId: string) => Promise<
765
+ | {
766
+ endpoint: string;
767
+ name: string;
768
+ did: string;
769
+ isPrimary: boolean;
770
+ }
771
+ | undefined
772
+ >;
773
+ getIntegrationForListing: (listingId: string) => Promise<LCNIntegration | undefined>;
774
+
775
+ // App Store
776
+ createAppStoreListing: (
777
+ integrationId: string,
778
+ listing: AppStoreListingCreateType
779
+ ) => Promise<string>;
780
+ getAppStoreListing: (listingId: string) => Promise<AppStoreListing | undefined>;
781
+ updateAppStoreListing: (
782
+ listingId: string,
783
+ updates: AppStoreListingUpdateType
784
+ ) => Promise<boolean>;
785
+ deleteAppStoreListing: (listingId: string) => Promise<boolean>;
786
+ submitAppStoreListingForReview: (listingId: string) => Promise<boolean>;
787
+ unsubmitAppStoreListing: (listingId: string) => Promise<boolean>;
788
+ getListingsForIntegration: (
789
+ integrationId: string,
790
+ options?: Partial<PaginationOptionsType>
791
+ ) => Promise<PaginatedAppStoreListings>;
792
+ countListingsForIntegration: (integrationId: string) => Promise<number>;
793
+
794
+ browseAppStore: (options?: {
795
+ limit?: number;
796
+ cursor?: string;
797
+ category?: string;
798
+ promotionLevel?: PromotionLevel;
799
+ }) => Promise<PaginatedAppStoreListings>;
800
+ getPublicAppStoreListing: (listingId: string) => Promise<AppStoreListing | undefined>;
801
+ getPublicAppStoreListingBySlug: (slug: string) => Promise<AppStoreListing | undefined>;
802
+ getAppStoreListingInstallCount: (listingId: string) => Promise<number>;
803
+
804
+ installApp: (listingId: string) => Promise<boolean>;
805
+ uninstallApp: (listingId: string) => Promise<boolean>;
806
+ getInstalledApps: (options?: Partial<PaginationOptionsType>) => Promise<PaginatedInstalledApps>;
807
+ countInstalledApps: () => Promise<number>;
808
+ isAppInstalled: (listingId: string) => Promise<boolean>;
809
+ getMyCredentialsFromApp: (
810
+ listingId: string,
811
+ options?: { limit?: number; cursor?: string }
812
+ ) => Promise<{
813
+ hasMore: boolean;
814
+ cursor?: string;
815
+ records: Array<{
816
+ credentialId: string;
817
+ credentialUri: string;
818
+ date: string;
819
+ status: 'pending' | 'claimed' | 'revoked' | 'suspended';
820
+ boostName?: string;
821
+ boostCategory?: string;
822
+ activityId?: string;
823
+ }>;
824
+ totalCount: number;
825
+ }>;
826
+
827
+ isAppStoreAdmin: () => Promise<boolean>;
828
+ adminUpdateListingStatus: (listingId: string, status: AppListingStatus) => Promise<boolean>;
829
+ adminUpdatePromotionLevel: (
830
+ listingId: string,
831
+ promotionLevel: PromotionLevel
832
+ ) => Promise<boolean>;
833
+ adminGetAllListings: (options?: {
834
+ limit?: number;
835
+ cursor?: string;
836
+ status?: AppListingStatus;
837
+ }) => Promise<PaginatedAppStoreListings>;
838
+
839
+ // App Store Boost Management
840
+ addBoostToApp: (listingId: string, boostUri: string, templateAlias: string) => Promise<boolean>;
841
+ associateBoostWithListing: (
842
+ listingId: string,
843
+ boostUri: string,
844
+ templateAlias: string
845
+ ) => Promise<boolean>;
846
+ removeBoostFromApp: (listingId: string, templateAlias: string) => Promise<boolean>;
847
+ getAppBoosts: (
848
+ listingId: string
849
+ ) => Promise<Array<{ templateAlias: string; boostUri: string }>>;
850
+
851
+ // App Events (discriminated union)
852
+ sendAppEvent: (listingId: string, event: AppEvent) => Promise<AppEventResponse>;
853
+
854
+ resolveFromLCN: (
855
+ uri: string
856
+ ) => Promise<VC | UnsignedVC | VP | JWE | ConsentFlowContract | ConsentFlowTerms>;
857
+
858
+ getLCNClient: () => LCNClient;
859
+
860
+ // Activity
861
+ getMyActivities: (options?: {
862
+ limit?: number;
863
+ cursor?: string;
864
+ boostUri?: string;
865
+ eventType?: CredentialActivityEventType;
866
+ integrationId?: string;
867
+ }) => Promise<PaginatedCredentialActivities>;
868
+
869
+ getActivityStats: (options?: {
870
+ boostUris?: string[];
871
+ integrationId?: string;
872
+ }) => Promise<CredentialActivityStats>;
873
+
874
+ getActivity: (options: { activityId: string }) => Promise<CredentialActivityRecord | null>;
875
+
876
+ getActivityChain: (options: { activityId: string }) => Promise<CredentialActivityRecord[]>;
877
+
878
+ // Federation
879
+
880
+ isServiceTrusted: (serviceDid: string) => Promise<boolean>;
881
+
882
+ getTrustedServices: () => Promise<
883
+ Array<{
884
+ did: string;
885
+ name: string;
886
+ endpoint: string;
887
+ }>
888
+ >;
889
+ };
890
+
891
+ /** @group LearnCardNetwork Plugin */
892
+ export type LearnCardNetworkPlugin = Plugin<
893
+ 'LearnCard Network',
894
+ 'id' | 'read' | 'store',
895
+ LearnCardNetworkPluginMethods,
896
+ 'id',
897
+ LearnCardNetworkPluginDependentMethods
898
+ >;
899
+
900
+ /** @group VerifyBoostPlugin Plugin */
901
+ export type VerifyBoostPlugin = Plugin<'VerifyBoost', any, VerifyExtension>;
902
+
903
+ /** @group VerifyBoostPlugin Plugin */
904
+ export type TrustedBoostRegistryEntry = {
905
+ id: string;
906
+ url: string;
907
+ did: string;
908
+ };