Merge pull request #375 from Hexastack/fix/remove-unecessary-channel-methods

fix: remove unecessary channel handler methods
This commit is contained in:
Med Marrouchi 2024-11-27 10:30:07 +01:00 committed by GitHub
commit 8859a2289c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,6 @@ import path from 'path';
import { Injectable, OnModuleInit } from '@nestjs/common';
import { NextFunction, Request, Response } from 'express';
import { Attachment } from '@/attachment/schemas/attachment.schema';
import { SubscriberCreateDto } from '@/chat/dto/subscriber.dto';
import {
StdOutgoingEnvelope,
@ -135,15 +134,6 @@ export default abstract class ChannelHandler<
*/
abstract _attachmentFormat(message: StdOutgoingMessage, options?: any): any;
/**
* Format a collection of items to be sent to the channel in carousel/list format
*
* @param data - A list of data items to be sent to the end user
* @param options - Might contain additional settings
* @returns {Object[]} - An array of element objects
*/
abstract _formatElements(data: any[], options: any, ...args: any): any[];
/**
* Format a list of elements
*
@ -196,16 +186,6 @@ export default abstract class ChannelHandler<
event: EventWrapper<any, any>,
): Promise<SubscriberCreateDto>;
/**
* @param _attachment - The attachment that needs to be uploaded to the channel
* @returns {Promise<Attachment>}
* Uploads an attachment to the channel as some require file to be uploaded so
* that they could be used in messaging (dimelo, twitter, ...)
*/
async uploadAttachment(_attachment: Attachment): Promise<Attachment> {
return _attachment;
}
/**
* Custom channel middleware
* @param req