diff --git a/components/hubspot/package.json b/components/hubspot/package.json index 67a7656a514fe..865207105bc6a 100644 --- a/components/hubspot/package.json +++ b/components/hubspot/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/hubspot", - "version": "1.2.0", + "version": "1.2.1", "description": "Pipedream Hubspot Components", "main": "hubspot.app.mjs", "keywords": [ diff --git a/components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs b/components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs index e724c5ac89bc2..f8d8526dc4a73 100644 --- a/components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs +++ b/components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs @@ -1,5 +1,7 @@ import common from "../common/common.mjs"; -import { DEFAULT_LIMIT } from "../../common/constants.mjs"; +import { + DEFAULT_LIMIT, DEFAULT_DEAL_PROPERTIES, API_PATH, +} from "../../common/constants.mjs"; import sampleEmit from "./test-event.mjs"; export default { @@ -7,7 +9,7 @@ export default { key: "hubspot-new-deal-in-stage", name: "New Deal In Stage", description: "Emit new event for each new deal in a stage.", - version: "0.0.26", + version: "0.0.27", dedupe: "unique", type: "source", props: { @@ -79,6 +81,7 @@ export default { direction: "DESCENDING", }, ], + properties: DEFAULT_DEAL_PROPERTIES, }, object: "deals", }; @@ -97,6 +100,9 @@ export default { for (const deal of results.results) { const ts = await this.getTs(deal); if (this.isRelevant(ts, after)) { + if (deal.properties.hubspot_owner_id) { + deal.properties.owner = await this.getOwner(deal.properties.hubspot_owner_id); + } this.emitEvent(deal, ts); if (ts > maxTs) { maxTs = ts; @@ -112,6 +118,12 @@ export default { await this.processDeals(params, after); } }, + getOwner(ownerId) { + return this.hubspot.makeRequest({ + api: API_PATH.CRMV3, + endpoint: `/owners/${ownerId}`, + }); + }, }, sampleEmit, }; diff --git a/components/hubspot/sources/new-deal-in-stage/test-event.mjs b/components/hubspot/sources/new-deal-in-stage/test-event.mjs index d165c9614c987..a38f602ba7d5f 100644 --- a/components/hubspot/sources/new-deal-in-stage/test-event.mjs +++ b/components/hubspot/sources/new-deal-in-stage/test-event.mjs @@ -2,15 +2,34 @@ export default { "id": "12388054600", "properties": { "amount": "1", - "closedate": "2024-06-24T16:37:59.812Z", + "closedate": "2025-05-07T17:08:33.843Z", "createdate": "2023-03-03T15:43:17.850Z", - "dealname": "deal1", - "dealstage": "closedwon", - "hs_lastmodifieddate": "2024-06-24T16:38:00.660Z", + "dealname": "deal", + "dealtype": "existingbusiness", + "description": null, + "hs_forecast_amount": "1", + "hs_forecast_probability": null, + "hs_lastmodifieddate": "2025-05-07T17:08:39.305Z", + "hs_manual_forecast_category": null, + "hs_next_step": null, "hs_object_id": "12388054600", - "pipeline": "default" + "hubspot_owner_id": "41488296", + "hubspot_team_id": null, + "num_associated_contacts": "0", + "owner": { + "id": "41488296", + "email": "", + "type": "PERSON", + "firstName": "", + "lastName": "", + "userId": 9555737, + "userIdIncludingInactive": 9555737, + "createdAt": "2019-12-18T20:08:52.952Z", + "updatedAt": "2025-02-04T16:53:50.082Z", + "archived": false + } }, "createdAt": "2023-03-03T15:43:17.850Z", - "updatedAt": "2024-06-24T16:38:00.660Z", + "updatedAt": "2025-05-07T17:08:39.305Z", "archived": false } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 80e973774d94e..647d11391c095 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2112,8 +2112,7 @@ importers: specifier: ^1.6.0 version: 1.6.6 - components/catch_all_verifier: - specifiers: {} + components/catch_all_verifier: {} components/cats: dependencies: @@ -9920,8 +9919,7 @@ importers: components/planning_center: {} - components/planpoint: - specifiers: {} + components/planpoint: {} components/planso_forms: {} @@ -15315,14 +15313,6 @@ importers: specifier: ^6.0.0 version: 6.2.0 - modelcontextprotocol/node_modules2/@modelcontextprotocol/sdk/dist/cjs: {} - - modelcontextprotocol/node_modules2/@modelcontextprotocol/sdk/dist/esm: {} - - modelcontextprotocol/node_modules2/zod-to-json-schema/dist/cjs: {} - - modelcontextprotocol/node_modules2/zod-to-json-schema/dist/esm: {} - packages/browsers: dependencies: '@sparticuz/chromium':