mobiletto 1.1.12 → 1.1.15

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.
@@ -94,6 +94,7 @@ class StorageClient {
94
94
  return {
95
95
  name: this.denormalizePath(f.fileName),
96
96
  size: f.contentLength,
97
+ mtime: f.uploadTimestamp,
97
98
  type: this.b2type(f),
98
99
  b2id: f.fileId
99
100
  }
@@ -181,7 +181,8 @@ class StorageClient {
181
181
  const head = await this.client.send(new HeadObjectCommand(bucketParams))
182
182
  const meta = {
183
183
  name: this.stripPrefix(path),
184
- size: head.ContentLength
184
+ size: head.ContentLength,
185
+ type: path.endsWith(this.delimiter) ? M_DIR : M_FILE
185
186
  }
186
187
  if (head.LastModified) {
187
188
  meta.mtime = Date.parse(head.LastModified)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobiletto",
3
- "version": "1.1.12",
3
+ "version": "1.1.15",
4
4
  "description": "A storage layer that presents a uniform interface to Amazon S3, Backblaze B2, and local storage",
5
5
  "main": "index.js",
6
6
  "keywords": [
package/test/api.spec.js CHANGED
@@ -62,6 +62,7 @@ async function assertMeta (api, name, expectedSize) {
62
62
  should().exist(meta, 'expected return value from metadata call')
63
63
  expect(meta.name).equals(name, 'expected name of written file to be correct')
64
64
  expect(meta.size).equals(expectedSize, 'expected size of written file to equal size of randomData')
65
+ expect(meta.mtime).is.greaterThan(0, 'expected mtime of written file to be > 0')
65
66
  }
66
67
 
67
68
  async function assertMetaFail (api, name) {
package/util/logger.js CHANGED
@@ -2,7 +2,7 @@ const winston = require('winston')
2
2
 
3
3
  const logger = winston.createLogger({
4
4
  level: process.env.MOBILETTO_LOG_LEVEL || 'error',
5
- format: winston.format.simple(),
5
+ format: winston.format.timestamp(),
6
6
  transports: process.env.MOBILETTO_LOG_FILE
7
7
  ? [ new winston.transports.File({ filename: process.env.MOBILETTO_LOG_FILE }) ]
8
8
  : [ new winston.transports.Console() ]
package/util/redis.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const Redis = require('ioredis')
2
2
  const generators = require('redis-async-gen')
3
3
  const { logger } = require('./logger')
4
- const LRU = require("lru-cache")
4
+ const LRU = require('lru-cache')
5
5
 
6
6
  const { DEFAULT_REDIS_OPTIONS } = require('ioredis/built/redis/RedisOptions')
7
7