-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from NangoHQ/hubspot-deals
feat(hubspot-groundwork): add deals and fetch properties to make it easier to work with
- Loading branch information
Showing
16 changed files
with
10,669 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { NangoAction, ProxyConfiguration, CreateDeal, CreatedDeal } from '../../models'; | ||
|
||
export default async function runAction(nango: NangoAction, input: CreateDeal): Promise<CreatedDeal> { | ||
const config: ProxyConfiguration = { | ||
// https://developers.hubspot.com/docs/api/crm/deals | ||
endpoint: 'crm/v3/objects/deals', | ||
data: input, | ||
retries: 10 | ||
}; | ||
const response = await nango.post(config); | ||
|
||
return response.data; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { NangoAction, ProxyConfiguration, PropertyResponse, InputProperty } from '../../models'; | ||
|
||
export default async function runAction(nango: NangoAction, input: InputProperty): Promise<PropertyResponse> { | ||
if (!input.name) { | ||
throw new nango.ActionError({ | ||
message: 'An object name must be passed in to look up the properties' | ||
}); | ||
} | ||
|
||
const config: ProxyConfiguration = { | ||
// https://developers.hubspot.com/docs/api/crm/deals | ||
endpoint: `crm/v3/properties/${input.name}`, | ||
retries: 10 | ||
}; | ||
const response = await nango.get(config); | ||
|
||
return response.data; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"properties": { | ||
"dealname": "Test deal 1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "deals" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"properties": { | ||
"dealname": "Test deal 1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"id": "20858667708", | ||
"properties": { | ||
"createdate": "2024-10-02T19:29:34.520Z", | ||
"days_to_close": "0", | ||
"dealname": "Test deal 1", | ||
"hs_closed_amount": "0", | ||
"hs_closed_amount_in_home_currency": "0", | ||
"hs_closed_won_count": "0", | ||
"hs_createdate": "2024-10-02T19:29:34.520Z", | ||
"hs_days_to_close_raw": "0", | ||
"hs_deal_stage_probability_shadow": "0", | ||
"hs_is_closed_lost": "false", | ||
"hs_is_closed_won": "false", | ||
"hs_is_deal_split": "false", | ||
"hs_lastmodifieddate": "2024-10-02T19:29:34.520Z", | ||
"hs_object_id": "20858667708", | ||
"hs_object_source": "INTEGRATION", | ||
"hs_object_source_id": "3997414", | ||
"hs_object_source_label": "INTEGRATION", | ||
"hs_projected_amount": "0", | ||
"hs_projected_amount_in_home_currency": "0" | ||
}, | ||
"createdAt": "2024-10-02T19:29:34.520Z", | ||
"updatedAt": "2024-10-02T19:29:34.520Z", | ||
"archived": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "deals" | ||
} |
Oops, something went wrong.