@@ -202,7 +202,7 @@ export interface MultiValueCollectorWithValue<T extends MultiValueCollectorTypes
202202 key : string ;
203203 value : string [ ] ;
204204 type : string ;
205- validation ? : ValidationRequired [ ] ;
205+ validation : ValidationRequired [ ] | null ;
206206 } ;
207207 output : {
208208 key : string ;
@@ -223,7 +223,7 @@ export interface MultiValueCollectorNoValue<T extends MultiValueCollectorTypes>
223223 key : string ;
224224 value : string [ ] ;
225225 type : string ;
226- validation ? : ValidationRequired [ ] ;
226+ validation : ValidationRequired [ ] | null ;
227227 } ;
228228 output : {
229229 key : string ;
@@ -302,6 +302,14 @@ export interface PhoneNumberOutputValue {
302302 phoneNumber ?: string ;
303303}
304304
305+ export interface Fido2RegistrationInputValue {
306+ attestationValue ?: PublicKeyCredential ;
307+ }
308+
309+ export interface Fido2AuthenticationInputValue {
310+ assertionValue ?: PublicKeyCredential ;
311+ }
312+
305313export interface ObjectOptionsCollectorWithStringValue <
306314 T extends ObjectValueCollectorTypes ,
307315 V = string ,
@@ -315,7 +323,7 @@ export interface ObjectOptionsCollectorWithStringValue<
315323 key : string ;
316324 value : V ;
317325 type : string ;
318- validation ? : ValidationRequired [ ] ;
326+ validation : ValidationRequired [ ] | null ;
319327 } ;
320328 output : {
321329 key : string ;
@@ -339,7 +347,7 @@ export interface ObjectOptionsCollectorWithObjectValue<
339347 key : string ;
340348 value : V ;
341349 type : string ;
342- validation ? : ValidationRequired [ ] ;
350+ validation : ValidationRequired [ ] | null ;
343351 } ;
344352 output : {
345353 key : string ;
@@ -364,7 +372,7 @@ export interface ObjectValueCollectorWithObjectValue<
364372 key : string ;
365373 value : IV ;
366374 type : string ;
367- validation ? : ( ValidationRequired | ValidationPhoneNumber ) [ ] ;
375+ validation : ( ValidationRequired | ValidationPhoneNumber ) [ ] | null ;
368376 } ;
369377 output : {
370378 key : string ;
@@ -536,13 +544,18 @@ export type UnknownCollector = {
536544 * @interface AutoCollector - Represents a collector that collects a value programmatically without user intervention.
537545 */
538546
539- export type AutoCollectorCategories = 'SingleValueAutoCollector' ;
540- export type AutoCollectorTypes = AutoCollectorCategories | 'ProtectCollector' ;
547+ export type AutoCollectorCategories = 'SingleValueAutoCollector' | 'ObjectValueAutoCollector' ;
548+ export type SingleValueAutoCollectorTypes = 'SingleValueAutoCollector' | 'ProtectCollector' ;
549+ export type ObjectValueAutoCollectorTypes =
550+ | 'ObjectValueAutoCollector'
551+ | 'Fido2RegistrationCollector'
552+ | 'Fido2AuthenticationCollector' ;
553+ export type AutoCollectorTypes = SingleValueAutoCollectorTypes | ObjectValueAutoCollectorTypes ;
541554
542555export interface AutoCollector <
543556 C extends AutoCollectorCategories ,
544557 T extends AutoCollectorTypes ,
545- V = string ,
558+ IV = string ,
546559> {
547560 category : C ;
548561 error : string | null ;
@@ -551,8 +564,9 @@ export interface AutoCollector<
551564 name : string ;
552565 input : {
553566 key : string ;
554- value : V ;
567+ value : IV ;
555568 type : string ;
569+ validation ?: ValidationRequired [ ] | null ;
556570 } ;
557571 output : {
558572 key : string ;
@@ -566,13 +580,33 @@ export type ProtectCollector = AutoCollector<
566580 'ProtectCollector' ,
567581 string
568582> ;
583+ export type Fido2RegistrationCollector = AutoCollector <
584+ 'ObjectValueAutoCollector' ,
585+ 'Fido2RegistrationCollector' ,
586+ Fido2RegistrationInputValue
587+ > ;
588+ export type Fido2AuthenticationCollector = AutoCollector <
589+ 'ObjectValueAutoCollector' ,
590+ 'Fido2AuthenticationCollector' ,
591+ Fido2AuthenticationInputValue
592+ > ;
569593export type SingleValueAutoCollector = AutoCollector <
570594 'SingleValueAutoCollector' ,
571595 'SingleValueAutoCollector' ,
572596 string
573597> ;
598+ export type ObjectValueAutoCollector = AutoCollector <
599+ 'ObjectValueAutoCollector' ,
600+ 'ObjectValueAutoCollector' ,
601+ Record < string , unknown >
602+ > ;
574603
575- export type AutoCollectors = ProtectCollector | SingleValueAutoCollector ;
604+ export type AutoCollectors =
605+ | ProtectCollector
606+ | Fido2RegistrationCollector
607+ | Fido2AuthenticationCollector
608+ | SingleValueAutoCollector
609+ | ObjectValueAutoCollector ;
576610
577611/**
578612 * Type to help infer the collector based on the collector type
@@ -583,8 +617,14 @@ export type AutoCollectors = ProtectCollector | SingleValueAutoCollector;
583617 */
584618export type InferAutoCollectorType < T extends AutoCollectorTypes > = T extends 'ProtectCollector'
585619 ? ProtectCollector
586- : /**
587- * At this point, we have not passed in a collector type
588- * so we can return a SingleValueAutoCollector
589- **/
590- SingleValueAutoCollector ;
620+ : T extends 'Fido2RegistrationCollector'
621+ ? Fido2RegistrationCollector
622+ : T extends 'Fido2AuthenticationCollector'
623+ ? Fido2AuthenticationCollector
624+ : T extends 'ObjectValueAutoCollector'
625+ ? ObjectValueAutoCollector
626+ : /**
627+ * At this point, we have not passed in a collector type
628+ * so we can return a SingleValueAutoCollector
629+ **/
630+ SingleValueAutoCollector ;
0 commit comments