Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(node): Fixing chat missing in events interface #5661

Merged
merged 25 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4d3b878
adding chat to overrides interface
ameensom May 28, 2024
e837799
Merge branch 'novuhq:next' into next
ameensom May 29, 2024
869b3f3
feat(providers): adding mobishastra sms provider
ameensom May 29, 2024
5ce88a0
Merge branch 'next' into next
ameensom May 31, 2024
7371a28
Merge branch 'next' into next
ameensom May 31, 2024
39a9543
fix(node): remove code unrelated to fix
ameensom Jun 1, 2024
d30a74a
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 1, 2024
9e8eb45
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 3, 2024
8fd34b4
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 3, 2024
0ecb06b
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 3, 2024
e3ba4b6
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 3, 2024
5ed67d6
fix(node): Add missing 'chat' property to ITriggerOverrides interface
ameensom Jun 3, 2024
f338a85
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 4, 2024
6c77bc9
fix(events): Add 'whatsapp' property to ITriggerOverrides interface
ameensom Jun 4, 2024
2dc18ec
refactor(events): Update IWhatsappOverrides interface to use IWhatsap…
ameensom Jun 4, 2024
f37b0c1
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 4, 2024
4f13ccc
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 5, 2024
249258f
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 6, 2024
54dab5e
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 8, 2024
d0dd4ac
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 10, 2024
d2836ba
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 11, 2024
d3fe9e4
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 11, 2024
67c282b
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 11, 2024
d7f53fa
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 12, 2024
ee7f0e2
Merge branch 'next' into fixing-chat-missing-in-events-interface
ameensom Jun 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions packages/node/src/lib/events/events.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export type ITriggerOverrides = {
[key in 'sms']?: ITriggerOverrideSMS;
} & {
[key in SmsProviderIdEnum]?: ITriggerOverrideSMS;
} & {
[key in 'whatsapp']?: IWhatsappOverrides;
};

export type ITriggerOverrideDelayAction = {
Expand Down Expand Up @@ -154,6 +156,103 @@ export type ITriggerOverrideExpo = {
mutableContent?: boolean;
};

export type IWhatsappOverrides = {
template?: {
name: string;
language: {
code: string;
};
components?: IWhatsappComponent[];
};
} & {
[key in
| 'audio'
| 'document'
| 'image'
| 'sticker'
| 'video']?: IWhatsappMedia;
} & {
interactive?: {
type:
| 'button'
| 'catalog_message'
| 'list'
| 'product'
| 'product_list'
| 'flow';
action: {
button?: string;
buttons?: {
type: 'reply';
title: string;
id: string;
}[];
catalog_id?: string;
product_retailer_id?: string;
sections?: IWhatsappSections[];
mode?: 'draft' | 'published';
flow_message_version?: '3';
flow_token?: string;
flow_id?: string;
flow_cta?: string;
flow_action?: string;
flow_action_payload?: {
screen: string;
data?: {
[key: string]: string;
};
};
};
header?: {
type: 'text' | 'image' | 'video' | 'document';
document?: IWhatsappMedia;
image?: IWhatsappMedia;
text?: string;
video?: IWhatsappMedia;
};
body?: {
text: string;
};
footer?: {
text: string;
};
};
};

export type IWhatsappMedia = {
id?: string;
link?: string;
caption?: string;
filename?: string;
};

export interface IWhatsappSections {
product_items?: { product_retailer_id: string }[];
rows?: { id: string; title: string; description: string }[];
title?: string;
}

export interface IWhatsappComponent {
type: 'body' | 'header' | 'button';
sub_type?: 'quick_reply' | 'url' | 'catalog';
parameters: {
type: 'currency' | 'date_time' | 'document' | 'image' | 'text' | 'video';
text?: string;
currency?: {
fallback_value: string;
code: string;
amount_1000: number;
};
date_time?: {
fallback_value: string;
};
image?: IWhatsappMedia;
document?: IWhatsappMedia;
video?: IWhatsappMedia;
}[];
index?: number;
}

export interface IBulkEvents extends ITriggerPayloadOptions {
name: string;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
export enum WhatsAppMessageTypeEnum {
TEMPLATE = 'template',
TEXT = 'text',
INTERACTIVE = 'interactive',
IMAGE = 'image',
DOCUMENT = 'document',
VIDEO = 'video',
AUDIO = 'audio',
LOCATION = 'location',
CONTACTS = 'contacts',
STICKER = 'sticker',
}
Loading