Sha256: 26444d4e027a91aff93733974ffdf8e58d89046910bbe769405e59495f0ba294

Contents?: true

Size: 499 Bytes

Versions: 1

Compression:

Stored size: 499 Bytes

Contents

const downloadFileById = async (fileId, z) => {
  const response = await z.request({
    method: 'GET',
    url: 'https://app.files.com/api/rest/v1/files/',
    params: {
      id: fileId,
    },
  })

  const downloadUri = z.JSON.parse(response.content).download_uri

  return await z.request({
    method: 'GET',
    url: downloadUri,
    raw: true,
  })
}

const hydrators = {
  downloadFile: (z, bundle) => z.stashFile(downloadFileById(bundle.inputData.fileId, z))
}

module.exports = hydrators;

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
files.com-1.0.55 zapier/hydrators.js