-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
443 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 41 additions & 2 deletions
43
packages/automated-dispute/src/interfaces/notificationService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,52 @@ | ||
/** | ||
* Represents a notification message. | ||
*/ | ||
export interface IMessage { | ||
/** | ||
* The main content of the message. | ||
*/ | ||
title: string; | ||
/** | ||
* An optional subtitle for the message. | ||
*/ | ||
subtitle?: string; | ||
/** | ||
* An optional description providing more details. | ||
*/ | ||
description?: string; | ||
/** | ||
* The username to display as the sender. | ||
*/ | ||
username?: string; | ||
/** | ||
* The URL of the avatar image to display. | ||
*/ | ||
avatarUrl?: string; | ||
/** | ||
* An optional URL associated with the message. | ||
*/ | ||
actionUrl?: string; | ||
} | ||
|
||
/** | ||
* Interface representing a notification service capable of sending notifications. | ||
*/ | ||
export interface NotificationService { | ||
// send(message: IMessage): Promise<void>; | ||
notifyError(err: Error, context: unknown): Promise<void>; | ||
/** | ||
* Sends a notification message. | ||
* | ||
* @param {IMessage} message - The message to send. | ||
* @returns {Promise<void>} A promise that resolves when the message is sent. | ||
*/ | ||
send(message: IMessage): Promise<void>; | ||
|
||
/** | ||
* Creates an IMessage from an error. | ||
* | ||
* @param err - The error object of type unknown. | ||
* @param context - Additional context for the error. | ||
* @param defaultMessage - A default message describing the error context. | ||
* @returns An IMessage object ready to be sent via the notifier. | ||
*/ | ||
createErrorMessage(err: unknown, context: unknown, defaultMessage: string): IMessage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.