diff options
Diffstat (limited to 'packages/taler-util/src/http-client/types.ts')
-rw-r--r-- | packages/taler-util/src/http-client/types.ts | 124 |
1 files changed, 26 insertions, 98 deletions
diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts index 75241aa30..2172eee39 100644 --- a/packages/taler-util/src/http-client/types.ts +++ b/packages/taler-util/src/http-client/types.ts @@ -54,15 +54,17 @@ export type PaginationParams = { */ limit?: number; /** - * milliseconds the server should wait for at least one result to be shown - */ - timoutMs?: number; - /** * order */ order: "asc" | "dec"; }; +export type LongPollParams = { + /** + * milliseconds the server should wait for at least one result to be shown + */ + timeoutMs?: number; +}; /// /// HASH /// @@ -273,13 +275,13 @@ export const codecForCoreBankConfig = (): Codec<TalerCorebankApi.Config> => .property("name", codecForConstString("libeufin-bank")) .property("version", codecForString()) .property("allow_conversion", codecForBoolean()) - .property("allow_deletions", codecForBoolean()) .property("allow_registrations", codecForBoolean()) - .property("allow_edit_cashout_payto_uri", codecForBoolean()) + .property("allow_deletions", codecForBoolean()) .property("allow_edit_name", codecForBoolean()) + .property("allow_edit_cashout_payto_uri", codecForBoolean()) .property("default_debit_threshold", codecForAmountString()) - .property("currency_specification", codecForCurrencySpecificiation()) .property("currency", codecForString()) + .property("currency_specification", codecForCurrencySpecificiation()) .property("supported_tan_channels", codecForList(codecForEither( codecForConstString(TalerCorebankApi.TanChannel.SMS), codecForConstString(TalerCorebankApi.TanChannel.EMAIL), @@ -334,10 +336,11 @@ export const codecForPublicAccountsResponse = export const codecForAccountMinimalData = (): Codec<TalerCorebankApi.AccountMinimalData> => buildCodecForObject<TalerCorebankApi.AccountMinimalData>() + .property("username", codecForString()) + .property("name", codecForString()) + .property("payto_uri", codecForPaytoString()) .property("balance", codecForBalance()) .property("debit_threshold", codecForAmountString()) - .property("name", codecForString()) - .property("username", codecForString()) .property("is_public", codecForBoolean()) .property("is_taler_exchange", codecForBoolean()) .build("TalerCorebankApi.AccountMinimalData"); @@ -377,13 +380,6 @@ export const codecForChallengeContactData = export const codecForWithdrawalPublicInfo = (): Codec<TalerCorebankApi.WithdrawalPublicInfo> => buildCodecForObject<TalerCorebankApi.WithdrawalPublicInfo>() - .property("username", codecForString()) - .property("amount", codecForAmountString()) - .property( - "selected_exchange_account", - codecOptional(codecForPaytoString()), - ) - .property("selected_reserve_pub", codecOptional(codecForString())) .property( "status", codecForEither( @@ -393,6 +389,13 @@ export const codecForWithdrawalPublicInfo = codecForConstString("confirmed"), ), ) + .property("amount", codecForAmountString()) + .property("username", codecForString()) + .property("selected_reserve_pub", codecOptional(codecForString())) + .property( + "selected_exchange_account", + codecOptional(codecForPaytoString()), + ) .build("TalerCorebankApi.WithdrawalPublicInfo"); export const codecForBankAccountTransactionsResponse = @@ -469,15 +472,6 @@ export const codecForCashouts = (): Codec<TalerCorebankApi.Cashouts> => export const codecForCashoutInfo = (): Codec<TalerCorebankApi.CashoutInfo> => buildCodecForObject<TalerCorebankApi.CashoutInfo>() .property("cashout_id", codecForNumber()) - .property( - "status", - codecOptional( - codecForEither( - codecForConstString("pending"), - codecForConstString("aborted"), - codecForConstString("confirmed"), - )), - ) .build("TalerCorebankApi.CashoutInfo"); export const codecForGlobalCashouts = @@ -491,41 +485,15 @@ export const codecForGlobalCashoutInfo = buildCodecForObject<TalerCorebankApi.GlobalCashoutInfo>() .property("cashout_id", codecForNumber()) .property("username", codecForString()) - .property( - "status", - codecOptional( - codecForEither( - codecForConstString("pending"), - codecForConstString("aborted"), - codecForConstString("confirmed"), - )), - ) .build("TalerCorebankApi.GlobalCashoutInfo"); export const codecForCashoutStatusResponse = (): Codec<TalerCorebankApi.CashoutStatusResponse> => buildCodecForObject<TalerCorebankApi.CashoutStatusResponse>() - .property("amount_credit", codecForAmountString()) .property("amount_debit", codecForAmountString()) - .property("creation_time", codecForTimestamp) - .property( - "tan_channel", - codecOptional(codecForEither( - codecForConstString(TalerCorebankApi.TanChannel.SMS), - codecForConstString(TalerCorebankApi.TanChannel.EMAIL), - )), - ) + .property("amount_credit", codecForAmountString()) .property("subject", codecForString()) - .property("confirmation_time", codecOptional(codecForTimestamp)) - .property( - "status", - codecOptional(codecForEither( - codecForConstString("pending"), - codecForConstString("aborted"), - codecForConstString("confirmed"), - )), - ) - .property("tan_info", codecOptional(codecForString())) + .property("creation_time", codecForTimestamp) .build("TalerCorebankApi.CashoutStatusResponse"); export const codecForConversionRatesResponse = @@ -607,7 +575,6 @@ export const codecForBankWithdrawalOperationPostResponse = .property( "status", codecForEither( - codecForConstString("pending"), codecForConstString("selected"), codecForConstString("aborted"), codecForConstString("confirmed"), @@ -872,7 +839,7 @@ export const codecForConversionBankConfig = .property("fiat_currency", codecForString()) .property("fiat_currency_specification", codecForCurrencySpecificiation()) - .property("conversion_rate", codecOptional(codecForConversionInfo())) + .property("conversion_rate", (codecForConversionInfo())) .build("ConversionBankConfig.IntegrationConfig"); // export const codecFor = @@ -1177,7 +1144,7 @@ export namespace TalerBankConversionApi { // Extra conversion rate information. // Only present if server opts in to report the static conversion rate. - conversion_rate?: ConversionInfo; + conversion_rate: ConversionInfo; } export interface CashinConversionResponse { @@ -1564,6 +1531,9 @@ export namespace TalerCorebankApi { // Legal name of the account owner. name: string; + // Internal payto URI of this bank account. + payto_uri: PaytoString; + // current balance of the account balance: Balance; @@ -1638,14 +1608,6 @@ export namespace TalerCorebankApi { // otherwise the request will fail. amount_credit: AmountString; - // Which channel the TAN should be sent to. If - // this field is missing, it defaults to SMS. - // The default choice prefers to change the communication - // channel respect to the one used to issue this request. - /** - * @deprecated since 4, use 2fa - */ - tan_channel?: TanChannel; } export interface CashoutResponse { @@ -1680,10 +1642,6 @@ export namespace TalerCorebankApi { export interface GlobalCashoutInfo { cashout_id: number; username: string; - /** - * @deprecated since 4, use new 2fa - */ - status?: "pending" | "aborted" | "confirmed"; } export interface CashoutStatusResponse { @@ -1698,38 +1656,8 @@ export namespace TalerCorebankApi { // Transaction subject. subject: string; - // Fiat bank account that will receive the cashed out amount. - // Specified as a payto URI. - // credit_payto_uri: PaytoString; - // Time when the cashout was created. creation_time: Timestamp; - - /** - * @deprecated since 4, use new 2fa - */ - status?: "pending" | "aborted" | "confirmed"; - - // Time when the cashout was confirmed via its TAN. - // Missing when the operation wasn't confirmed yet. - /** - * @deprecated since 4, use new 2fa - */ - confirmation_time?: Timestamp; - - // Channel of the last successful transmission of the TAN challenge. - // Missing when all transmissions failed. - /** - * @deprecated since 4, use new 2fa - */ - tan_channel?: TanChannel; - - // Info of the last successful transmission of the TAN challenge. - // Missing when all transmissions failed. - /** - * @deprecated since 4, use new 2fa - */ - tan_info?: string; } export interface ConversionRatesResponse { |