diff options
author | Sebastian <sebasjm@gmail.com> | 2024-04-22 12:18:41 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-04-22 12:18:41 -0300 |
commit | 5db4cb99e3f16c8471117ca7443bc323180e67ec (patch) | |
tree | a2340eb33b259cf420abb6a1e3cf295c0393b4f9 /packages/taler-util | |
parent | 594dd1fd4638d658303c4c8a0f24c4082564eceb (diff) | |
download | wallet-core-5db4cb99e3f16c8471117ca7443bc323180e67ec.tar.xz |
fix #8393
Diffstat (limited to 'packages/taler-util')
-rw-r--r-- | packages/taler-util/src/http-client/types.ts | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts index 329acd484..a2f709769 100644 --- a/packages/taler-util/src/http-client/types.ts +++ b/packages/taler-util/src/http-client/types.ts @@ -18,6 +18,7 @@ import { import { PaytoString, codecForPaytoString } from "../payto.js"; import { AmountString, + InternationalizedString, codecForInternationalizedString, codecForLocation, } from "../taler-types.js"; @@ -223,7 +224,9 @@ export function createRFC8959AccessToken(token: string): AccessToken { * @param clientSecret * @returns */ -export function createClientSecretAccessToken(clientSecret: string): AccessToken { +export function createClientSecretAccessToken( + clientSecret: string, +): AccessToken { return clientSecret as AccessToken; } @@ -1516,9 +1519,9 @@ export const codecForChallengeSetupResponse = export const codecForChallengeStatus = (): Codec<ChallengerApi.ChallengeStatus> => buildCodecForObject<ChallengerApi.ChallengeStatus>() - .property("restrictions", codecForAny()) + .property("restrictions", codecOptional(codecForMap(codecForAny()))) .property("fix_address", codecForBoolean()) - .property("last_address", codecForAny()) + .property("last_address", codecOptional(codecForMap(codecForAny()))) .property("changes_left", codecForNumber()) .build("ChallengerApi.ChallengeStatus"); export const codecForChallengeCreateResponse = @@ -5279,6 +5282,12 @@ export namespace ChallengerApi { nonce: string; } + export interface Restriction { + regex?: string; + hint?: string; + hint_i18n?: InternationalizedString; + } + export interface ChallengeStatus { // Object; map of keys (names of the fields of the address // to be entered by the user) to objects with a "regex" (string) @@ -5288,7 +5297,7 @@ export namespace ChallengerApi { // by the user does not match the regex. Keys that are not mapped // to such an object have no restriction on the value provided by // the user. See "ADDRESS_RESTRICTIONS" in the challenger configuration. - restrictions: Object; + restrictions: Record<string, Restriction> | undefined; // indicates if the given address cannot be changed anymore, the // form should be read-only if set to true. @@ -5296,7 +5305,7 @@ export namespace ChallengerApi { // form values from the previous submission if available, details depend // on the ADDRESS_TYPE, should be used to pre-populate the form - last_address: Object; + last_address: Record<string, string> | undefined; // number of times the address can still be changed, may or may not be // shown to the user |