Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

chore: update deps #32

Merged
merged 3 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
language: node_js
cache: npm
dist: bionic

branches:
only:
- master
- /^release\/.*$/

stages:
- check
- test
Expand All @@ -14,7 +21,7 @@ os:
- osx
- windows

script: npx nyc -s npm run test:node -- --bail
script: npx aegir test -t node --cov --bail
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov

jobs:
Expand All @@ -34,8 +41,7 @@ jobs:
name: firefox
addons:
firefox: latest
script: npx aegir test -t browser -- --browsers FirefoxHeadless
script: npx aegir test -t browser -- --browser firefox

notifications:
email: false

16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,23 @@
},
"homepage": "https://github.com/ipfs/js-datastore-s3#readme",
"dependencies": {
"buffer": "^5.6.0",
"datastore-core": "^2.0.0",
"interface-datastore": "^2.0.0"
"buffer": "^6.0.3",
"datastore-core": "^3.0.0",
"interface-datastore": "^3.0.5"
},
"devDependencies": {
"aegir": "^26.0.0",
"aegir": "^33.0.0",
"assert": "^2.0.0",
"aws-sdk": "^2.579.0",
"chai": "^4.2.0",
"dirty-chai": "^2.0.1",
"ipfs-repo": "^6.0.3",
"stand-in": "^4.2.0"
"ipfs-repo": "9.0.0",
"stand-in": "^4.2.0",
"util": "^0.12.3"
},
"peerDependencies": {
"aws-sdk": "2.x",
"ipfs-repo": "^6.0.3"
"ipfs-repo": "^9.0.0"
},
"contributors": [
"Jacob Heun <[email protected]>",
Expand Down
14 changes: 8 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ class S3Datastore extends Adapter {

/**
* Returns the full key which includes the path to the ipfs store
*
* @param {Key} key
* @returns {String}
* @returns {string}
*/
_getFullKey (key) {
// Avoid absolute paths with s3
Expand Down Expand Up @@ -168,6 +169,7 @@ class S3Datastore extends Adapter {

/**
* Recursively fetches all keys from s3
*
* @param {Object} params
* @returns {Iterator<Key>}
*/
Expand All @@ -184,7 +186,7 @@ class S3Datastore extends Adapter {
yield new Key(d.Key.slice(this.path.length), false)
}

// If we didnt get all records, recursively query
// If we didn't get all records, recursively query
if (data.isTruncated) {
// If NextMarker is absent, use the key from the last result
params.StartAfter = data.Contents[data.Contents.length - 1].Key
Expand Down Expand Up @@ -242,13 +244,13 @@ class S3Datastore extends Adapter {
Key: this.path
}).promise()
} catch (err) {
if (err.statusCode === 404) {
return this.put(new Key('/', false), Uint8Array.from(''))
if (err.statusCode !== 404) {
throw Errors.dbOpenFailedError(err)
}

throw Errors.dbOpenFailedError(err)
}
}

close () {}
}

module.exports = S3Datastore
Expand Down
1 change: 1 addition & 0 deletions src/s3-repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const notALock = {

/**
* A convenience method for creating an S3 backed IPFS repo
*
* @param {Object} S3Store
* @param {Object} options
* @param {Object} s3Options
Expand Down
1 change: 1 addition & 0 deletions test/utils/s3-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const s3Reject = (err) => ({ promise: () => Promise.reject(err) })

/**
* Mocks out the s3 calls made by datastore-s3
*
* @param {S3Instance} s3
* @returns {void}
*/
Expand Down