adobe / aem-upload

Makes uploading to AEM easier, and can be used as a command line executable or required as a Node.js module.
Apache License 2.0
62 stars 15 forks source link

use fetch instead of axios, and expose http options #107

Closed mfrisbey closed 1 year ago

mfrisbey commented 1 year ago

Description

Removes axios, replacing it with fetch. Also adds a new withHttpOptions() method to DirectBinaryUploadOptions, and removes several methods that are rendered obsolete by withHttpOptions().

PR also includes an upgrade guide, which will be required due to the breaking changes it introduces.

Related Issue

106

Motivation and Context

We want to increase the library's flexibility by allowing consumers to have increase control over the options that are used when making HTTP requests. This was difficult because aem-upload uses axios when creating directories, but node-httptransfer uses fetch when uploading files. By bringing the two inline, we can now add a single withHttpOptions() method that will allow consumers to provide whichever options they want for fetch.

How Has This Been Tested?

Manual local testing by uploading files and folders, then verifying the results. e2e tests and unit tests all pass.

Screenshots (if appropriate):

N/A

Types of changes

Checklist:

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 2.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: