This repository was archived by the owner on Mar 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +28
-16
lines changed Expand file tree Collapse file tree 5 files changed +28
-16
lines changed Original file line number Diff line number Diff line change 1
1
language : node_js
2
2
cache : npm
3
+ dist : bionic
4
+
5
+ branches :
6
+ only :
7
+ - master
8
+ - /^release\/.*$/
9
+
3
10
stages :
4
11
- check
5
12
- test
14
21
- osx
15
22
- windows
16
23
17
- script : npx nyc -s npm run test: node -- --bail
24
+ script : npx aegir test -t node --cov --bail
18
25
after_success : npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
19
26
20
27
jobs :
34
41
name : firefox
35
42
addons :
36
43
firefox : latest
37
- script : npx aegir test -t browser -- --browsers FirefoxHeadless
44
+ script : npx aegir test -t browser -- --browser firefox
38
45
39
46
notifications :
40
47
email : false
41
-
Original file line number Diff line number Diff line change 35
35
},
36
36
"homepage" : " https://github.com/ipfs/js-datastore-s3#readme" ,
37
37
"dependencies" : {
38
- "buffer" : " ^5. 6.0" ,
39
- "datastore-core" : " ^2 .0.0" ,
40
- "interface-datastore" : " ^2 .0.0 "
38
+ "buffer" : " ^6.0.3 " ,
39
+ "datastore-core" : " ^3 .0.0" ,
40
+ "interface-datastore" : " ^3 .0.5 "
41
41
},
42
42
"devDependencies" : {
43
- "aegir" : " ^26.0.0" ,
43
+ "aegir" : " ^33.0.0" ,
44
+ "assert" : " ^2.0.0" ,
44
45
"aws-sdk" : " ^2.579.0" ,
45
46
"chai" : " ^4.2.0" ,
46
47
"dirty-chai" : " ^2.0.1" ,
47
- "ipfs-repo" : " ^6.0.3" ,
48
- "stand-in" : " ^4.2.0"
48
+ "ipfs-repo" : " 9.0.0" ,
49
+ "stand-in" : " ^4.2.0" ,
50
+ "util" : " ^0.12.3"
49
51
},
50
52
"peerDependencies" : {
51
53
"aws-sdk" : " 2.x" ,
52
- "ipfs-repo" : " ^6 .0.3 "
54
+ "ipfs-repo" : " ^9 .0.0 "
53
55
},
54
56
"contributors" : [
55
57
Original file line number Diff line number Diff line change @@ -47,8 +47,9 @@ class S3Datastore extends Adapter {
47
47
48
48
/**
49
49
* Returns the full key which includes the path to the ipfs store
50
+ *
50
51
* @param {Key } key
51
- * @returns {String }
52
+ * @returns {string }
52
53
*/
53
54
_getFullKey ( key ) {
54
55
// Avoid absolute paths with s3
@@ -168,6 +169,7 @@ class S3Datastore extends Adapter {
168
169
169
170
/**
170
171
* Recursively fetches all keys from s3
172
+ *
171
173
* @param {Object } params
172
174
* @returns {Iterator<Key> }
173
175
*/
@@ -184,7 +186,7 @@ class S3Datastore extends Adapter {
184
186
yield new Key ( d . Key . slice ( this . path . length ) , false )
185
187
}
186
188
187
- // If we didnt get all records, recursively query
189
+ // If we didn't get all records, recursively query
188
190
if ( data . isTruncated ) {
189
191
// If NextMarker is absent, use the key from the last result
190
192
params . StartAfter = data . Contents [ data . Contents . length - 1 ] . Key
@@ -242,13 +244,13 @@ class S3Datastore extends Adapter {
242
244
Key : this . path
243
245
} ) . promise ( )
244
246
} catch ( err ) {
245
- if ( err . statusCode = == 404 ) {
246
- return this . put ( new Key ( '/' , false ) , Uint8Array . from ( '' ) )
247
+ if ( err . statusCode ! == 404 ) {
248
+ throw Errors . dbOpenFailedError ( err )
247
249
}
248
-
249
- throw Errors . dbOpenFailedError ( err )
250
250
}
251
251
}
252
+
253
+ close ( ) { }
252
254
}
253
255
254
256
module . exports = S3Datastore
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ const notALock = {
15
15
16
16
/**
17
17
* A convenience method for creating an S3 backed IPFS repo
18
+ *
18
19
* @param {Object } S3Store
19
20
* @param {Object } options
20
21
* @param {Object } s3Options
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ const s3Reject = (err) => ({ promise: () => Promise.reject(err) })
20
20
21
21
/**
22
22
* Mocks out the s3 calls made by datastore-s3
23
+ *
23
24
* @param {S3Instance } s3
24
25
* @returns {void }
25
26
*/
You can’t perform that action at this time.
0 commit comments