auths
objectTake a screenshot of this URL
return
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, params) => {
}
const axios = require('axios')
const fs = require("fs")
const { url } = params
const { data } = await axios({
method: 'GET',
url,
responseType: 'arraybuffer',
})
fs.writeFileSync(`/tmp/file`, data)
A list of parent folder IDs, entered manually or retrieved from a previous file list operation
The path to the file, e.g. /tmp/myFile.csv .
async
(params, auths) => {
}
const fs = require("fs")
const {google} = require('googleapis')
const driveAuth = new google.auth.OAuth2()
driveAuth.setCredentials({ access_token: auths.google_drive.oauth_access_token })
const drive = await google.drive({ version: 'v3', auth: driveAuth });
this.uploadResponse = (await drive.files.create({
resource: {
name: params.filename,
originalFilename: params.filename,
parents: params.parents,
},
media: {
mimeType: params.filetype,
uploadType: "media",
body: fs.createReadStream(params.pathToFile)
},
fields: '*'
})).data