@pipedream/salesforce_rest_api 0.4.4 → 0.4.5

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.5",
4
4
  "description": "Pipedream Salesforce (REST API) Components",
5
5
  "main": "salesforce_rest_api.app.mjs",
6
6
  "keywords": [
@@ -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.2",
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) {