Skip to content

Commit 22850d7

Browse files
glynnbirdGlynn Bird
andauthored
10.1.0 (#312)
* dependency bump - bump all dependencies to latest versions * set minimum node version to 14 - just to keep up with progress (18 is current LTS) * update Travis node versions * bump Travis Ubuntu host to "focal" Co-authored-by: Glynn Bird <glynnbird@apache.org>
1 parent d6c6c3a commit 22850d7

14 files changed

+3252
-4317
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
dist: focal
12
language: "node_js"
23
node_js:
3-
- "12"
44
- "14"
5+
- "16"
6+
- "18"
57
services:
68
- docker
79
os:

examples/lazy_creation_of_views.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = function () {
4545
if (!retries) {
4646
retries = 0
4747
}
48-
users.insert({ emailAddress: emailAddress, secret: secret, name: name }, secret,
48+
users.insert({ emailAddress, secret, name }, secret,
4949
function (e, b, h) {
5050
if (e && e.message === 'no_db_file' && retries < 1) {
5151
return createUsersDatabase(emailAddress, secret, name, retries)

lib/nano.js

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// License for the specific language governing permissions and limitations under
1111
// the License.
1212

13-
const { HttpsCookieAgent, HttpCookieAgent } = require('http-cookie-agent')
13+
const { HttpsCookieAgent, HttpCookieAgent } = require('http-cookie-agent/http')
1414
const { URL } = require('url')
1515
const assert = require('assert')
1616
const querystring = require('qs')
@@ -126,7 +126,7 @@ module.exports = exports = function dbScope (cfg) {
126126
// let parsed
127127
const responseHeaders = Object.assign({
128128
uri: scrubURL(req.url),
129-
statusCode: statusCode
129+
statusCode
130130
}, response.headers)
131131
if (!response.status) {
132132
if (axios.isCancel(response)) {
@@ -139,7 +139,7 @@ module.exports = exports = function dbScope (cfg) {
139139
return
140140
}
141141

142-
log({ err: 'socket', body: body, headers: responseHeaders })
142+
log({ err: 'socket', body, headers: responseHeaders })
143143
if (reject) {
144144
reject(new Error(`error happened in your connection. Reason: ${response.message}`))
145145
}
@@ -162,7 +162,7 @@ module.exports = exports = function dbScope (cfg) {
162162
} */
163163

164164
if (statusCode >= 200 && statusCode < 400) {
165-
log({ err: null, body: body, headers: responseHeaders })
165+
log({ err: null, body, headers: responseHeaders })
166166
if (resolve) {
167167
resolve(body)
168168
}
@@ -187,7 +187,7 @@ module.exports = exports = function dbScope (cfg) {
187187
// scrub credentials
188188
scrubRequest(req)
189189

190-
log({ err: 'couch', body: body, headers: responseHeaders })
190+
log({ err: 'couch', body, headers: responseHeaders })
191191

192192
const message = body.message || 'couch returned ' + statusCode
193193
const errors = new Error(message)
@@ -223,7 +223,7 @@ module.exports = exports = function dbScope (cfg) {
223223

224224
const responseHeaders = Object.assign({
225225
uri: req.url,
226-
statusCode: statusCode
226+
statusCode
227227
}, response.headers)
228228

229229
const error = new Error(message)
@@ -267,7 +267,7 @@ module.exports = exports = function dbScope (cfg) {
267267

268268
const req = Object.assign({
269269
method: (opts.method || 'GET'),
270-
headers: headers,
270+
headers,
271271
uri: cfg.url
272272
}, {
273273
...cfg.requestDefaults,
@@ -385,8 +385,8 @@ module.exports = exports = function dbScope (cfg) {
385385
req.method = req.method.toLowerCase()
386386
req.params = req.qs
387387
delete req.qs
388-
req.paramsSerializer = (params) => {
389-
return querystring.stringify(params, { arrayFormat: 'brackets' })
388+
req.paramsSerializer = {
389+
serialize: (params) => querystring.stringify(params, { arrayFormat: 'brackets' })
390390
}
391391
req.data = req.body
392392
delete req.body
@@ -453,7 +453,7 @@ module.exports = exports = function dbScope (cfg) {
453453
db: '_session',
454454
form: {
455455
name: username,
456-
password: password
456+
password
457457
}
458458
}, callback)
459459
}
@@ -579,7 +579,7 @@ module.exports = exports = function dbScope (cfg) {
579579
count = 1
580580
}
581581
count = count || 1
582-
return relax({ method: 'GET', path: '_uuids', qs: { count: count } }, callback)
582+
return relax({ method: 'GET', path: '_uuids', qs: { count } }, callback)
583583
}
584584

585585
// http://guide.couchdb.org/draft/replication.html
@@ -616,7 +616,7 @@ module.exports = exports = function dbScope (cfg) {
616616
db: '_replicator',
617617
method: 'DELETE',
618618
path: id,
619-
qs: Object.assign(opts, { rev: rev })
619+
qs: Object.assign(opts, { rev })
620620
}
621621
return relax(req, callback)
622622
}
@@ -658,7 +658,7 @@ module.exports = exports = function dbScope (cfg) {
658658
db: dbName,
659659
doc: docName,
660660
method: 'DELETE',
661-
qs: { rev: rev }
661+
qs: { rev }
662662
}, callback)
663663
}
664664

@@ -787,7 +787,7 @@ module.exports = exports = function dbScope (cfg) {
787787
path: viewPath,
788788
method: 'POST',
789789
qs: qs1,
790-
body: body,
790+
body,
791791
stream: meta.stream
792792
}, callback)
793793
} else if (qs1 && qs1.queries) {
@@ -798,7 +798,7 @@ module.exports = exports = function dbScope (cfg) {
798798
path: viewPath,
799799
method: 'POST',
800800
qs: qs1,
801-
body: body
801+
body
802802
}, callback)
803803
} else {
804804
const req = {
@@ -858,7 +858,7 @@ module.exports = exports = function dbScope (cfg) {
858858
return view(ddoc, viewName + '/' + encodeURIComponent(docName), {
859859
type: 'update',
860860
method: 'PUT',
861-
body: body
861+
body
862862
}, callback)
863863
}
864864

@@ -925,8 +925,8 @@ module.exports = exports = function dbScope (cfg) {
925925
method: 'PUT',
926926
contentType: 'multipart/related',
927927
doc: docName,
928-
qs: qs,
929-
multipart: multipart
928+
qs,
929+
multipart
930930
}, callback)
931931
}
932932

@@ -957,7 +957,7 @@ module.exports = exports = function dbScope (cfg) {
957957
db: dbName,
958958
att: attName,
959959
method: 'PUT',
960-
contentType: contentType,
960+
contentType,
961961
doc: docName,
962962
qs: opts,
963963
body: att,
@@ -1004,7 +1004,7 @@ module.exports = exports = function dbScope (cfg) {
10041004
att: attName,
10051005
method: 'DELETE',
10061006
doc: docName,
1007-
qs: qs
1007+
qs
10081008
}, callback)
10091009
}
10101010

@@ -1071,7 +1071,7 @@ module.exports = exports = function dbScope (cfg) {
10711071
return relax({
10721072
db: dbName,
10731073
path: '_partition/' + encodeURIComponent(partitionKey) + '/_all_docs',
1074-
qs: qs,
1074+
qs,
10751075
stream: true
10761076
})
10771077
}
@@ -1157,8 +1157,8 @@ module.exports = exports = function dbScope (cfg) {
11571157
return changesDbAsStream(dbName, qs)
11581158
},
11591159
changesReader: new ChangesReader(dbName, relax),
1160-
auth: auth,
1161-
session: session,
1160+
auth,
1161+
session,
11621162
insert: insertDoc,
11631163
get: getDoc,
11641164
head: headDoc,
@@ -1167,7 +1167,7 @@ module.exports = exports = function dbScope (cfg) {
11671167
list: listDoc,
11681168
listAsStream: listDocAsStream,
11691169
fetch: fetchDocs,
1170-
fetchRevs: fetchRevs,
1170+
fetchRevs,
11711171
config: { url: cfg.url, db: dbName },
11721172
multipart: {
11731173
insert: insertMultipart,
@@ -1181,17 +1181,17 @@ module.exports = exports = function dbScope (cfg) {
11811181
},
11821182
show: showDoc,
11831183
atomic: updateWithHandler,
1184-
updateWithHandler: updateWithHandler,
1184+
updateWithHandler,
11851185
baseView: view,
11861186
search: viewSearch,
11871187
searchAsStream: viewSearchAsStream,
11881188
view: viewDocs,
11891189
viewAsStream: viewDocsAsStream,
1190-
find: find,
1191-
findAsStream: findAsStream,
1192-
createIndex: createIndex,
1193-
viewWithList: viewWithList,
1194-
viewWithListAsStream: viewWithListAsStream,
1190+
find,
1191+
findAsStream,
1192+
createIndex,
1193+
viewWithList,
1194+
viewWithListAsStream,
11951195
server: serverScope,
11961196
replication: {
11971197
enable: function (target, opts, cb) {
@@ -1204,15 +1204,15 @@ module.exports = exports = function dbScope (cfg) {
12041204
return queryReplication(id, opts, cb)
12051205
}
12061206
},
1207-
partitionInfo: partitionInfo,
1208-
partitionedList: partitionedList,
1209-
partitionedListAsStream: partitionedListAsStream,
1210-
partitionedFind: partitionedFind,
1211-
partitionedFindAsStream: partitionedFindAsStream,
1212-
partitionedSearch: partitionedSearch,
1213-
partitionedSearchAsStream: partitionedSearchAsStream,
1214-
partitionedView: partitionedView,
1215-
partitionedViewAsStream: partitionedViewAsStream
1207+
partitionInfo,
1208+
partitionedList,
1209+
partitionedListAsStream,
1210+
partitionedFind,
1211+
partitionedFindAsStream,
1212+
partitionedSearch,
1213+
partitionedSearchAsStream,
1214+
partitionedView,
1215+
partitionedViewAsStream
12161216
}
12171217

12181218
docScope.view.compact = function (ddoc, cb) {
@@ -1240,18 +1240,18 @@ module.exports = exports = function dbScope (cfg) {
12401240
query: queryReplication
12411241
},
12421242
changes: changesDb,
1243-
updates: updates
1243+
updates
12441244
},
12451245
use: docModule,
12461246
scope: docModule,
12471247
request: relax,
1248-
relax: relax,
1248+
relax,
12491249
dinosaur: relax,
1250-
auth: auth,
1251-
session: session,
1252-
updates: updates,
1253-
uuids: uuids,
1254-
info: info
1250+
auth,
1251+
session,
1252+
updates,
1253+
uuids,
1254+
info
12551255
})
12561256

12571257
const db = maybeExtractDatabaseComponent()

0 commit comments

Comments
 (0)