zcatalyst-integ-cliq
Version:
Node.js SDK for integrating Zoho Catalyst with Zoho Cliq
31 lines (30 loc) • 1.21 kB
JavaScript
import { Handler } from '../../handler.js';
import CONSTANTS from '../../constants.js';
import HandlerResponse from '../response-objects/handler-response.js';
import CommandSuggestion from '../response-objects/command-suggestion.js';
const { COMMAND } = CONSTANTS;
const { command_handler } = CONSTANTS.HANDLERS;
export default class CommandHandler {
executionHandler(handler) {
Handler.registerHandler(COMMAND, command_handler.EXECUTION_HANDLER, handler, HandlerResponse);
}
suggestionHandler(handler) {
Handler.registerHandler(COMMAND, command_handler.SUGGESTION_HANDLER, handler, Array);
}
newHandlerResponse() {
return new HandlerResponse();
}
/**
* @deprecated - function name has been misspelled
*
* Use {@link newCommandSuggestion} function instead
*/
newCommandSugestion(title, description, imageurl) {
// eslint-disable-next-line no-console
console.warn('Deprecated method - newCommandSugestion');
return new CommandSuggestion(title, description, imageurl);
}
newCommandSuggestion(title, description, imageurl) {
return new CommandSuggestion(title, description, imageurl);
}
}