From 3742e0d03e4dd17eeaeaa8334a57f453c8a2a4f8 Mon Sep 17 00:00:00 2001 From: d-klotz Date: Tue, 9 Jun 2026 18:43:42 -0300 Subject: [PATCH] fix(hubspot): align getToken + getEntityDetails with current core contract MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getToken reads the OAuth code from params.code (current core passes it unwrapped). getEntityDetails returns the `user` identifier instead of `userId` so core's findOrCreateEntity create-path persists the right key — the lookup path already normalizes user||userId, and getCredentialDetails keeps userId. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/v1-ready/hubspot/definition.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/v1-ready/hubspot/definition.js b/packages/v1-ready/hubspot/definition.js index b524662..c507756 100644 --- a/packages/v1-ready/hubspot/definition.js +++ b/packages/v1-ready/hubspot/definition.js @@ -12,13 +12,13 @@ const Definition = { modelName: 'HubSpot', requiredAuthMethods: { getToken: async function (api, params) { - const code = get(params.data, 'code'); + const code = get(params, 'code'); return api.getTokenFromCode(code); }, getEntityDetails: async function (api, callbackParams, tokenResponse, userId) { const userDetails = await api.getUserDetails(); return { - identifiers: {externalId: String(userDetails.portalId), userId}, + identifiers: {externalId: String(userDetails.portalId), user: userId}, details: {name: userDetails.hub_domain}, } },