@openeo/js-client 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/userfile.js CHANGED
@@ -90,10 +90,11 @@ class UserFile extends BaseEntity {
90
90
  * @async
91
91
  * @param {*} source - The source, see method description for details.
92
92
  * @param {?uploadStatusCallback} statusCallback - Optionally, a callback that is executed on upload progress updates.
93
+ * @param {?AbortController} [abortController=null] - An AbortController object that can be used to cancel the upload process.
93
94
  * @returns {Promise<UserFile>}
94
95
  * @throws {Error}
95
96
  */
96
- async uploadFile(source, statusCallback = null) {
97
+ async uploadFile(source, statusCallback = null, abortController = null) {
97
98
  let options = {
98
99
  method: 'put',
99
100
  url: '/files/' + this.path,
@@ -109,7 +110,7 @@ class UserFile extends BaseEntity {
109
110
  };
110
111
  }
111
112
 
112
- let response = await this.connection._send(options);
113
+ let response = await this.connection._send(options, abortController);
113
114
  return this.setAll(response.data);
114
115
  }
115
116