adding sample code
This commit is contained in:
Родитель
3cdb83df49
Коммит
f302ffd9eb
|
@ -0,0 +1,29 @@
|
|||
var jsforce = require('jsforce');
|
||||
var conn = new jsforce.Connection({
|
||||
oauth2 : {
|
||||
clientId : process.env.clientId,
|
||||
clientSecret : process.env.clientSecret,
|
||||
redirectUri : process.env.redirectUri,
|
||||
},
|
||||
instanceUrl : process.env.instanceUrl,
|
||||
accessToken : process.env.accessToken,
|
||||
refreshToken : process.env.refreshToken
|
||||
});
|
||||
|
||||
conn.oauth2.refreshToken(conn.refreshToken, (err, results) => {
|
||||
if (err) return reject(err);
|
||||
console.log('OAUTH2' + JSON.stringify(results));
|
||||
});
|
||||
|
||||
exports.handler = function(event, context) {
|
||||
conn.sobject("Dolphin__e").create(
|
||||
{ ID__c : event.ID,
|
||||
cleaningCycles__c : event.cleaningCycles,
|
||||
state__c : event.state
|
||||
}
|
||||
,
|
||||
function(err, rets) {
|
||||
if (err) { return console.error(err); }
|
||||
console.log('SUCCESS' + JSON.stringify(rets));
|
||||
});
|
||||
};
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"name": "awsconnector",
|
||||
"version": "1.0.0",
|
||||
"description": "0. Prerequisite",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"jsforce": "^1.8.4"
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче