@engine9-io/input-tools 1.5.2 → 1.5.3
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/file/FileUtilities.js +6 -1
- package/file/S3.js +2 -1
- package/package.json +1 -1
package/file/FileUtilities.js
CHANGED
@@ -661,7 +661,12 @@ Worker.prototype.move = async function ({ filename, target }) {
|
|
661
661
|
throw new Error('Cowardly not copying between services');
|
662
662
|
}
|
663
663
|
|
664
|
-
|
664
|
+
let worker = null;
|
665
|
+
if (target.startsWith('r2://')) {
|
666
|
+
worker = new R2Worker(this);
|
667
|
+
} else {
|
668
|
+
worker = new S3Worker(this);
|
669
|
+
}
|
665
670
|
|
666
671
|
if (filename.startsWith('s3://') || filename.startsWith('r2://')) {
|
667
672
|
// We need to copy and delete
|
package/file/S3.js
CHANGED
@@ -131,7 +131,8 @@ Worker.prototype.download.metadata = {
|
|
131
131
|
Worker.prototype.put = async function (options) {
|
132
132
|
const { filename, directory } = options;
|
133
133
|
if (!filename) throw new Error('Local filename required');
|
134
|
-
if (directory?.indexOf('s3://') !== 0
|
134
|
+
if (directory?.indexOf('s3://') !== 0
|
135
|
+
&& directory?.indexOf('r2://') !== 0) throw new Error(`directory path must start with s3:// or r2://, is ${directory}`);
|
135
136
|
|
136
137
|
const file = options.file || filename.split('/').pop();
|
137
138
|
const parts = directory.split('/');
|