taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit cb7283bd351d7f057109dda87b36bacbcba3c8fe
parent acca0c2c605173b3fe0fee1bd4cb77d227830ea2
Author: Sebastian <sebasjm@gmail.com>
Date:   Tue,  3 Dec 2024 11:12:42 -0300

fix program input interface

Diffstat:
Mpackages/taler-util/src/types-taler-exchange.ts | 6+++---
Mpackages/taler-util/src/types-taler-kyc-aml.ts | 15++++++++-------
2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/packages/taler-util/src/types-taler-exchange.ts b/packages/taler-util/src/types-taler-exchange.ts @@ -1800,7 +1800,7 @@ export interface KycProcessClientInformation { // List of available voluntary checks the client could pay for. // Since **vATTEST**. - voluntary_checks?: { [name: string]: KycCheckPublicInformation }; + voluntary_measures?: KycRequirementInformation[]; } declare const opaque_kycReq: unique symbol; @@ -2648,8 +2648,8 @@ export const codecForKycProcessClientInformation = ) .property("is_and_combinator", codecOptional(codecForBoolean())) .property( - "voluntary_checks", - codecOptional(codecForMap(codecForKycCheckPublicInformation())), + "voluntary_measures", + codecOptional(codecForList(codecForKycRequirementInformation())), ) .build("TalerExchangeApi.KycProcessClientInformation"); diff --git a/packages/taler-util/src/types-taler-kyc-aml.ts b/packages/taler-util/src/types-taler-kyc-aml.ts @@ -20,6 +20,7 @@ import { codecForAccountProperties, codecForAny, codecForList, + codecOptional, } from "./index.js"; import { AmountString, @@ -95,15 +96,15 @@ export interface AmlProgramInput { // keys will match the HTML FORM field names and // the values will use the KycStructuredFormData // encoding. - attributes: any; + attributes?: any; // JSON array with the results of historic // AML decisions about the account. - aml_history: AmlHistoryEntry[]; + aml_history?: AmlHistoryEntry[]; // JSON array with the results of historic // KYC data about the account. - kyc_history: KycHistoryEntry[]; + kyc_history?: KycHistoryEntry[]; // Default KYC rules of the exchange (exposed and not exposed). // @@ -340,8 +341,8 @@ export interface MeasureInformation { export const codecForAmlProgramInput = (): Codec<AmlProgramInput> => buildCodecForObject<AmlProgramInput>() - .property("aml_history", codecForList(codecForAny())) - .property("kyc_history", codecForList(codecForAny())) - .property("attributes", codecForAccountProperties()) - .property("context", codecForAny()) + .property("aml_history", codecOptional( codecForList(codecForAny()))) + .property("kyc_history", codecOptional(codecForList(codecForAny()))) + .property("attributes", codecOptional(codecForAccountProperties())) + .property("context", codecOptional(codecForAny())) .build("AmlProgramInput");