@engine9-io/input-tools 1.7.7 → 1.7.8

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/.prettierrc ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "semi": true,
3
+ "singleQuote": true,
4
+ "tabWidth": 2,
5
+ "printWidth": 120,
6
+ "trailingComma": "none"
7
+ }
package/file/R2.js CHANGED
@@ -6,6 +6,7 @@ const S3 = require('./S3');
6
6
 
7
7
  function R2(worker) {
8
8
  S3.call(this, worker);
9
+ this.prefix='r2';
9
10
  }
10
11
  util.inherits(R2, S3);
11
12
 
package/file/S3.js CHANGED
@@ -12,7 +12,9 @@ const {
12
12
  } = require('@aws-sdk/client-s3');
13
13
  const { getTempFilename } = require('./tools');
14
14
 
15
- function Worker() {}
15
+ function Worker() {
16
+ this.prefix='s3';
17
+ }
16
18
 
17
19
  function getParts(filename) {
18
20
  if (!filename) throw new Error(`Invalid filename: ${filename}`);
@@ -247,7 +249,7 @@ Worker.prototype.listAll = async function ({ directory }) {
247
249
  debug(`Sending List command with prefix ${Prefix} with ContinuationToken ${ContinuationToken}`);
248
250
  // eslint-disable-next-line no-await-in-loop
249
251
  const result = await s3Client.send(command);
250
- const newFiles = (result.Contents?.map((d) => `s3://${Bucket}/${d.Key}`) || []);
252
+ const newFiles = (result.Contents?.map((d) => `${this.prefix}://${Bucket}/${d.Key}`) || []);
251
253
  debug(`Retrieved ${newFiles.length} new files, total ${files.length},sample ${newFiles.slice(0, 3).join(',')}`);
252
254
  files.push(...newFiles);
253
255
  ContinuationToken = result.NextContinuationToken;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engine9-io/input-tools",
3
- "version": "1.7.7",
3
+ "version": "1.7.8",
4
4
  "description": "Tools for dealing with Engine9 inputs",
5
5
  "main": "index.js",
6
6
  "scripts": {