diff --git a/lib/Commands.ml b/lib/Commands.ml index e18a891..44fd17b 100644 --- a/lib/Commands.ml +++ b/lib/Commands.ml @@ -12722,6 +12722,83 @@ module DeviceOrientation = struct [@@ocaml.doc {desc|Overrides the Device Orientation. |desc}] end +module DigitalCredentials = struct + module SetVirtualWalletBehavior = struct + module Response : sig + type result = Types.assoc + type error = { code : int; message : string } + + type t = { + id : int; + error : error option; + sessionId : Types.Target.SessionID.t option; + result : result option; + } + + val parse : string -> t + end = struct + type result = Types.assoc [@@deriving yojson] + type error = { code : int; message : string } [@@deriving yojson] + + type t = { + id : int; + error : error option; [@yojson.option] + sessionId : Types.Target.SessionID.t option; [@yojson.option] + result : result option; [@yojson.option] + } + [@@deriving yojson] + + let parse response = response |> Yojson.Safe.from_string |> t_of_yojson + end + + module Params = struct + type t = { + behavior : Types.DigitalCredentials.VirtualWalletBehavior.t; + [@key "behavior"] [@ocaml.doc "The behavior of the virtual wallet."] + protocol : string option; + [@key "protocol"] + [@yojson.option] + [@ocaml.doc + "The protocol identifier (e.g. \"openid4vp\"). Required when \ + |behavior| is\n\ + \"respond\", forbidden otherwise."] + response : Types.assoc option; + [@key "response"] + [@yojson.option] + [@ocaml.doc + "The response data object returned by the wallet.\n\ + Required when |behavior| is \"respond\", forbidden otherwise."] + } + [@@deriving yojson] + + let make ~behavior ?protocol ?response () = + { behavior; protocol; response } + end + + module Request = struct + type t = { + id : int; + sessionId : Types.Target.SessionID.t option; [@yojson.option] + method_ : string; [@key "method"] + params : Params.t; + } + [@@deriving yojson] + + let make ?sessionId ~params id = + { + id; + method_ = "DigitalCredentials.setVirtualWalletBehavior"; + sessionId; + params; + } + |> yojson_of_t |> Yojson.Safe.to_string + end + end + [@@ocaml.doc + {desc|Sets the behavior of the virtual wallet for digital credential requests +issued from this frame. |desc}] +end + module Emulation = struct module CanEmulate = struct module Response : sig diff --git a/lib/Types.ml b/lib/Types.ml index 599d221..6413b0a 100644 --- a/lib/Types.ml +++ b/lib/Types.ml @@ -15433,6 +15433,53 @@ end = struct end end +and DigitalCredentials : sig + module rec VirtualWalletBehavior : sig + type _virtualwalletbehavior = [ `respond | `decline | `wait | `clear ] + + val _virtualwalletbehavior_of_yojson : + Yojson.Basic.t -> _virtualwalletbehavior + + val yojson_of__virtualwalletbehavior : + _virtualwalletbehavior -> Yojson.Basic.t + + type t = _virtualwalletbehavior + [@@deriving yojson] [@@ocaml.doc "The type of virtual wallet action."] + end +end = struct + module rec VirtualWalletBehavior : sig + type _virtualwalletbehavior = [ `respond | `decline | `wait | `clear ] + + val _virtualwalletbehavior_of_yojson : + Yojson.Basic.t -> _virtualwalletbehavior + + val yojson_of__virtualwalletbehavior : + _virtualwalletbehavior -> Yojson.Basic.t + + type t = _virtualwalletbehavior + [@@deriving yojson] [@@ocaml.doc "The type of virtual wallet action."] + end = struct + type _virtualwalletbehavior = [ `respond | `decline | `wait | `clear ] + + let _virtualwalletbehavior_of_yojson = function + | `String "respond" -> `respond + | `String "decline" -> `decline + | `String "wait" -> `wait + | `String "clear" -> `clear + | `String s -> failwith ("unknown enum: " ^ s) + | _ -> failwith "unknown enum type" + + let yojson_of__virtualwalletbehavior = function + | `respond -> `String "respond" + | `decline -> `String "decline" + | `wait -> `String "wait" + | `clear -> `String "clear" + + type t = _virtualwalletbehavior + [@@deriving yojson] [@@ocaml.doc "The type of virtual wallet action."] + end +end + and Emulation : sig module rec SafeAreaInsets : sig type t = { @@ -21536,7 +21583,8 @@ and Network : sig and DeviceBoundSessionFetchResult : sig type _deviceboundsessionfetchresult = [ `Success - | `KeyError + | `SigningKeyGenerationError + | `AttestationKeyGenerationError | `SigningError | `TransientSigningError | `ServerRequestedTermination @@ -21615,7 +21663,8 @@ and Network : sig type t = _deviceboundsessionfetchresult [@@deriving yojson] [@@ocaml.doc - "A fetch result for a device bound session creation or refresh."] + "A fetch result for a device bound session creation or refresh.\n\ + LINT.IfChange(DeviceBoundSessionFetchResult)"] end and DeviceBoundSessionFailedRequest : sig @@ -26246,7 +26295,8 @@ end = struct and DeviceBoundSessionFetchResult : sig type _deviceboundsessionfetchresult = [ `Success - | `KeyError + | `SigningKeyGenerationError + | `AttestationKeyGenerationError | `SigningError | `TransientSigningError | `ServerRequestedTermination @@ -26325,11 +26375,13 @@ end = struct type t = _deviceboundsessionfetchresult [@@deriving yojson] [@@ocaml.doc - "A fetch result for a device bound session creation or refresh."] + "A fetch result for a device bound session creation or refresh.\n\ + LINT.IfChange(DeviceBoundSessionFetchResult)"] end = struct type _deviceboundsessionfetchresult = [ `Success - | `KeyError + | `SigningKeyGenerationError + | `AttestationKeyGenerationError | `SigningError | `TransientSigningError | `ServerRequestedTermination @@ -26401,7 +26453,9 @@ end = struct let _deviceboundsessionfetchresult_of_yojson = function | `String "Success" -> `Success - | `String "KeyError" -> `KeyError + | `String "SigningKeyGenerationError" -> `SigningKeyGenerationError + | `String "AttestationKeyGenerationError" -> + `AttestationKeyGenerationError | `String "SigningError" -> `SigningError | `String "TransientSigningError" -> `TransientSigningError | `String "ServerRequestedTermination" -> `ServerRequestedTermination @@ -26503,7 +26557,9 @@ end = struct let yojson_of__deviceboundsessionfetchresult = function | `Success -> `String "Success" - | `KeyError -> `String "KeyError" + | `SigningKeyGenerationError -> `String "SigningKeyGenerationError" + | `AttestationKeyGenerationError -> + `String "AttestationKeyGenerationError" | `SigningError -> `String "SigningError" | `TransientSigningError -> `String "TransientSigningError" | `ServerRequestedTermination -> `String "ServerRequestedTermination" @@ -26604,7 +26660,8 @@ end = struct type t = _deviceboundsessionfetchresult [@@deriving yojson] [@@ocaml.doc - "A fetch result for a device bound session creation or refresh."] + "A fetch result for a device bound session creation or refresh.\n\ + LINT.IfChange(DeviceBoundSessionFetchResult)"] end and DeviceBoundSessionFailedRequest : sig diff --git a/package.json b/package.json index 71d028d..03f46c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cdp", - "version": "0.0.1654583", + "version": "0.0.1655900", "description": "Chrome Devtools Protocol Types for OCaml", "license": "MIT", "repository": {