55 * of the MIT license. See the LICENSE file for details.
66 */
77
8+ import type { FidoAuthenticationOptions , FidoRegistrationOptions } from './davinci.types.js' ;
9+
810/** *********************************************************************
911 * SINGLE-VALUE COLLECTORS
1012 */
@@ -302,14 +304,6 @@ export interface PhoneNumberOutputValue {
302304 phoneNumber ?: string ;
303305}
304306
305- export interface FidoRegistrationInputValue {
306- attestationValue ?: PublicKeyCredential ;
307- }
308-
309- export interface FidoAuthenticationInputValue {
310- assertionValue ?: PublicKeyCredential ;
311- }
312-
313307export interface ObjectOptionsCollectorWithStringValue <
314308 T extends ObjectValueCollectorTypes ,
315309 V = string ,
@@ -544,6 +538,51 @@ export type UnknownCollector = {
544538 * @interface AutoCollector - Represents a collector that collects a value programmatically without user intervention.
545539 */
546540
541+ export interface ProtectOutputValue {
542+ behavioralDataCollection : boolean ;
543+ universalDeviceIdentification : boolean ;
544+ }
545+
546+ export interface AttestationValue
547+ extends Omit < PublicKeyCredential , 'rawId' | 'response' | 'getClientExtensionResults' | 'toJSON' > {
548+ rawId : string ;
549+ response : {
550+ // https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAttestationResponse
551+ clientDataJSON : string ;
552+ attestationObject : string ;
553+ } ;
554+ }
555+ export interface FidoRegistrationInputValue {
556+ attestationValue ?: AttestationValue ;
557+ }
558+
559+ export interface FidoRegistrationOutputValue {
560+ publicKeyCredentialCreationOptions : FidoRegistrationOptions ;
561+ action : 'REGISTER' ;
562+ trigger : string ;
563+ }
564+
565+ export interface AssertionValue
566+ extends Omit < PublicKeyCredential , 'rawId' | 'response' | 'getClientExtensionResults' | 'toJSON' > {
567+ rawId : string ;
568+ response : {
569+ // https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAssertionResponse
570+ clientDataJSON : string ;
571+ authenticatorData : string ;
572+ signature : string ;
573+ userHandle : string | null ;
574+ } ;
575+ }
576+ export interface FidoAuthenticationInputValue {
577+ assertionValue ?: AssertionValue ;
578+ }
579+
580+ export interface FidoAuthenticationOutputValue {
581+ publicKeyCredentialRequestOptions : FidoAuthenticationOptions ;
582+ action : 'AUTHENTICATE' ;
583+ trigger : string ;
584+ }
585+
547586export type AutoCollectorCategories = 'SingleValueAutoCollector' | 'ObjectValueAutoCollector' ;
548587export type SingleValueAutoCollectorTypes = 'SingleValueAutoCollector' | 'ProtectCollector' ;
549588export type ObjectValueAutoCollectorTypes =
@@ -556,6 +595,7 @@ export interface AutoCollector<
556595 C extends AutoCollectorCategories ,
557596 T extends AutoCollectorTypes ,
558597 IV = string ,
598+ OV = Record < string , unknown > ,
559599> {
560600 category : C ;
561601 error : string | null ;
@@ -571,24 +611,27 @@ export interface AutoCollector<
571611 output : {
572612 key : string ;
573613 type : string ;
574- config : Record < string , unknown > ;
614+ config : OV ;
575615 } ;
576616}
577617
578618export type ProtectCollector = AutoCollector <
579619 'SingleValueAutoCollector' ,
580620 'ProtectCollector' ,
581- string
621+ string ,
622+ ProtectOutputValue
582623> ;
583624export type FidoRegistrationCollector = AutoCollector <
584625 'ObjectValueAutoCollector' ,
585626 'FidoRegistrationCollector' ,
586- FidoRegistrationInputValue
627+ FidoRegistrationInputValue ,
628+ FidoRegistrationOutputValue
587629> ;
588630export type FidoAuthenticationCollector = AutoCollector <
589631 'ObjectValueAutoCollector' ,
590632 'FidoAuthenticationCollector' ,
591- FidoAuthenticationInputValue
633+ FidoAuthenticationInputValue ,
634+ FidoAuthenticationOutputValue
592635> ;
593636export type SingleValueAutoCollector = AutoCollector <
594637 'SingleValueAutoCollector' ,
0 commit comments