zcatalyst-integ-cliq
Version:
Node.js SDK for integrating Zoho Catalyst with Zoho Cliq
292 lines (291 loc) • 9.13 kB
TypeScript
export declare type SUCCESS = 200;
export declare type FAILURE = 400;
export declare type STATUS = SUCCESS | FAILURE;
export declare type BUTTON_TYPE = '+' | '-';
export declare type MESSAGE_TYPE = 'text' | 'banner' | 'message_edit' | 'transient_message';
export declare type MESSAGE_CARD_TYPE = 'text' | 'card' | 'file' | 'event' | 'contact' | 'location';
export declare type MESSAGE_VIEW_TYPE = 'navigation' | 'ephemeral' | 'popup';
export declare type HTTP_METHOD = 'GET' | 'PUT' | 'POST' | 'DELETE';
export declare type FORM_FIELD_TYPE = 'text' | 'checkbox' | 'datetime' | 'location' | 'radio' | 'number' | 'date' | 'toggle' | 'textarea' | 'file' | 'select' | 'native_select' | 'dynamic_select' | 'hidden' | 'catalogue' | 'phone_number';
export declare type FORM_MODIFICATION_ACTION_TYPE = 'remove' | 'clear' | 'enable' | 'disable' | 'update' | 'add_before' | 'add_after';
export declare type FORM_ACTION = 'submit' | 'cancel' | 'change' | 'input';
export declare type FORM_FORMAT = 'email' | 'tel' | 'url' | 'password';
export declare type FORM_FILTER = 'organization' | 'team' | 'private' | 'external' | 'dm' | 'channels' | 'adhoc' | 'colleagues' | 'contacts' | 'bots' | 'skip_current_user';
export declare type FORM_RENDERING_MODE = 'kiosk' | 'classic';
export declare type FORM_ACTION_MODE = 'immediate' | 'confirm';
export declare type DATA_SOURCE_TYPE = 'channels' | 'conversations' | 'contacts' | 'teams';
export declare type ACTION_TYPE = 'invoke.function' | 'system.api' | 'open.url' | 'preview.url';
export declare type SLIDE_TYPE = 'table' | 'list' | 'images' | 'text' | 'label';
export declare type CARD_THEME = 'basic' | 'poll' | 'modern-inline' | 'prompt';
export declare type ALIGNMENT = 'left' | 'center' | 'right';
export declare type BANNER_STATUS = 'success' | 'failure';
export declare type PREVIEW_TYPE = 'page' | 'audio' | 'video' | 'image';
export declare type SYSTEM_API_ACTION = 'audiocall/{{id}}' | 'videocall/{{id}}' | 'startchat/{{id}}' | 'invite/{{id}}' | 'locationpermission' | 'joinchannel/{{id}}' | 'set_reminder';
export declare type WIDGET_BUTTON_EMOTION = 'positive' | 'neutral' | 'negative';
export declare type WIDGET_DATA_TYPE = 'sections' | 'info' | 'form' | 'map' | 'web_view';
export declare type WIDGET_ELEMENT_TYPE = 'title' | 'text' | 'subtext' | 'activity' | 'user_activity' | 'divider' | 'buttons' | 'table' | 'fields' | 'cards' | 'images' | 'percentage_chart' | 'graph';
export declare type WIDGET_STYLE_VIEW = 'carousel' | 'gallery';
export declare type WIDGET_STYLE_SIZE = 'small' | 'medium' | 'large';
export declare type WIDGET_EVENT = 'load' | 'refresh' | 'tab_click';
export declare type WIDGET_TYPE = 'applet';
export declare type WIDGET_STYLE_PREVIEW = 'pie' | 'doughnut' | 'semi_doughnut' | 'vertical_bar' | 'horizontal_bar' | 'horizontal_stacked_bar' | 'vertical_stacked_bar' | 'trend';
export declare type CHANNEL_OPERATION = 'added' | 'removed' | 'message_sent' | 'message_edited' | 'message_deleted' | 'auto_followed_thread' | 'added_in_thread' | 'removed_from_thread' | 'thread_closed' | 'thread_reopened';
export declare type BOT_ALERT_OPERATION = 'default_state' | 'busy' | 'ringing' | 'answered' | 'ended' | 'declined' | 'missed' | 'offline';
export declare type ORGANIZATION_TYPE = 'company' | 'network';
export declare type OEMBED_TYPES = 'link' | 'image' | 'rich' | 'photo' | 'audio' | 'video';
export declare type OEMBED_ACTION_TYPE = 'open.url' | 'button' | 'system.api';
export declare type CHAT_TYPE = 'channel' | 'bot' | 'dm' | 'chat' | 'crossproduct_custom_chat' | 'entity_chat' | 'guests' | 'threads' | 'thread';
export declare type TICKER_TYPE = 'person' | 'bicycle' | 'motorcycle' | 'car' | 'van' | 'bus' | 'plane' | 'home' | 'office';
export declare type TICKER_COLOR = 'green' | 'red' | 'yellow';
export declare type DAYS = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
export declare type INPUT_REQUIREMENT = 'optional' | 'mandatory';
export declare type handlerFunction = (req: unknown, res: unknown, ...args: Array<unknown>) => Promise<unknown>;
export declare type StringObjectMap = Record<string, unknown>;
export interface Access {
zoho_user_id: number;
user_id: number;
user_agent: string;
chat_id: string;
organization: Organization;
message_id: string;
platform_version: string;
parent_chat_id: string;
}
export interface Organization {
type: ORGANIZATION_TYPE;
id: number;
}
export interface AppInfo {
current_version: string;
existing_version: string;
type: 'install' | 'upgrade';
}
export interface Attachment {
name: string;
comment: string;
id: string;
url: string;
contenttype: string;
}
export interface BotDetails {
name: string;
image: string;
}
export interface MessageStyles {
highlight: boolean;
}
export interface Button {
type: 'button';
object: ButtonObject;
}
export interface ButtonArguments {
key: string;
}
export interface Chat {
owner: number;
id: string;
type: string;
title: string;
members: Array<Member>;
recent_messages: Array<RecentMessage>;
channel_unique_name: string;
chat_type: CHAT_TYPE;
channel_id: string;
entity_id: string;
}
export interface Content {
thumbnail: Thumbnail;
file: FileContent;
comment: string;
text: string;
}
export interface DateTimeObject {
date_time: string;
time_zone_id: string;
}
export interface Dimension {
size: number;
width: number;
height: number;
}
export interface Environment {
data_center: string;
base_url: string;
tld: string;
extension: ExtensionDetails;
}
export interface ExtensionDetails {
version: string;
}
export interface File {
name: string;
id: string;
type: string;
url: string;
}
export interface FileContent {
name: string;
id: string;
type: string;
dimensions: Dimension;
}
export interface FormRequestParam {
name: string;
action: FORM_ACTION;
values: Record<string, unknown>;
}
export interface FormTarget {
name: string;
value: unknown;
query: string;
}
export interface Location {
latitude: number;
longitude: number;
accuracy: number;
altitude: number;
status: 'granted' | 'prompt' | 'denied' | 'failed';
}
export interface LocationValue {
latitude: number;
longitude: number;
}
export interface Member {
id: string;
first_name: string;
last_name: string;
email: string;
status: string;
}
export interface Mention {
name: string;
dname: string;
id: string;
type: string;
}
export interface MessageDetails {
time: number;
message: Message;
}
export interface MessageObject {
sender: User;
time: number;
type: MESSAGE_CARD_TYPE;
text: string;
is_read: boolean;
ack_key: string;
id: string;
content: Content;
}
export interface Messages {
count: number;
list: Array<MessageObject>;
}
export interface RecentMessage {
sender: Sender;
time: number;
text: string;
id: string;
type: string;
}
export interface Sender {
name: string;
id: string;
}
export interface Thumbnail {
width: string;
blur_data: string;
height: string;
}
export interface User {
id: string;
first_name: string;
last_name: string;
email: string;
admin: boolean;
organization_id: number;
timezone: string;
country: string;
language: string;
name: string;
zoho_user_id: number;
}
export interface SuggestionObject {
text?: string;
icon?: string;
}
/**
* @deprecated - name misspelled
*
* Use {@link SuggestionObject} instead.
*/
export interface SugestionObject {
text?: string;
icon?: string;
}
export interface CommandSuggestion {
title?: string;
description?: string;
imageurl?: string;
}
export interface ButtonObject {
id?: string;
button_id?: string;
label?: string;
name?: string;
hint?: string;
type?: BUTTON_TYPE;
key?: string;
action?: Action;
url?: string;
arguments?: Record<string, unknown>;
icon?: string;
section_id?: string;
}
export interface WidgetTarget {
label: string;
id: string;
tab_id: string;
section_id: string;
}
export interface Action {
type?: ACTION_TYPE;
data?: ActionData;
confirm?: Confirm;
}
export interface ActionDataParams {
content: string;
date_time: string;
}
export interface ActionData {
name?: string;
owner?: string;
web?: string;
windows?: string;
iOS?: string;
android?: string;
api?: string;
params?: ActionDataParams;
}
export interface Confirm {
title?: string;
description?: string;
input?: string;
button_text?: string;
emotion?: WIDGET_BUTTON_EMOTION;
mandatory?: boolean;
button_label?: string;
cancel_button_label?: string;
}
export interface FormValue {
label?: string;
value?: string;
}
export interface Message {
type?: MESSAGE_TYPE;
mentions?: Array<Mention>;
text?: string;
file?: File;
comment?: string;
status?: BANNER_STATUS;
}