Skip to content

Commit a47e0e7

Browse files
author
Olha Virolainen
authored
Fix out meta trigger (#36)
* Upgrade sailor version to 2.6.26 * Reduced the size of component icon file * Fix output metadata for `Get New and Updated Objects Polling` trigger * Fix output metadata for `Lookup Objects` action
1 parent 7749925 commit a47e0e7

File tree

13 files changed

+7584
-878
lines changed

13 files changed

+7584
-878
lines changed

.circleci/config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ jobs:
77
- checkout
88
- restore_cache:
99
key: dependency-cache-{{ checksum "package.json" }}
10-
- run:
11-
name: Audit Dependencies
12-
command: npm audit --audit-level=critical
1310
- run:
1411
name: Installing Dependencies
1512
command: npm install

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 2.2.1 (December 1, 2021)
2+
3+
* Upgrade sailor version to 2.6.26
4+
* Reduced the size of component icon file
5+
* Fix output metadata for `Get New and Updated Objects Polling` trigger
6+
* Fix output metadata for `Lookup Objects` action
7+
18
## 2.2.0 (August 20, 2021)
29

310
* New `Upsert Object` action

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"title": "Salesforce v2",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "Customer relationship management (CRM) software & cloud computing from the leader in CRM solutions for businesses large & small.",
55
"docsUrl": "https://github.com/elasticio/salesforce-component-v2",
66
"url": "http://www.salesforce.com/",

lib/actions/lookupObjects.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module.exports.getMetaModel = async function getMetaModel(configuration) {
5151
results: {
5252
type: 'array',
5353
required: true,
54-
properties: {},
54+
items: {},
5555
},
5656
},
5757
},
@@ -79,14 +79,19 @@ module.exports.getMetaModel = async function getMetaModel(configuration) {
7979
const objectFieldsMetaData = await callJSForceMethod.call(this, configuration, 'getObjectFieldsMetaData');
8080

8181
const filterableFields = [];
82+
const outObject = {};
8283
objectFieldsMetaData.forEach((field) => {
8384
if (!field.deprecatedAndHidden) {
8485
if (field.filterable && field.type !== 'address' && field.type !== 'location') { // Filter out compound fields
8586
filterableFields.push(field.label);
8687
}
87-
result.out.properties.results.properties[field.name] = createProperty(field);
88+
outObject[field.name] = createProperty(field);
8889
}
8990
});
91+
result.out.properties.results.items = {
92+
type: 'object',
93+
properties: outObject,
94+
};
9095

9196
filterableFields.sort();
9297

lib/entry.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,27 @@ module.exports.linkedObjectTypes = async function linkedObjectTypes(configuratio
1717
};
1818

1919
module.exports.getMetaModel = async function getMetaModel(configuration) {
20-
const meta = await callJSForceMethod.call(this, configuration, 'describe');
21-
return processMeta(meta, 'polling');
20+
const describeObject = await callJSForceMethod.call(this, configuration, 'describe');
21+
const metadata = await processMeta(describeObject, 'polling');
22+
const { outputMethod } = configuration;
23+
if (outputMethod === 'emitAll') {
24+
const outputArray = {
25+
type: 'object',
26+
required: true,
27+
properties: {
28+
records: {
29+
type: 'array',
30+
required: true,
31+
items: metadata.out,
32+
},
33+
},
34+
};
35+
return {
36+
in: metadata.in,
37+
out: outputArray,
38+
};
39+
}
40+
return metadata;
2241
};
2342

2443
module.exports.process = async function process(message, configuration, snapshot) {

logo.png

-365 Bytes
Loading

0 commit comments

Comments
 (0)