Skip to content

Commit

Permalink
Merge pull request #60 from Stwissel/develop
Browse files Browse the repository at this point in the history
Dependency updates
  • Loading branch information
Stwissel authored Jan 16, 2023
2 parents 335f2e1 + 4a34718 commit 6cb4d29
Show file tree
Hide file tree
Showing 6 changed files with 10,467 additions and 3,243 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/codecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Compile and Test
on:
push:
branches:
- main
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- run: npm install
- run: npm test
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
19 changes: 19 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish Package to npmjs
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- run: npm install
- run: npm test
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.8.0

- Node & NodeRed versions updated
- nforce8 v 2.1.0
- dependency updates

## 0.7.0

- All event types are now supported
Expand Down
18 changes: 13 additions & 5 deletions dml.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const handleInput = (node, msg) => {
break;
case 'upsert':
if (msg.hasOwnProperty('externalId')) {
sobj.sobject.setExternalId(msg.externalId.field, msg.externalId.value);
sobj.setExternalId(msg.externalId.field, msg.externalId.value);
}
dmlResult = org.upsert(payload);
break;
Expand All @@ -46,11 +46,19 @@ const handleInput = (node, msg) => {

dmlResult
.then((sfdcResult) => {
// Find the best id
let id = msg.payload.id;
if (sfdcResult.id) {
id = sfdcResult.id;
} else if (msg.externalId) {
id = msg.externalId;
}

let result = {
success: true,
object: theObject.toLowerCase(),
action: theAction,
id: sfdcResult.id ? sfdcResult.id : msg.externalId ? msg.externalId : msg.payload.id
id: id
};
resolve(result);
})
Expand All @@ -60,10 +68,10 @@ const handleInput = (node, msg) => {
actionHelper.inputToSFAction(node, msg, realAction);
};

module.exports = function(RED) {
function Dml(config) {
module.exports = function (RED) {
function Dml(config) {
const node = this;
RED.nodes.createNode(node, config);
RED.nodes.createNode(node, config);
node.connection = RED.nodes.getNode(config.connection);
node.config = config;
node.on('input', (msg) => handleInput(node, msg));
Expand Down
Loading

0 comments on commit 6cb4d29

Please sign in to comment.