@engine9-io/input-tools 1.6.1 → 1.6.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.
Files changed (2) hide show
  1. package/file/S3.js +5 -2
  2. package/package.json +1 -1
package/file/S3.js CHANGED
@@ -187,7 +187,7 @@ Worker.prototype.write.metadata = {
187
187
  },
188
188
  };
189
189
 
190
- Worker.prototype.list = async function ({ directory }) {
190
+ Worker.prototype.list = async function ({ directory, raw }) {
191
191
  if (!directory) throw new Error('directory is required');
192
192
  let dir = directory;
193
193
  while (dir.slice(-1) === '/') dir = dir.slice(0, -1);
@@ -200,14 +200,17 @@ Worker.prototype.list = async function ({ directory }) {
200
200
  });
201
201
 
202
202
  const { Contents: files, CommonPrefixes } = await s3Client.send(command);
203
+ if (raw) return files;
203
204
  // debug('Prefixes:', { CommonPrefixes });
204
205
  const output = [].concat((CommonPrefixes || []).map((f) => ({
205
206
  name: f.Prefix.slice(Prefix.length + 1, -1),
206
207
  type: 'directory',
207
208
  })))
208
- .concat((files || []).map(({ Key }) => ({
209
+ .concat((files || []).map(({ Key, Size, LastModified }) => ({
209
210
  name: Key.slice(Prefix.length + 1),
210
211
  type: 'file',
212
+ size: Size,
213
+ modifiedAt: new Date(LastModified).toISOString(),
211
214
  })));
212
215
 
213
216
  return output;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engine9-io/input-tools",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "Tools for dealing with Engine9 inputs",
5
5
  "main": "index.js",
6
6
  "scripts": {