@pipedream/salesforce_rest_api 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/sources/case-updated-instant/case-updated-instant.mjs +1 -1
- package/sources/common/common-updated-record.mjs +14 -13
- package/sources/common/common.mjs +8 -0
- package/sources/email-template-updated-instant/email-template-updated-instant.mjs +1 -1
- package/sources/knowledge-article-updated-instant/knowledge-article-updated-instant.mjs +1 -1
- package/sources/new-case-instant/new-case-instant.mjs +1 -1
- package/sources/new-email-template-instant/new-email-template-instant.mjs +1 -1
- package/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs +1 -1
- package/sources/new-outbound-message/new-outbound-message.mjs +1 -1
- package/sources/new-record-instant/new-record-instant.mjs +1 -1
- package/sources/record-deleted-instant/record-deleted-instant.mjs +1 -1
- package/sources/record-updated-instant/record-updated-instant.mjs +8 -1
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "Case Updated (Instant, of Selectable Type)",
|
|
8
8
|
key: "salesforce_rest_api-case-updated-instant",
|
|
9
9
|
description: "Emit new event when a case is updated. [See the documentation](https://sforce.co/3yPSJZy)",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.4",
|
|
11
11
|
props: {
|
|
12
12
|
salesforce: common.props.salesforce,
|
|
13
13
|
db: "$.service.db",
|
|
@@ -12,19 +12,20 @@ export default {
|
|
|
12
12
|
const nameField = await this.salesforce.getNameFieldForObjectType(objectType);
|
|
13
13
|
this.setNameField(nameField);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
if (!this.skipFirstRun) {
|
|
16
|
+
const { recentItems } = await this.salesforce.listSObjectTypeIds(objectType);
|
|
17
|
+
const ids = recentItems.map((item) => item.Id);
|
|
18
|
+
for (const id of ids.slice(-25)) {
|
|
19
|
+
const object = await this.salesforce.getSObject(objectType, id);
|
|
20
|
+
const event = {
|
|
21
|
+
body: {
|
|
22
|
+
"New": object,
|
|
23
|
+
"UserId": id,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
const meta = this.generateWebhookMeta(event);
|
|
27
|
+
this.$emit(event.body, meta);
|
|
28
|
+
}
|
|
28
29
|
}
|
|
29
30
|
},
|
|
30
31
|
async activate() {
|
|
@@ -165,7 +165,15 @@ export default {
|
|
|
165
165
|
console.log("Ignoring timer event (webhook active)");
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
|
+
|
|
168
169
|
const startTimestamp = this.getLatestDateCovered();
|
|
170
|
+
|
|
171
|
+
if (this.skipFirstRun && !startTimestamp) {
|
|
172
|
+
const now = new Date().toISOString();
|
|
173
|
+
this.setLatestDateCovered(now);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
|
|
169
177
|
const endTimestamp = new Date(event.timestamp * 1000).toISOString();
|
|
170
178
|
const timeDiffSec = Math.floor(
|
|
171
179
|
(Date.parse(endTimestamp) - Date.parse(startTimestamp)) / 1000,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "Email Template Updated (Instant, of Selectable Type)",
|
|
8
8
|
key: "salesforce_rest_api-email-template-updated-instant",
|
|
9
9
|
description: "Emit new event when an email template is updated. [See the documentation](https://sforce.co/3yPSJZy)",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.4",
|
|
11
11
|
props: {
|
|
12
12
|
salesforce: common.props.salesforce,
|
|
13
13
|
db: "$.service.db",
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "Knowledge Article Updated (Instant, of Selectable Type)",
|
|
8
8
|
key: "salesforce_rest_api-knowledge-article-updated-instant",
|
|
9
9
|
description: "Emit new event when a knowledge article is updated. [See the documentation](https://sforce.co/3yPSJZy)",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.4",
|
|
11
11
|
props: {
|
|
12
12
|
salesforce: common.props.salesforce,
|
|
13
13
|
db: "$.service.db",
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "New Case (Instant, of Selectable Type)",
|
|
8
8
|
key: "salesforce_rest_api-new-case-instant",
|
|
9
9
|
description: "Emit new event when a case is created. [See the documentation](https://sforce.co/3yPSJZy)",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.4",
|
|
11
11
|
props: {
|
|
12
12
|
salesforce: common.props.salesforce,
|
|
13
13
|
db: "$.service.db",
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "New Email Template (Instant, of Selectable Type)",
|
|
8
8
|
key: "salesforce_rest_api-new-email-template-instant",
|
|
9
9
|
description: "Emit new event when an email template is created. [See the documentation](https://sforce.co/3yPSJZy)",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.4",
|
|
11
11
|
props: {
|
|
12
12
|
salesforce: common.props.salesforce,
|
|
13
13
|
db: "$.service.db",
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "New Knowledge Article (Instant, of Selectable Type)",
|
|
8
8
|
key: "salesforce_rest_api-new-knowledge-article-instant",
|
|
9
9
|
description: "Emit new event when a knowledge article is created. [See the documentation](https://sforce.co/3yPSJZy)",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.4",
|
|
11
11
|
props: {
|
|
12
12
|
salesforce: common.props.salesforce,
|
|
13
13
|
db: "$.service.db",
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
name: "New Outbound Message (Instant)",
|
|
7
7
|
key: "salesforce_rest_api-new-outbound-message",
|
|
8
8
|
description: "Emit new event when a new outbound message is received in Salesforce.",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.10",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
12
|
db: "$.service.db",
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
name: "New Record (Instant, of Selectable Type)",
|
|
7
7
|
key: "salesforce_rest_api-new-record-instant",
|
|
8
8
|
description: "Emit new event when a record of the selected object type is created. [See the documentation](https://sforce.co/3yPSJZy)",
|
|
9
|
-
version: "0.2.
|
|
9
|
+
version: "0.2.4",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
12
12
|
fieldsToObtain: {
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "New Deleted Record (Instant, of Selectable Type)",
|
|
8
8
|
key: "salesforce_rest_api-record-deleted-instant",
|
|
9
9
|
description: "Emit new event when a record of the selected object type is deleted. [See the documentation](https://sforce.co/3msDDEE)",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.4",
|
|
11
11
|
methods: {
|
|
12
12
|
...common.methods,
|
|
13
13
|
generateWebhookMeta(data) {
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "New Updated Record (Instant, of Selectable Type)",
|
|
8
8
|
key: "salesforce_rest_api-record-updated-instant",
|
|
9
9
|
description: "Emit new event when a record of the selected type is updated. [See the documentation](https://sforce.co/3yPSJZy)",
|
|
10
|
-
version: "0.2.
|
|
10
|
+
version: "0.2.4",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
13
13
|
fields: {
|
|
@@ -24,6 +24,13 @@ export default {
|
|
|
24
24
|
optional: true,
|
|
25
25
|
description: "If specified, events will only be emitted if at least one of the selected fields is updated. This filter is only available when a webhook is created successfully.",
|
|
26
26
|
},
|
|
27
|
+
skipFirstRun: {
|
|
28
|
+
type: "boolean",
|
|
29
|
+
label: "Skip existing records when first activated",
|
|
30
|
+
description: "When enabled, this trigger will ignore all existing records and only watch for updates that happen after activation. When disabled, it will process existing records on first run.",
|
|
31
|
+
optional: true,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
27
34
|
},
|
|
28
35
|
methods: {
|
|
29
36
|
...common.methods,
|