@pipedream/salesforce_rest_api 1.3.0 → 1.3.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
CHANGED
|
@@ -7,7 +7,21 @@ export default {
|
|
|
7
7
|
name: "New Record (Instant, of Selectable Type)",
|
|
8
8
|
key: "salesforce_rest_api-new-record-instant",
|
|
9
9
|
description: "Emit new event when a record of the selected object type is created. [See the documentation](https://sforce.co/3yPSJZy)",
|
|
10
|
-
version: "0.
|
|
10
|
+
version: "0.2.0",
|
|
11
|
+
props: {
|
|
12
|
+
...common.props,
|
|
13
|
+
fieldsToObtain: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
common.props.salesforce,
|
|
16
|
+
"fieldsToObtain",
|
|
17
|
+
(c) => ({
|
|
18
|
+
objType: c.objectType,
|
|
19
|
+
}),
|
|
20
|
+
],
|
|
21
|
+
optional: true,
|
|
22
|
+
description: "Select the field(s) to be retrieved for the records. Only applicable if the source is running on a timer. If running on a webhook, or if not specified, all fields will be retrieved.",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
11
25
|
hooks: {
|
|
12
26
|
...common.hooks,
|
|
13
27
|
async deploy() {
|
|
@@ -40,7 +54,7 @@ export default {
|
|
|
40
54
|
Id: id,
|
|
41
55
|
} = item;
|
|
42
56
|
const entityType = startCase(objectType);
|
|
43
|
-
const summary = `New ${entityType} created: ${name}`;
|
|
57
|
+
const summary = `New ${entityType} created: ${name ?? id}`;
|
|
44
58
|
const ts = Date.parse(createdDate);
|
|
45
59
|
return {
|
|
46
60
|
id,
|
|
@@ -57,7 +71,7 @@ export default {
|
|
|
57
71
|
[nameField]: name,
|
|
58
72
|
} = newObject;
|
|
59
73
|
const entityType = startCase(this.objectType).toLowerCase();
|
|
60
|
-
const summary = `New ${entityType} created: ${name}`;
|
|
74
|
+
const summary = `New ${entityType} created: ${name ?? id}`;
|
|
61
75
|
const ts = Date.parse(createdDate);
|
|
62
76
|
return {
|
|
63
77
|
id,
|
|
@@ -118,8 +132,11 @@ export default {
|
|
|
118
132
|
setObjectTypeColumns,
|
|
119
133
|
} = this;
|
|
120
134
|
|
|
121
|
-
|
|
122
|
-
|
|
135
|
+
let columns = this.fieldsToObtain;
|
|
136
|
+
if (!columns?.length) {
|
|
137
|
+
const { fields } = await getObjectTypeDescription(objectType);
|
|
138
|
+
columns = fields.map(({ name }) => name);
|
|
139
|
+
}
|
|
123
140
|
|
|
124
141
|
setObjectTypeColumns(columns);
|
|
125
142
|
},
|