auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
const fetch = require('node-fetch');
const key = process.env.HERE_API_KEY;
if(steps.trigger.event['.tag'] !== 'file') $end('wrong type = ' + steps.trigger.event['.tag']);
let loc = steps.trigger.event.media_info.metadata.location.latitude + ',' +
steps.trigger.event.media_info.metadata.location.longitude;
let url = `https://revgeocode.search.hereapi.com/v1/revgeocode?apikey=${key}&at=${loc}`;
console.log(url);
let resp = await fetch(url);
let data = await resp.json();
console.log(data.items[0]);
return data.items[0];
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
let destPath = `/documents/geosortedphotos/${steps.reversegeocode.$return_value.address.state}/${steps.reversegeocode.$return_value.address.city}/`;
let filename = steps.trigger.event.path_lower.split('/').pop();
destPath += filename;
console.log(destPath);
return destPath;
Full path name such as /Folder1/Folder2/File Name.pdf
New full path name such as /New Folder1/Folder2/File Name.pdf
async
(params, auths) => {
}
const fetch = require('isomorphic-fetch');
const { Dropbox } = require('dropbox');
const dbx = new Dropbox({
accessToken: auths.dropbox.oauth_access_token,
fetch
});
try {
this.resp = await dbx.filesMoveV2({
from_path: params.from_path,
to_path: params.to_path
})
} catch (err) {
this.err = err
}