Created
April 3, 2023 13:23
-
-
Save cfjedimaster/605a25a51602bd91eaeafb0bbd68d02a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'node-fetch'; | |
export default defineComponent({ | |
async run({ steps, $ }) { | |
const CLIENT_ID = process.env.PSAPI_CLIENTID; | |
let data = { | |
"inputs":{ | |
"storage":"dropbox", | |
"href":steps.trigger.event.link | |
}, | |
"outputs": [{ | |
"storage":"dropbox", | |
"href":steps.getUploadURLForDropbox.$return_value.link, | |
"type":"image/jpeg" | |
}] | |
} | |
let resp = await fetch('https://image.adobe.io/lrService/autoTone', { | |
method: 'POST', | |
headers: { | |
'Authorization':`Bearer ${steps.getAccessToken.$return_value}`, | |
'x-api-key': CLIENT_ID, | |
'Content-Type':'application/json' | |
}, | |
body: JSON.stringify(data) | |
}); | |
let result = await resp.json(); | |
return result._links.self.href; | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment