@pipedream/salesforce_rest_api 1.11.4 → 1.11.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.
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "salesforce_rest_api-search-string",
|
|
5
5
|
name: "Search Object Records",
|
|
6
6
|
description: "Searches for records in an object using a parameterized search. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_search_parameterized_get.htm)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.8",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -40,6 +40,13 @@ export default {
|
|
|
40
40
|
],
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
|
+
methods: {
|
|
44
|
+
// constructs a url that users can copy into a browser to view the record in Salesforce
|
|
45
|
+
createBrowserUrl(baseUrl, url) {
|
|
46
|
+
return `${baseUrl.replace(".my.salesforce.com", ".lightning.force.com")}/lightning/r/${url.match(/sobjects\/([^/]+)\/([^/]+)/).slice(1)
|
|
47
|
+
.join("/")}/view`;
|
|
48
|
+
},
|
|
49
|
+
},
|
|
43
50
|
async run({ $ }) {
|
|
44
51
|
const {
|
|
45
52
|
sobjectType,
|
|
@@ -56,6 +63,7 @@ export default {
|
|
|
56
63
|
},
|
|
57
64
|
});
|
|
58
65
|
const resultsFound = response.searchRecords.length;
|
|
66
|
+
const baseUrl = this.salesforce._baseApiUrl();
|
|
59
67
|
response.searchRecords = response.searchRecords.map((record) => {
|
|
60
68
|
const url = record?.attributes?.url;
|
|
61
69
|
if (!url) return record;
|
|
@@ -63,7 +71,8 @@ export default {
|
|
|
63
71
|
...record,
|
|
64
72
|
attributes: {
|
|
65
73
|
...record.attributes,
|
|
66
|
-
url: `${
|
|
74
|
+
url: `${baseUrl}${url}`, // api url
|
|
75
|
+
browserUrl: this.createBrowserUrl(baseUrl, url),
|
|
67
76
|
},
|
|
68
77
|
};
|
|
69
78
|
});
|