@@ -196,6 +196,24 @@ declare module 'closecrm-node' {
196196 [ key : string ] : any ;
197197 }
198198
199+ export interface WhatsAppMessage extends Activity {
200+ _type : 'WhatsAppMessage' ;
201+ external_whatsapp_message_id : string ;
202+ message_markdown : string ;
203+ message_html ?: string ;
204+ direction ?: 'incoming' | 'outgoing' ;
205+ status ?: string ;
206+ response_to_id ?: string ;
207+ integration_link ?: string ;
208+ attachments ?: Array < {
209+ url : string ;
210+ filename : string ;
211+ content_type : string ;
212+ size ?: number ;
213+ } > ;
214+ [ key : string ] : any ;
215+ }
216+
199217 export interface Task {
200218 id : string ;
201219 lead_id ?: string ;
@@ -221,13 +239,41 @@ declare module 'closecrm-node' {
221239 accepts_multiple_values ?: boolean ;
222240 editable_with_roles ?: string [ ] ;
223241 required ?: boolean ;
242+ custom_object_type_id ?: string ;
224243 organization_id : string ;
225244 created_by ?: string ;
226245 date_created : string ;
227246 date_updated : string ;
228247 [ key : string ] : any ;
229248 }
230249
250+ export interface CustomObjectType {
251+ id : string ;
252+ name : string ;
253+ name_plural : string ;
254+ description ?: string ;
255+ api_create_only ?: boolean ;
256+ editable_with_roles ?: string [ ] ;
257+ fields ?: CustomField [ ] ;
258+ back_reference_fields ?: CustomField [ ] ;
259+ organization_id : string ;
260+ date_created : string ;
261+ date_updated : string ;
262+ [ key : string ] : any ;
263+ }
264+
265+ export interface CustomObject {
266+ id : string ;
267+ custom_object_type_id : string ;
268+ lead_id : string ;
269+ name : string ;
270+ custom ?: Record < string , any > ;
271+ date_created : string ;
272+ date_updated : string ;
273+ organization_id : string ;
274+ [ key : string ] : any ;
275+ }
276+
231277 export interface User {
232278 id : string ;
233279 email : string ;
@@ -438,13 +484,22 @@ declare module 'closecrm-node' {
438484 delete ( id : string ) : Promise < void > ;
439485 }
440486
487+ export interface WhatsAppMessageResource {
488+ search ( options ?: SearchOptions ) : Promise < PaginatedResponse < WhatsAppMessage > > ;
489+ create ( data : Partial < WhatsAppMessage > , queryParams ?: { send_to_inbox ?: boolean } ) : Promise < WhatsAppMessage > ;
490+ read ( id : string ) : Promise < WhatsAppMessage > ;
491+ update ( id : string , data : Partial < WhatsAppMessage > ) : Promise < WhatsAppMessage > ;
492+ delete ( id : string ) : Promise < void > ;
493+ }
494+
441495 export interface ActivityResource {
442496 search ( options ?: SearchOptions ) : Promise < PaginatedResponse < Activity > > ;
443497 note : NoteResource ;
444498 email : EmailResource ;
445499 call : CallResource ;
446500 sms : SMSResource ;
447501 meeting : MeetingResource ;
502+ whatsapp_message : WhatsAppMessageResource ;
448503 }
449504
450505 export interface OpportunityResource {
@@ -476,6 +531,7 @@ declare module 'closecrm-node' {
476531 contact : CustomFieldSubResource ;
477532 opportunity : CustomFieldSubResource ;
478533 activity : CustomFieldSubResource ;
534+ custom_object_type : CustomFieldSubResource ;
479535 }
480536
481537 export interface CustomActivityResource {
@@ -486,6 +542,22 @@ declare module 'closecrm-node' {
486542 delete ( type : string , id : string ) : Promise < void > ;
487543 }
488544
545+ export interface CustomObjectTypeResource {
546+ list ( options ?: SearchOptions ) : Promise < PaginatedResponse < CustomObjectType > > ;
547+ create ( data : Partial < CustomObjectType > ) : Promise < CustomObjectType > ;
548+ read ( id : string ) : Promise < CustomObjectType > ;
549+ update ( id : string , data : Partial < CustomObjectType > ) : Promise < CustomObjectType > ;
550+ delete ( id : string ) : Promise < void > ;
551+ }
552+
553+ export interface CustomObjectResource {
554+ list ( options ?: SearchOptions ) : Promise < PaginatedResponse < CustomObject > > ;
555+ create ( data : Partial < CustomObject > ) : Promise < CustomObject > ;
556+ read ( id : string ) : Promise < CustomObject > ;
557+ update ( id : string , data : Partial < CustomObject > ) : Promise < CustomObject > ;
558+ delete ( id : string ) : Promise < void > ;
559+ }
560+
489561 export interface UserResource {
490562 me ( ) : Promise < User > ;
491563 list ( options ?: SearchOptions ) : Promise < PaginatedResponse < User > > ;
@@ -553,8 +625,87 @@ declare module 'closecrm-node' {
553625 }
554626
555627 export interface ReportResource {
556- list ( options ?: SearchOptions ) : Promise < PaginatedResponse < Report > > ;
557- read ( id : string , options ?: SearchOptions ) : Promise < Report > ;
628+ // List predefined metrics used in activity reports
629+ activity_metrics ( ) : Promise < PaginatedResponse < any > > ;
630+
631+ // Get an activity report
632+ activity ( data : {
633+ datetime_range ?: { start : string ; end : string } ;
634+ relative_range ?: string ;
635+ query ?: any ;
636+ users ?: string [ ] ;
637+ type : 'overview' | 'comparison' ;
638+ metrics : string [ ] ;
639+ } ) : Promise < any > ;
640+
641+ // Get sent emails report grouped by template
642+ sent_emails ( organizationId : string , options ?: {
643+ user_id ?: string ;
644+ date_start ?: string ;
645+ date_end ?: string ;
646+ } ) : Promise < any > ;
647+
648+ // Get lead status change report
649+ lead_statuses ( organizationId : string , options ?: {
650+ date_start ?: string ;
651+ date_end ?: string ;
652+ query ?: string ;
653+ smart_view_id ?: string ;
654+ } ) : Promise < any > ;
655+
656+ // Get opportunity status change report
657+ opportunity_statuses ( organizationId : string , options ?: {
658+ user_id ?: string ;
659+ date_start ?: string ;
660+ date_end ?: string ;
661+ query ?: string ;
662+ smart_view_id ?: string ;
663+ } ) : Promise < any > ;
664+
665+ // Get custom report
666+ custom ( organizationId : string , options ?: {
667+ query ?: string ;
668+ x ?: string ;
669+ y ?: string ;
670+ interval ?: string ;
671+ transform_y ?: 'sum' | 'avg' | 'min' | 'max' ;
672+ group_by ?: string ;
673+ start ?: string ;
674+ end ?: string ;
675+ } ) : Promise < any > ;
676+
677+ // Get custom report fields
678+ custom_fields ( ) : Promise < any > ;
679+
680+ // Get opportunity funnel report (totals)
681+ funnel_totals ( data : {
682+ pipeline : string ;
683+ type : 'created-cohort' | 'active-stage-cohort' ;
684+ report_relative_range ?: string ;
685+ report_datetime_range ?: { start : string ; end : string } ;
686+ cohort_relative_range ?: string ;
687+ cohort_datetime_range ?: { start : string ; end : string } ;
688+ compared_relative_range ?: string ;
689+ compared_datetime_range ?: string ;
690+ compared_custom_range ?: { start : string ; end : string } ;
691+ query ?: any ;
692+ users ?: string [ ] ;
693+ } ) : Promise < any > ;
694+
695+ // Get opportunity funnel report (stages)
696+ funnel_stages ( data : {
697+ pipeline : string ;
698+ type : 'created-cohort' | 'active-stage-cohort' ;
699+ report_relative_range ?: string ;
700+ report_datetime_range ?: { start : string ; end : string } ;
701+ cohort_relative_range ?: string ;
702+ cohort_datetime_range ?: { start : string ; end : string } ;
703+ compared_relative_range ?: string ;
704+ compared_datetime_range ?: string ;
705+ compared_custom_range ?: { start : string ; end : string } ;
706+ query ?: any ;
707+ users ?: string [ ] ;
708+ } ) : Promise < any > ;
558709 }
559710
560711 export interface EventResource {
@@ -618,6 +769,8 @@ declare module 'closecrm-node' {
618769 task : TaskResource ;
619770 custom_field : CustomFieldResource ;
620771 custom_activity : CustomActivityResource ;
772+ custom_object_type : CustomObjectTypeResource ;
773+ custom_object : CustomObjectResource ;
621774 user : UserResource ;
622775 organization : OrganizationResource ;
623776 pipeline : PipelineResource ;
0 commit comments