/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { messagesDelete } from "../funcs/messagesDelete.js"; import { messagesDeleteByTransactionId } from "../funcs/messagesDeleteByTransactionId.js"; import { messagesRetrieve } from "../funcs/messagesRetrieve.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Messages extends ClientSDK { /** * List all messages * * @remarks * List all messages for the current environment. * This API supports filtering by **channel**, **subscriberId**, and **transactionId**. * This API returns a paginated list of messages. */ async retrieve( request: operations.MessagesControllerGetMessagesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(messagesRetrieve( this, request, options, )); } /** * Delete a message * * @remarks * Delete a message entity from the Novu platform by **messageId**. * This action is irreversible. **messageId** is required and of mongodbId type. */ async delete( messageId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(messagesDelete( this, messageId, idempotencyKey, options, )); } /** * Delete messages by transactionId * * @remarks * Delete multiple messages from the Novu platform using **transactionId** of triggered event. * This API supports filtering by **channel** and delete all messages associated with the **transactionId**. */ async deleteByTransactionId( transactionId: string, channel?: | operations.MessagesControllerDeleteMessagesByTransactionIdQueryParamChannel | undefined, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise< | operations.MessagesControllerDeleteMessagesByTransactionIdResponse | undefined > { return unwrapAsync(messagesDeleteByTransactionId( this, transactionId, channel, idempotencyKey, options, )); } }