File tree Expand file tree Collapse file tree 4 files changed +47
-6
lines changed Expand file tree Collapse file tree 4 files changed +47
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @vesselapi/integrations" ,
3- "version" : " 0.0.75 " ,
3+ "version" : " 0.0.76 " ,
44 "description" : " Vessel integrations" ,
55 "main" : " dist/index.js" ,
66 "module" : " dist/index.mjs" ,
Original file line number Diff line number Diff line change 1+ import { action } from '@/sdk' ;
2+ import { z } from 'zod' ;
3+ import client from '../../client' ;
4+
5+ export default action (
6+ 'calls-dispositions' ,
7+ {
8+ operation : 'dispositions' ,
9+ resource : 'calls' ,
10+ mutation : false ,
11+ schema : z . object ( { } ) ,
12+ scopes : [ ] ,
13+ } ,
14+ async ( { auth } ) => {
15+ const result = await client . calls . dispositions ( auth , { } ) ;
16+ return {
17+ result : {
18+ dispositions : result . data . map ( ( disposition ) => ( {
19+ id : disposition . id ,
20+ label : disposition . label ,
21+ } ) ) ,
22+ } ,
23+ $native : result . $native ,
24+ } ;
25+ } ,
26+ ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import * as z from 'zod';
55import { API_VERSION , BASE_URL , HUBSPOT_MAX_PAGE_SIZE } from './constants' ;
66import {
77 BatchReadObjectInput ,
8+ callDispositionsSchema ,
89 callProperties ,
910 companyProperties ,
1011 contactProperties ,
@@ -241,11 +242,18 @@ const makeClient = () => {
241242 hubspotEmailSchema ,
242243 emailProperties ,
243244 ) ,
244- calls : crud < HubspotCallCreate , HubspotCallUpdate , HubspotCall > (
245- 'objects/calls' ,
246- hubspotCallSchema ,
247- callProperties ,
248- ) ,
245+ calls : {
246+ ...crud < HubspotCallCreate , HubspotCallUpdate , HubspotCall > (
247+ 'objects/calls' ,
248+ hubspotCallSchema ,
249+ callProperties ,
250+ ) ,
251+ dispositions : request ( ( { } ) => ( {
252+ url : `/calling/v1/dispositions` ,
253+ method : 'GET' ,
254+ schema : callDispositionsSchema ,
255+ } ) ) ,
256+ } ,
249257 // HubSpot only has support for contact lists in v1 of the API
250258 contactLists : {
251259 find : request ( ( { id } : { id : string } ) => ( {
Original file line number Diff line number Diff line change @@ -410,6 +410,13 @@ export type HubspotEmailUpdate = z.infer<typeof hubspotEmailUpdateSchema> & {
410410// -
411411// Calls
412412// -
413+ export const callDispositionsSchema = z . array (
414+ z . object ( {
415+ label : z . string ( ) ,
416+ id : z . string ( ) ,
417+ } ) ,
418+ ) ;
419+
413420const callPropertiesSchema = z
414421 . object ( {
415422 hs_call_disposition : z . string ( ) ,
You can’t perform that action at this time.
0 commit comments