diff options
Diffstat (limited to 'packages/taler-util/src/notifications.ts')
-rw-r--r-- | packages/taler-util/src/notifications.ts | 73 |
1 files changed, 54 insertions, 19 deletions
diff --git a/packages/taler-util/src/notifications.ts b/packages/taler-util/src/notifications.ts index d84d3706d..f4dbef8b6 100644 --- a/packages/taler-util/src/notifications.ts +++ b/packages/taler-util/src/notifications.ts @@ -15,16 +15,15 @@ */ /** - * Type and schema definitions for notifications from the wallet to clients - * of the wallet. + * @fileoverview Type and schema definitions for notifications from the + * wallet to clients of the wallet. */ /** * Imports. */ -import { WithdrawalOperationStatus } from "./index.node.js"; import { TransactionState } from "./transactions-types.js"; -import { ExchangeEntryState, TalerErrorDetail } from "./wallet-types.js"; +import { ExchangeEntryState } from "./wallet-types.js"; export enum NotificationType { BalanceChange = "balance-change", @@ -33,6 +32,10 @@ export enum NotificationType { TransactionStateTransition = "transaction-state-transition", ExchangeStateTransition = "exchange-state-transition", WithdrawalOperationTransition = "withdrawal-state-transition", + TaskProgress = "task-progress", + RequestProgress = "request-progress", + RequestOnTaskDependency = "request-on-task-dependency", + TaskOnTaskDependency = "task-on-task-dependency", } export interface ErrorInfoSummary { @@ -97,26 +100,58 @@ export interface BalanceChangeNotification { hintTransactionId: string; } -export interface BackupOperationErrorNotification { - type: NotificationType.BackupOperationError; - error: TalerErrorDetail; +export interface TaskProgressNotification { + type: NotificationType.TaskProgress; + taskId: string; } -export interface PendingOperationProcessedNotification { - type: NotificationType.PendingOperationProcessed; - id: string; - taskResultType: string; +export interface RequestProgressNotification { + type: NotificationType.RequestProgress; + requestId: string; } -export interface WithdrawalOperationTransitionNotification { - type: NotificationType.WithdrawalOperationTransition; - operationId: string; - state: WithdrawalOperationStatus; + +export interface RequestOnTaskDependencyNotification { + type: NotificationType.RequestOnTaskDependency; + parentTaskId: string; + childTaskId: string; +} + +export interface TaskOnTaskDependencyNotification { + type: NotificationType.TaskOnTaskDependency; + parentRequestId: string; + childTaskId: string; } +export type ObservabilityEvent = + | { + type: "start-http-fetch"; + url: string; + } + | { + type: "finish-http-fetch"; + url: string; + status: number; + } + | { + type: "start-db-query"; + name: string; + location: string; + } + | { + type: "finish-db-query"; + name: string; + location: string; + } + | { + type: "task-processed"; + taskResultType: string; + }; + export type WalletNotification = | BalanceChangeNotification - | BackupOperationErrorNotification | ExchangeStateTransitionNotification - | PendingOperationProcessedNotification - | WithdrawalOperationTransitionNotification - | TransactionStateTransitionNotification; + | TransactionStateTransitionNotification + | TaskProgressNotification + | RequestProgressNotification + | RequestOnTaskDependencyNotification + | TaskOnTaskDependencyNotification; |