@pipedream/salesforce_rest_api 0.4.4 → 0.4.7

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Getting Started
2
2
 
3
- You can install the Pipedream Discord app in the [Accounts](https://pipedream.com/accounts) section of your account, or directly in a workflow.
3
+ You can install the Pipedream Salesforce app in the [Accounts](https://pipedream.com/accounts) section of your account, or directly in a workflow.
4
4
 
5
5
  ### Webhooks
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/salesforce_rest_api",
3
- "version": "0.4.4",
3
+ "version": "0.4.7",
4
4
  "description": "Pipedream Salesforce (REST API) Components",
5
5
  "main": "salesforce_rest_api.app.mjs",
6
6
  "keywords": [
@@ -11,11 +11,11 @@
11
11
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
12
12
  "license": "MIT",
13
13
  "dependencies": {
14
- "@pipedream/platform": "^0.9.0",
14
+ "@pipedream/platform": "^1.2.0",
15
15
  "handlebars": "^4.7.7",
16
16
  "lodash": "^4.17.21",
17
- "salesforce-webhooks": "^1.1.11",
18
- "lodash-es": "^4.17.21"
17
+ "lodash-es": "^4.17.21",
18
+ "salesforce-webhooks": "^1.1.11"
19
19
  },
20
20
  "gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535",
21
21
  "publishConfig": {
@@ -1,3 +1,4 @@
1
+ import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
1
2
  import salesforce from "../salesforce_rest_api.app.mjs";
2
3
 
3
4
  export default {
@@ -9,7 +10,7 @@ export default {
9
10
  timer: {
10
11
  type: "$.interface.timer",
11
12
  default: {
12
- intervalSeconds: 60 * 15, // 15 minutes
13
+ intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
13
14
  },
14
15
  },
15
16
  objectType: {
@@ -8,7 +8,7 @@ export default {
8
8
  name: "New Object (of Selectable Type)",
9
9
  key: "salesforce_rest_api-new-object",
10
10
  description: "Emit new event (at regular intervals) when an object of arbitrary type (selected as an input parameter by the user) is created. See [the docs](https://sforce.co/3yPSJZy) for more information.",
11
- version: "0.1.3",
11
+ version: "0.1.5",
12
12
  methods: {
13
13
  ...common.methods,
14
14
  isItemRelevant(item, startTimestamp, endTimestamp) {
@@ -1,5 +1,4 @@
1
1
  import startCase from "lodash/startCase.js";
2
-
3
2
  import common from "../common-instant.mjs";
4
3
 
5
4
  export default {
@@ -8,7 +7,29 @@ export default {
8
7
  name: "New Object (Instant, of Selectable Type)",
9
8
  key: "salesforce_rest_api-new-object-instant",
10
9
  description: "Emit new event immediately after an object of arbitrary type (selected as an input parameter by the user) is created",
11
- version: "0.1.1",
10
+ version: "0.1.3",
11
+ hooks: {
12
+ ...common.hooks,
13
+ async deploy() {
14
+ const objectType = this.objectType;
15
+ const nameField = await this.salesforce.getNameFieldForObjectType(objectType);
16
+ this.setNameField(nameField);
17
+
18
+ // emit hisorical events
19
+ const { recentItems } = await this.salesforce.listSObjectTypeIds(objectType);
20
+ const ids = recentItems.map((item) => item.Id);
21
+ for (const id of ids.slice(-25)) {
22
+ const object = await this.salesforce.getSObject(objectType, id);
23
+ const event = {
24
+ body: {
25
+ "New": object,
26
+ "UserId": id,
27
+ },
28
+ };
29
+ this.processEvent(event);
30
+ }
31
+ },
32
+ },
12
33
  methods: {
13
34
  ...common.methods,
14
35
  generateMeta(data) {
@@ -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. See Salesforce's guide on setting up [Outbound Messaging](https://sforce.co/3JbZJom). Set the Outbound Message's Endpoint URL to the endpoint of the created source. The \"Send Session ID\" option must be enabled for validating outbound messages from Salesforce.",
9
- version: "0.1.1",
9
+ version: "0.1.2",
10
10
  dedupe: "unique",
11
11
  props: {
12
12
  db: "$.service.db",
@@ -8,7 +8,7 @@ export default {
8
8
  name: "New Deleted Object (of Selectable Type)",
9
9
  key: "salesforce_rest_api-object-deleted",
10
10
  description: "Emit new event (at regular intervals) when an object of arbitrary type (selected as an input parameter by the user) is deleted. [See the docs](https://sforce.co/3msDDEE) for more information.",
11
- version: "0.1.3",
11
+ version: "0.1.5",
12
12
  methods: {
13
13
  ...common.methods,
14
14
  generateMeta(item) {
@@ -8,7 +8,7 @@ export default {
8
8
  name: "New Deleted Object (Instant, of Selectable Type)",
9
9
  key: "salesforce_rest_api-object-deleted-instant",
10
10
  description: "Emit new event immediately after an object of arbitrary type (selected as an input parameter by the user) is deleted",
11
- version: "0.1.1",
11
+ version: "0.1.2",
12
12
  methods: {
13
13
  ...common.methods,
14
14
  generateMeta(data) {
@@ -8,7 +8,7 @@ export default {
8
8
  name: "New Updated Object (of Selectable Type)",
9
9
  key: "salesforce_rest_api-object-updated",
10
10
  description: "Emit new event (at regular intervals) when an object of arbitrary type (selected as an input parameter by the user) is updated. [See the docs](https://sforce.co/3yPSJZy) for more information.",
11
- version: "0.1.3",
11
+ version: "0.1.5",
12
12
  methods: {
13
13
  ...common.methods,
14
14
  generateMeta(item) {
@@ -8,7 +8,7 @@ export default {
8
8
  name: "New Updated Object (Instant, of Selectable Type)",
9
9
  key: "salesforce_rest_api-object-updated-instant",
10
10
  description: "Emit new event immediately after an object of arbitrary type (selected as an input parameter by the user) is updated",
11
- version: "0.1.1",
11
+ version: "0.1.2",
12
12
  methods: {
13
13
  ...common.methods,
14
14
  generateMeta(data) {
@@ -15,7 +15,7 @@ export default {
15
15
  name: "New Updated Field on Record (of Selectable Type)",
16
16
  key: "salesforce_rest_api-updated-field-on-record",
17
17
  description: "Emit new event (at regular intervals) when a field of your choosing is updated on any record of a specified Salesforce object. Field history tracking must be enabled for the chosen field. See the docs on [field history tracking](https://sforce.co/3mtj0rF) and [history objects](https://sforce.co/3Fn4lWB) for more information.",
18
- version: "0.1.3",
18
+ version: "0.1.5",
19
19
  props: {
20
20
  ...common.props,
21
21
  objectType: {
@@ -9,7 +9,7 @@ export default {
9
9
  name: "New Updated Field on Record (Instant, of Selectable Type)",
10
10
  key: "salesforce_rest_api-updated-field-on-record-instant",
11
11
  description: "Emit new event immediately after a field of your choosing is updated on any record of a specified Salesforce object",
12
- version: "0.1.1",
12
+ version: "0.1.2",
13
13
  props: {
14
14
  ...common.props,
15
15
  field: {