@learncard/lca-api-plugin 1.1.17 → 1.2.3
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/lca-api-plugin.cjs.development.js +112 -2
- package/dist/lca-api-plugin.cjs.development.js.map +2 -2
- package/dist/lca-api-plugin.cjs.production.min.js +5 -5
- package/dist/lca-api-plugin.cjs.production.min.js.map +3 -3
- package/dist/lca-api-plugin.esm.js +112 -2
- package/dist/lca-api-plugin.esm.js.map +2 -2
- package/dist/types.d.ts +148 -2
- package/package.json +6 -6
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { JWE, DidDocument, JWKWithPrivateKey, VP,
|
|
2
|
+
import { JWE, DidDocument, JWKWithPrivateKey, VP, LCNVisibleProfile } from '@learncard/types';
|
|
3
3
|
import { Plugin } from '@learncard/core';
|
|
4
4
|
import { ProofOptions } from '@learncard/didkit-plugin';
|
|
5
5
|
export type BoostSkills = {
|
|
@@ -122,6 +122,8 @@ export declare const NotificationQueryFiltersValidator: z.ZodObject<{
|
|
|
122
122
|
APP_LISTING_SUBMITTED: "APP_LISTING_SUBMITTED";
|
|
123
123
|
APP_LISTING_APPROVED: "APP_LISTING_APPROVED";
|
|
124
124
|
APP_LISTING_REJECTED: "APP_LISTING_REJECTED";
|
|
125
|
+
APP_LISTING_WITHDRAWN: "APP_LISTING_WITHDRAWN";
|
|
126
|
+
DEVICE_LINK_REQUEST: "DEVICE_LINK_REQUEST";
|
|
125
127
|
}>>;
|
|
126
128
|
}, z.core.$strip>;
|
|
127
129
|
/** @group LCA API Plugin */
|
|
@@ -164,6 +166,8 @@ export declare const NotificationValidator: z.ZodObject<{
|
|
|
164
166
|
APP_LISTING_SUBMITTED: "APP_LISTING_SUBMITTED";
|
|
165
167
|
APP_LISTING_APPROVED: "APP_LISTING_APPROVED";
|
|
166
168
|
APP_LISTING_REJECTED: "APP_LISTING_REJECTED";
|
|
169
|
+
APP_LISTING_WITHDRAWN: "APP_LISTING_WITHDRAWN";
|
|
170
|
+
DEVICE_LINK_REQUEST: "DEVICE_LINK_REQUEST";
|
|
167
171
|
}>;
|
|
168
172
|
to: z.ZodIntersection<z.ZodObject<{
|
|
169
173
|
profileId: z.ZodOptional<z.ZodString>;
|
|
@@ -172,6 +176,16 @@ export declare const NotificationValidator: z.ZodObject<{
|
|
|
172
176
|
bio: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
173
177
|
did: z.ZodOptional<z.ZodString>;
|
|
174
178
|
isPrivate: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
179
|
+
profileVisibility: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
180
|
+
public: "public";
|
|
181
|
+
connections_only: "connections_only";
|
|
182
|
+
private: "private";
|
|
183
|
+
}>>>>;
|
|
184
|
+
showEmail: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
185
|
+
allowConnectionRequests: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
186
|
+
anyone: "anyone";
|
|
187
|
+
invite_only: "invite_only";
|
|
188
|
+
}>>>>;
|
|
175
189
|
email: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
176
190
|
image: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
177
191
|
heroImage: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
@@ -207,6 +221,16 @@ export declare const NotificationValidator: z.ZodObject<{
|
|
|
207
221
|
bio: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
208
222
|
did: z.ZodOptional<z.ZodString>;
|
|
209
223
|
isPrivate: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
224
|
+
profileVisibility: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
225
|
+
public: "public";
|
|
226
|
+
connections_only: "connections_only";
|
|
227
|
+
private: "private";
|
|
228
|
+
}>>>>;
|
|
229
|
+
showEmail: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
230
|
+
allowConnectionRequests: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
231
|
+
anyone: "anyone";
|
|
232
|
+
invite_only: "invite_only";
|
|
233
|
+
}>>>>;
|
|
210
234
|
email: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
211
235
|
image: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
212
236
|
heroImage: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
@@ -334,6 +358,8 @@ export declare const PaginatedNotificationsValidator: z.ZodObject<{
|
|
|
334
358
|
APP_LISTING_SUBMITTED: "APP_LISTING_SUBMITTED";
|
|
335
359
|
APP_LISTING_APPROVED: "APP_LISTING_APPROVED";
|
|
336
360
|
APP_LISTING_REJECTED: "APP_LISTING_REJECTED";
|
|
361
|
+
APP_LISTING_WITHDRAWN: "APP_LISTING_WITHDRAWN";
|
|
362
|
+
DEVICE_LINK_REQUEST: "DEVICE_LINK_REQUEST";
|
|
337
363
|
}>;
|
|
338
364
|
to: z.ZodIntersection<z.ZodObject<{
|
|
339
365
|
profileId: z.ZodOptional<z.ZodString>;
|
|
@@ -342,6 +368,16 @@ export declare const PaginatedNotificationsValidator: z.ZodObject<{
|
|
|
342
368
|
bio: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
343
369
|
did: z.ZodOptional<z.ZodString>;
|
|
344
370
|
isPrivate: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
371
|
+
profileVisibility: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
372
|
+
public: "public";
|
|
373
|
+
connections_only: "connections_only";
|
|
374
|
+
private: "private";
|
|
375
|
+
}>>>>;
|
|
376
|
+
showEmail: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
377
|
+
allowConnectionRequests: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
378
|
+
anyone: "anyone";
|
|
379
|
+
invite_only: "invite_only";
|
|
380
|
+
}>>>>;
|
|
345
381
|
email: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
346
382
|
image: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
347
383
|
heroImage: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
@@ -377,6 +413,16 @@ export declare const PaginatedNotificationsValidator: z.ZodObject<{
|
|
|
377
413
|
bio: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
378
414
|
did: z.ZodOptional<z.ZodString>;
|
|
379
415
|
isPrivate: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
416
|
+
profileVisibility: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
417
|
+
public: "public";
|
|
418
|
+
connections_only: "connections_only";
|
|
419
|
+
private: "private";
|
|
420
|
+
}>>>>;
|
|
421
|
+
showEmail: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
|
|
422
|
+
allowConnectionRequests: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
423
|
+
anyone: "anyone";
|
|
424
|
+
invite_only: "invite_only";
|
|
425
|
+
}>>>>;
|
|
380
426
|
email: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
381
427
|
image: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
382
428
|
heroImage: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
@@ -502,6 +548,8 @@ export declare const NotificationQueryInputValidator: z.ZodObject<{
|
|
|
502
548
|
APP_LISTING_SUBMITTED: "APP_LISTING_SUBMITTED";
|
|
503
549
|
APP_LISTING_APPROVED: "APP_LISTING_APPROVED";
|
|
504
550
|
APP_LISTING_REJECTED: "APP_LISTING_REJECTED";
|
|
551
|
+
APP_LISTING_WITHDRAWN: "APP_LISTING_WITHDRAWN";
|
|
552
|
+
DEVICE_LINK_REQUEST: "DEVICE_LINK_REQUEST";
|
|
505
553
|
}>>;
|
|
506
554
|
'from.did': z.ZodOptional<z.ZodString>;
|
|
507
555
|
'from.profileId': z.ZodOptional<z.ZodString>;
|
|
@@ -518,10 +566,91 @@ export declare const NotificationQueryInputValidator: z.ZodObject<{
|
|
|
518
566
|
/** @group LCA API Plugin */
|
|
519
567
|
export type NotificationQueryInputType = z.infer<typeof NotificationQueryInputValidator>;
|
|
520
568
|
/** END Synced Types**/
|
|
569
|
+
/** @group LCA API Plugin - SSS Key Management */
|
|
570
|
+
export declare const AuthProviderTypeValidator: z.ZodEnum<{
|
|
571
|
+
firebase: "firebase";
|
|
572
|
+
supertokens: "supertokens";
|
|
573
|
+
keycloak: "keycloak";
|
|
574
|
+
oidc: "oidc";
|
|
575
|
+
}>;
|
|
576
|
+
export type AuthProviderType = z.infer<typeof AuthProviderTypeValidator>;
|
|
577
|
+
export declare const ServerEncryptedShareValidator: z.ZodObject<{
|
|
578
|
+
encryptedData: z.ZodString;
|
|
579
|
+
encryptedDek: z.ZodString;
|
|
580
|
+
iv: z.ZodString;
|
|
581
|
+
}, z.core.$strip>;
|
|
582
|
+
export type ServerEncryptedShare = z.infer<typeof ServerEncryptedShareValidator>;
|
|
583
|
+
export declare const EncryptedShareValidator: z.ZodObject<{
|
|
584
|
+
encryptedData: z.ZodString;
|
|
585
|
+
iv: z.ZodString;
|
|
586
|
+
salt: z.ZodOptional<z.ZodString>;
|
|
587
|
+
}, z.core.$strip>;
|
|
588
|
+
export type EncryptedShare = z.infer<typeof EncryptedShareValidator>;
|
|
589
|
+
export declare const RecoveryMethodTypeValidator: z.ZodEnum<{
|
|
590
|
+
email: "email";
|
|
591
|
+
passkey: "passkey";
|
|
592
|
+
backup: "backup";
|
|
593
|
+
phrase: "phrase";
|
|
594
|
+
}>;
|
|
595
|
+
export type RecoveryMethodType = z.infer<typeof RecoveryMethodTypeValidator>;
|
|
596
|
+
export declare const SecurityLevelValidator: z.ZodEnum<{
|
|
597
|
+
basic: "basic";
|
|
598
|
+
enhanced: "enhanced";
|
|
599
|
+
advanced: "advanced";
|
|
600
|
+
}>;
|
|
601
|
+
export type SecurityLevel = z.infer<typeof SecurityLevelValidator>;
|
|
602
|
+
export declare const KeyProviderValidator: z.ZodEnum<{
|
|
603
|
+
web3auth: "web3auth";
|
|
604
|
+
sss: "sss";
|
|
605
|
+
}>;
|
|
606
|
+
export type KeyProvider = z.infer<typeof KeyProviderValidator>;
|
|
607
|
+
export declare const RecoveryMethodInfoValidator: z.ZodObject<{
|
|
608
|
+
type: z.ZodEnum<{
|
|
609
|
+
email: "email";
|
|
610
|
+
passkey: "passkey";
|
|
611
|
+
backup: "backup";
|
|
612
|
+
phrase: "phrase";
|
|
613
|
+
}>;
|
|
614
|
+
createdAt: z.ZodString;
|
|
615
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
616
|
+
shareVersion: z.ZodOptional<z.ZodNumber>;
|
|
617
|
+
}, z.core.$strip>;
|
|
618
|
+
export type RecoveryMethodInfo = z.infer<typeof RecoveryMethodInfoValidator>;
|
|
619
|
+
export declare const GetAuthShareResponseValidator: z.ZodNullable<z.ZodObject<{
|
|
620
|
+
authShare: z.ZodNullable<z.ZodObject<{
|
|
621
|
+
encryptedData: z.ZodString;
|
|
622
|
+
encryptedDek: z.ZodString;
|
|
623
|
+
iv: z.ZodString;
|
|
624
|
+
}, z.core.$strip>>;
|
|
625
|
+
primaryDid: z.ZodNullable<z.ZodString>;
|
|
626
|
+
securityLevel: z.ZodEnum<{
|
|
627
|
+
basic: "basic";
|
|
628
|
+
enhanced: "enhanced";
|
|
629
|
+
advanced: "advanced";
|
|
630
|
+
}>;
|
|
631
|
+
recoveryMethods: z.ZodArray<z.ZodObject<{
|
|
632
|
+
type: z.ZodEnum<{
|
|
633
|
+
email: "email";
|
|
634
|
+
passkey: "passkey";
|
|
635
|
+
backup: "backup";
|
|
636
|
+
phrase: "phrase";
|
|
637
|
+
}>;
|
|
638
|
+
createdAt: z.ZodString;
|
|
639
|
+
credentialId: z.ZodOptional<z.ZodString>;
|
|
640
|
+
shareVersion: z.ZodOptional<z.ZodNumber>;
|
|
641
|
+
}, z.core.$strip>>;
|
|
642
|
+
keyProvider: z.ZodEnum<{
|
|
643
|
+
web3auth: "web3auth";
|
|
644
|
+
sss: "sss";
|
|
645
|
+
}>;
|
|
646
|
+
shareVersion: z.ZodNumber;
|
|
647
|
+
maskedRecoveryEmail: z.ZodNullable<z.ZodString>;
|
|
648
|
+
}, z.core.$strip>>;
|
|
649
|
+
export type GetAuthShareResponse = z.infer<typeof GetAuthShareResponseValidator>;
|
|
521
650
|
/** @group LCA API Plugin */
|
|
522
651
|
export type LCAPluginDependentMethods = {
|
|
523
652
|
getDidAuthVp: (options?: ProofOptions) => Promise<VP | string>;
|
|
524
|
-
getProfile: () => Promise<
|
|
653
|
+
getProfile: () => Promise<LCNVisibleProfile | undefined>;
|
|
525
654
|
generateEd25519KeyFromBytes: (bytes: Uint8Array) => JWKWithPrivateKey;
|
|
526
655
|
keyToDid: (type: 'key', keypair: JWKWithPrivateKey) => string;
|
|
527
656
|
resolveDid: (did: string) => Promise<DidDocument>;
|
|
@@ -610,6 +739,23 @@ export type LCAPluginMethods = {
|
|
|
610
739
|
}, credential: {
|
|
611
740
|
name: string;
|
|
612
741
|
}, message: string) => Promise<boolean>;
|
|
742
|
+
getAuthShare: (authToken: string, providerType: AuthProviderType) => Promise<GetAuthShareResponse>;
|
|
743
|
+
storeAuthShare: (authToken: string, providerType: AuthProviderType, authShare: ServerEncryptedShare, primaryDid: string, securityLevel?: SecurityLevel) => Promise<{
|
|
744
|
+
success: boolean;
|
|
745
|
+
}>;
|
|
746
|
+
addRecoveryMethod: (authToken: string, providerType: AuthProviderType, type: RecoveryMethodType, encryptedShare?: EncryptedShare, credentialId?: string) => Promise<{
|
|
747
|
+
success: boolean;
|
|
748
|
+
}>;
|
|
749
|
+
getRecoveryShare: (authToken: string, providerType: AuthProviderType, type: RecoveryMethodType, credentialId?: string) => Promise<{
|
|
750
|
+
encryptedShare?: EncryptedShare;
|
|
751
|
+
shareVersion?: number;
|
|
752
|
+
} | null>;
|
|
753
|
+
markMigrated: (authToken: string, providerType: AuthProviderType) => Promise<{
|
|
754
|
+
success: boolean;
|
|
755
|
+
}>;
|
|
756
|
+
deleteUserKey: (authToken: string, providerType: AuthProviderType) => Promise<{
|
|
757
|
+
success: boolean;
|
|
758
|
+
}>;
|
|
613
759
|
};
|
|
614
760
|
/** @group LearnCardNetwork Plugin */
|
|
615
761
|
export type LCAPlugin = Plugin<'LearnCard App', never, LCAPluginMethods, 'id', LCAPluginDependentMethods>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@learncard/lca-api-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/lca-api-plugin.esm.js",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"isomorphic-fetch": "^3.0.0",
|
|
36
36
|
"isomorphic-webcrypto": "^2.3.8",
|
|
37
37
|
"pbkdf2-hmac": "^1.2.1",
|
|
38
|
-
"@learncard/core": "9.4.
|
|
39
|
-
"@learncard/didkit-plugin": "1.
|
|
40
|
-
"@learncard/init": "2.3.
|
|
41
|
-
"@learncard/types": "5.
|
|
42
|
-
"@learncard/lca-api-client": "1.
|
|
38
|
+
"@learncard/core": "9.4.13",
|
|
39
|
+
"@learncard/didkit-plugin": "1.8.3",
|
|
40
|
+
"@learncard/init": "2.3.11",
|
|
41
|
+
"@learncard/types": "5.13.3",
|
|
42
|
+
"@learncard/lca-api-client": "1.2.0"
|
|
43
43
|
},
|
|
44
44
|
"sideEffects": false,
|
|
45
45
|
"scripts": {
|