@learncard/lca-api-plugin 1.2.21 → 1.2.22
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.cjs +12 -7
- package/dist/lca-api-plugin.cjs.development.cjs.map +2 -2
- package/dist/lca-api-plugin.cjs.production.min.cjs +1 -1
- package/dist/lca-api-plugin.cjs.production.min.cjs.map +3 -3
- package/dist/lca-api-plugin.esm.js +12 -7
- package/dist/lca-api-plugin.esm.js.map +2 -2
- package/dist/types.d.ts +17 -1
- package/package.json +5 -5
- package/src/plugin.ts +11 -6
- package/src/types.ts +4 -1
package/dist/types.d.ts
CHANGED
|
@@ -137,6 +137,9 @@ export declare const NotificationQueryFiltersValidator: z.ZodObject<{
|
|
|
137
137
|
DEVICE_LINK_REQUEST: "DEVICE_LINK_REQUEST";
|
|
138
138
|
GUARDIAN_APPROVAL_PENDING: "GUARDIAN_APPROVAL_PENDING";
|
|
139
139
|
APP_NOTIFICATION: "APP_NOTIFICATION";
|
|
140
|
+
CREDENTIAL_REVOKED: "CREDENTIAL_REVOKED";
|
|
141
|
+
CREDENTIAL_SUSPENDED: "CREDENTIAL_SUSPENDED";
|
|
142
|
+
CREDENTIAL_UNSUSPENDED: "CREDENTIAL_UNSUSPENDED";
|
|
140
143
|
}>>;
|
|
141
144
|
}, z.core.$strip>;
|
|
142
145
|
/** @group LCA API Plugin */
|
|
@@ -185,6 +188,9 @@ export declare const NotificationValidator: z.ZodObject<{
|
|
|
185
188
|
DEVICE_LINK_REQUEST: "DEVICE_LINK_REQUEST";
|
|
186
189
|
GUARDIAN_APPROVAL_PENDING: "GUARDIAN_APPROVAL_PENDING";
|
|
187
190
|
APP_NOTIFICATION: "APP_NOTIFICATION";
|
|
191
|
+
CREDENTIAL_REVOKED: "CREDENTIAL_REVOKED";
|
|
192
|
+
CREDENTIAL_SUSPENDED: "CREDENTIAL_SUSPENDED";
|
|
193
|
+
CREDENTIAL_UNSUSPENDED: "CREDENTIAL_UNSUSPENDED";
|
|
188
194
|
}>;
|
|
189
195
|
to: z.ZodIntersection<z.ZodObject<{
|
|
190
196
|
profileId: z.ZodOptional<z.ZodString>;
|
|
@@ -227,6 +233,7 @@ export declare const NotificationValidator: z.ZodObject<{
|
|
|
227
233
|
role: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodString>>>;
|
|
228
234
|
dob: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodString>>>;
|
|
229
235
|
country: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
236
|
+
locale: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
230
237
|
approved: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
231
238
|
}, z.core.$strip>, z.ZodObject<{
|
|
232
239
|
did: z.ZodString;
|
|
@@ -272,6 +279,7 @@ export declare const NotificationValidator: z.ZodObject<{
|
|
|
272
279
|
role: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodString>>>;
|
|
273
280
|
dob: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodString>>>;
|
|
274
281
|
country: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
282
|
+
locale: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
275
283
|
approved: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
276
284
|
}, z.core.$strip>, z.ZodObject<{
|
|
277
285
|
did: z.ZodString;
|
|
@@ -381,6 +389,9 @@ export declare const PaginatedNotificationsValidator: z.ZodObject<{
|
|
|
381
389
|
DEVICE_LINK_REQUEST: "DEVICE_LINK_REQUEST";
|
|
382
390
|
GUARDIAN_APPROVAL_PENDING: "GUARDIAN_APPROVAL_PENDING";
|
|
383
391
|
APP_NOTIFICATION: "APP_NOTIFICATION";
|
|
392
|
+
CREDENTIAL_REVOKED: "CREDENTIAL_REVOKED";
|
|
393
|
+
CREDENTIAL_SUSPENDED: "CREDENTIAL_SUSPENDED";
|
|
394
|
+
CREDENTIAL_UNSUSPENDED: "CREDENTIAL_UNSUSPENDED";
|
|
384
395
|
}>;
|
|
385
396
|
to: z.ZodIntersection<z.ZodObject<{
|
|
386
397
|
profileId: z.ZodOptional<z.ZodString>;
|
|
@@ -423,6 +434,7 @@ export declare const PaginatedNotificationsValidator: z.ZodObject<{
|
|
|
423
434
|
role: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodString>>>;
|
|
424
435
|
dob: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodString>>>;
|
|
425
436
|
country: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
437
|
+
locale: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
426
438
|
approved: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
427
439
|
}, z.core.$strip>, z.ZodObject<{
|
|
428
440
|
did: z.ZodString;
|
|
@@ -468,6 +480,7 @@ export declare const PaginatedNotificationsValidator: z.ZodObject<{
|
|
|
468
480
|
role: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodString>>>;
|
|
469
481
|
dob: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodString>>>;
|
|
470
482
|
country: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
483
|
+
locale: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
471
484
|
approved: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
472
485
|
}, z.core.$strip>, z.ZodObject<{
|
|
473
486
|
did: z.ZodString;
|
|
@@ -575,6 +588,9 @@ export declare const NotificationQueryInputValidator: z.ZodObject<{
|
|
|
575
588
|
DEVICE_LINK_REQUEST: "DEVICE_LINK_REQUEST";
|
|
576
589
|
GUARDIAN_APPROVAL_PENDING: "GUARDIAN_APPROVAL_PENDING";
|
|
577
590
|
APP_NOTIFICATION: "APP_NOTIFICATION";
|
|
591
|
+
CREDENTIAL_REVOKED: "CREDENTIAL_REVOKED";
|
|
592
|
+
CREDENTIAL_SUSPENDED: "CREDENTIAL_SUSPENDED";
|
|
593
|
+
CREDENTIAL_UNSUSPENDED: "CREDENTIAL_UNSUSPENDED";
|
|
578
594
|
}>>;
|
|
579
595
|
'from.did': z.ZodOptional<z.ZodString>;
|
|
580
596
|
'from.profileId': z.ZodOptional<z.ZodString>;
|
|
@@ -738,7 +754,7 @@ export type LCAPluginMethods = {
|
|
|
738
754
|
getFirebaseUserByEmail: (email: string) => Promise<UserRecordType | null>;
|
|
739
755
|
authenticateWithKeycloak: (token: string) => Promise<FirebaseCustomAuthResponse>;
|
|
740
756
|
authenticateWithScoutsSSO: (username: string, password: string) => Promise<ScoutSSOResponseType | null>;
|
|
741
|
-
sendLoginVerificationCode: (email: string) => Promise<{
|
|
757
|
+
sendLoginVerificationCode: (email: string, locale?: string) => Promise<{
|
|
742
758
|
success: boolean;
|
|
743
759
|
message?: string;
|
|
744
760
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@learncard/lca-api-plugin",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
},
|
|
53
53
|
"types": "./dist/index.d.ts",
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@learncard/core": "9.4.
|
|
56
|
-
"@learncard/didkit-plugin": "1.9.
|
|
57
|
-
"@learncard/init": "2.4.
|
|
55
|
+
"@learncard/core": "9.4.28",
|
|
56
|
+
"@learncard/didkit-plugin": "1.9.8",
|
|
57
|
+
"@learncard/init": "2.4.9",
|
|
58
58
|
"@learncard/lca-api-client": "1.2.3",
|
|
59
|
-
"@learncard/types": "5.
|
|
59
|
+
"@learncard/types": "5.18.0",
|
|
60
60
|
"hex-lite": "^1.5.0",
|
|
61
61
|
"isomorphic-fetch": "^3.0.0",
|
|
62
62
|
"isomorphic-webcrypto": "^2.3.8",
|
package/src/plugin.ts
CHANGED
|
@@ -14,13 +14,17 @@ const getNewClient = async (
|
|
|
14
14
|
learnCard: LearnCard<any, 'id', LCAPluginDependentMethods>,
|
|
15
15
|
extraHeaders?: Record<string, string>
|
|
16
16
|
) => {
|
|
17
|
-
return getClient(
|
|
18
|
-
|
|
17
|
+
return getClient(
|
|
18
|
+
url,
|
|
19
|
+
async challenge => {
|
|
20
|
+
const jwt = await learnCard.invoke.getDidAuthVp({ proofFormat: 'jwt', challenge });
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
if (typeof jwt !== 'string') throw new Error('Error getting DID-Auth-JWT!');
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
return jwt;
|
|
25
|
+
},
|
|
26
|
+
extraHeaders
|
|
27
|
+
);
|
|
24
28
|
};
|
|
25
29
|
|
|
26
30
|
const getEncryptionJwk = async (
|
|
@@ -373,12 +377,13 @@ export const getLCAPlugin = async (
|
|
|
373
377
|
|
|
374
378
|
return result || null;
|
|
375
379
|
},
|
|
376
|
-
sendLoginVerificationCode: async (_learnCard, email) => {
|
|
380
|
+
sendLoginVerificationCode: async (_learnCard, email, locale) => {
|
|
377
381
|
await initialized;
|
|
378
382
|
await updateLearnCard(_learnCard);
|
|
379
383
|
|
|
380
384
|
const result = await client.firebase.sendLoginVerificationCode.mutate({
|
|
381
385
|
email,
|
|
386
|
+
locale,
|
|
382
387
|
});
|
|
383
388
|
|
|
384
389
|
return result;
|
package/src/types.ts
CHANGED
|
@@ -320,7 +320,10 @@ export type LCAPluginMethods = {
|
|
|
320
320
|
username: string,
|
|
321
321
|
password: string
|
|
322
322
|
) => Promise<ScoutSSOResponseType | null>;
|
|
323
|
-
sendLoginVerificationCode: (
|
|
323
|
+
sendLoginVerificationCode: (
|
|
324
|
+
email: string,
|
|
325
|
+
locale?: string
|
|
326
|
+
) => Promise<{ success: boolean; message?: string }>;
|
|
324
327
|
verifyLoginCode: (
|
|
325
328
|
email: string,
|
|
326
329
|
code: string
|