Skip to content

Commit 73b42db

Browse files
committed
fix(hubspot): address review comments
- Forward the properties param for the Get Users operation (block param mapping + Properties-to-Return field now include get_users) - Use Record<string, unknown> for create_note/create_email request bodies - Only send Content-Type on create_association when a body is sent (default-association PUT has no body) - Remove stray duplicate JSDoc opener in types.ts
1 parent e15da0e commit 73b42db

5 files changed

Lines changed: 9 additions & 5 deletions

File tree

apps/sim/blocks/blocks/hubspot.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ Return ONLY the JSON object with properties - no explanations, no markdown, no e
509509
'get_quotes',
510510
'get_appointments',
511511
'get_carts',
512+
'get_users',
512513
],
513514
},
514515
},
@@ -1301,6 +1302,7 @@ Return ONLY the JSON array of property names - no explanations, no markdown, no
13011302
'get_quotes',
13021303
'get_appointments',
13031304
'get_carts',
1305+
'get_users',
13041306
]
13051307
if (properties && !searchProperties && getListOps.includes(operation as string)) {
13061308
cleanParams.properties = properties

apps/sim/tools/hubspot/create_association.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,13 @@ export const hubspotCreateAssociationTool: ToolConfig<
8484
throw new Error('Access token is required')
8585
}
8686

87-
return {
87+
const headers: Record<string, string> = {
8888
Authorization: `Bearer ${params.accessToken}`,
89-
'Content-Type': 'application/json',
9089
}
90+
if (params.associationTypeId != null) {
91+
headers['Content-Type'] = 'application/json'
92+
}
93+
return headers
9194
},
9295
body: (params) => {
9396
if (params.associationTypeId == null) {

apps/sim/tools/hubspot/create_email.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const hubspotCreateEmailTool: ToolConfig<
6666
}
6767
}
6868

69-
const body: any = {
69+
const body: Record<string, unknown> = {
7070
properties,
7171
}
7272

apps/sim/tools/hubspot/create_note.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const hubspotCreateNoteTool: ToolConfig<HubSpotCreateNoteParams, HubSpotC
6666
}
6767
}
6868

69-
const body: any = {
69+
const body: Record<string, unknown> = {
7070
properties,
7171
}
7272

apps/sim/tools/hubspot/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,6 @@ export const LISTS_ARRAY_OUTPUT: OutputProperty = {
678678
},
679679
}
680680

681-
/**
682681
/**
683682
* Common note properties returned by HubSpot API.
684683
* @see https://developers.hubspot.com/docs/api-reference/crm-notes-v3

0 commit comments

Comments
 (0)