From e20c322986d3d315ce8b0bb181d0eac3051ef6e3 Mon Sep 17 00:00:00 2001 From: Jorge Cortes Date: Thu, 6 Nov 2025 16:20:10 -0500 Subject: [PATCH] [FIX] Inconsistent event format between deploy-time and real-time events --- components/salesforce_rest_api/package.json | 2 +- .../sources/common/common-new-record.mjs | 15 +++++---------- .../sources/new-case-instant/new-case-instant.mjs | 2 +- .../new-email-template-instant.mjs | 2 +- .../new-knowledge-article-instant.mjs | 2 +- .../new-record-instant/new-record-instant.mjs | 2 +- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/components/salesforce_rest_api/package.json b/components/salesforce_rest_api/package.json index 320a741b9eded..8c1de6751c419 100644 --- a/components/salesforce_rest_api/package.json +++ b/components/salesforce_rest_api/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/salesforce_rest_api", - "version": "1.10.0", + "version": "1.10.1", "description": "Pipedream Salesforce (REST API) Components", "main": "salesforce_rest_api.app.mjs", "keywords": [ diff --git a/components/salesforce_rest_api/sources/common/common-new-record.mjs b/components/salesforce_rest_api/sources/common/common-new-record.mjs index 157458a695b6b..1316f01bdfafb 100644 --- a/components/salesforce_rest_api/sources/common/common-new-record.mjs +++ b/components/salesforce_rest_api/sources/common/common-new-record.mjs @@ -15,14 +15,10 @@ export default { const { recentItems } = await this.salesforce.listSObjectTypeIds(objectType); const ids = recentItems.map((item) => item.Id); for (const id of ids.slice(-25)) { - const object = await this.salesforce.getSObject(objectType, id); - const event = { - body: { - "New": object, - "UserId": id, - }, - }; - this.processWebhookEvent(event); + const body = await this.salesforce.getSObject(objectType, id); + this.processWebhookEvent({ + body, + }); } }, async activate() { @@ -80,12 +76,11 @@ export default { }, generateWebhookMeta(data) { const nameField = this.getNameField(); - const { New: newObject } = data.body; const { CreatedDate: createdDate, Id: id, [nameField]: name, - } = newObject; + } = data.body; const summary = `New ${this.getObjectType()} created: ${name ?? id}`; const ts = Date.parse(createdDate); return { diff --git a/components/salesforce_rest_api/sources/new-case-instant/new-case-instant.mjs b/components/salesforce_rest_api/sources/new-case-instant/new-case-instant.mjs index 690b675596006..3daf44a077dc6 100644 --- a/components/salesforce_rest_api/sources/new-case-instant/new-case-instant.mjs +++ b/components/salesforce_rest_api/sources/new-case-instant/new-case-instant.mjs @@ -7,7 +7,7 @@ export default { name: "New Case (Instant, of Selectable Type)", key: "salesforce_rest_api-new-case-instant", description: "Emit new event when a case is created. [See the documentation](https://sforce.co/3yPSJZy)", - version: "0.0.5", + version: "0.0.6", props: { salesforce: common.props.salesforce, db: "$.service.db", diff --git a/components/salesforce_rest_api/sources/new-email-template-instant/new-email-template-instant.mjs b/components/salesforce_rest_api/sources/new-email-template-instant/new-email-template-instant.mjs index 45fa374f93c92..6bf6a1cad8c2e 100644 --- a/components/salesforce_rest_api/sources/new-email-template-instant/new-email-template-instant.mjs +++ b/components/salesforce_rest_api/sources/new-email-template-instant/new-email-template-instant.mjs @@ -7,7 +7,7 @@ export default { name: "New Email Template (Instant, of Selectable Type)", key: "salesforce_rest_api-new-email-template-instant", description: "Emit new event when an email template is created. [See the documentation](https://sforce.co/3yPSJZy)", - version: "0.0.5", + version: "0.0.6", props: { salesforce: common.props.salesforce, db: "$.service.db", diff --git a/components/salesforce_rest_api/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs b/components/salesforce_rest_api/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs index 02399a6246aca..42a27e2cbc692 100644 --- a/components/salesforce_rest_api/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs +++ b/components/salesforce_rest_api/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs @@ -7,7 +7,7 @@ export default { name: "New Knowledge Article (Instant, of Selectable Type)", key: "salesforce_rest_api-new-knowledge-article-instant", description: "Emit new event when a knowledge article is created. [See the documentation](https://sforce.co/3yPSJZy)", - version: "0.0.5", + version: "0.0.6", props: { salesforce: common.props.salesforce, db: "$.service.db", diff --git a/components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs b/components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs index 85feb7fd44e1c..2ddec437820fa 100644 --- a/components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs +++ b/components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs @@ -6,7 +6,7 @@ export default { name: "New Record (Instant, of Selectable Type)", key: "salesforce_rest_api-new-record-instant", description: "Emit new event when a record of the selected object type is created. [See the documentation](https://sforce.co/3yPSJZy)", - version: "0.2.5", + version: "0.2.6", props: { ...common.props, fieldsToObtain: {