@nxtedition/lib 19.9.2 → 19.9.4
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.
- package/couch.js +2 -27
- package/package.json +6 -6
package/couch.js
CHANGED
|
@@ -3,7 +3,6 @@ import stream from 'node:stream'
|
|
|
3
3
|
import querystring from 'node:querystring'
|
|
4
4
|
import createError from 'http-errors'
|
|
5
5
|
import { makeWeakCache } from './weakCache.js'
|
|
6
|
-
import tp from 'timers/promises'
|
|
7
6
|
import { defaultDelay as delay } from './http.js'
|
|
8
7
|
import urljoin from 'url-join'
|
|
9
8
|
import { AbortError } from './errors.js'
|
|
@@ -421,28 +420,7 @@ export function makeCouch(opts) {
|
|
|
421
420
|
const ACCEPT_HEADERS = ['Accept', 'application/json']
|
|
422
421
|
const ACCEPT_CONTENT_TYPE_HEADERS = [...ACCEPT_HEADERS, 'Content-Type', 'application/json']
|
|
423
422
|
|
|
424
|
-
|
|
425
|
-
for (let n = 0; true; ++n) {
|
|
426
|
-
try {
|
|
427
|
-
return await _request(url, opts)
|
|
428
|
-
} catch (err) {
|
|
429
|
-
if (
|
|
430
|
-
!opts.idempotent ||
|
|
431
|
-
n >= 10 ||
|
|
432
|
-
(err.code !== 'UND_ERR_SOCKET' &&
|
|
433
|
-
err.code !== 'ECONNRESET' &&
|
|
434
|
-
err.code !== 'ECONNREFUSED' &&
|
|
435
|
-
err.code !== 'EHOSTUNREACH' &&
|
|
436
|
-
err.message !== 'write EPIPE')
|
|
437
|
-
) {
|
|
438
|
-
throw err
|
|
439
|
-
}
|
|
440
|
-
await tp.setTimeout(n * 1e3)
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
function _request(
|
|
423
|
+
function request(
|
|
446
424
|
url,
|
|
447
425
|
{ params, client = defaultClient, idempotent, body, method, headers, signal },
|
|
448
426
|
) {
|
|
@@ -739,11 +717,8 @@ export function makeCouch(opts) {
|
|
|
739
717
|
}
|
|
740
718
|
|
|
741
719
|
async function up(params, body, { client = defaultClient, signal = null } = {}) {
|
|
742
|
-
const res = await
|
|
743
|
-
path: '/_up',
|
|
744
|
-
method: 'GET',
|
|
720
|
+
const res = await undiciRequest(new URL('/_up', dbOrigin), {
|
|
745
721
|
signal,
|
|
746
|
-
throwOnError: true,
|
|
747
722
|
dispatcher: client,
|
|
748
723
|
})
|
|
749
724
|
return await res.body.json()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/lib",
|
|
3
|
-
"version": "19.9.
|
|
3
|
+
"version": "19.9.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Nagy <robert.nagy@boffins.se>",
|
|
6
6
|
"type": "module",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@aws-sdk/client-s3": "^3.614.0",
|
|
83
83
|
"@elastic/elasticsearch": "^8.14.0",
|
|
84
84
|
"@elastic/transport": "^8.7.0",
|
|
85
|
-
"@nxtedition/nxt-undici": "^4.1
|
|
85
|
+
"@nxtedition/nxt-undici": "^4.2.1",
|
|
86
86
|
"content-type": "^1.0.5",
|
|
87
87
|
"date-fns": "^3.6.0",
|
|
88
88
|
"fast-querystring": "^1.1.1",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"nested-error-stacks": "^2.1.1",
|
|
98
98
|
"object-hash": "^3.0.0",
|
|
99
99
|
"p-queue": "^8.0.1",
|
|
100
|
-
"pino": "^9.
|
|
100
|
+
"pino": "^9.3.1",
|
|
101
101
|
"qs": "^6.12.3",
|
|
102
102
|
"request-target": "^1.0.2",
|
|
103
103
|
"smpte-timecode": "^1.3.6",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@nxtedition/deepstream.io-client-js": ">=24.2.4",
|
|
110
|
-
"@types/lodash": "^4.17.
|
|
111
|
-
"@types/node": "^20.14.
|
|
110
|
+
"@types/lodash": "^4.17.7",
|
|
111
|
+
"@types/node": "^20.14.11",
|
|
112
112
|
"eslint": "^8.0.0",
|
|
113
113
|
"eslint-config-prettier": "^9.1.0",
|
|
114
114
|
"eslint-config-standard": "^17.0.0",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"husky": "^9.0.11",
|
|
120
120
|
"lint-staged": "^15.2.7",
|
|
121
121
|
"pinst": "^3.0.0",
|
|
122
|
-
"prettier": "^3.3.
|
|
122
|
+
"prettier": "^3.3.3",
|
|
123
123
|
"rxjs": "^7.5.6",
|
|
124
124
|
"send": "^0.18.0",
|
|
125
125
|
"tap": "^21.0.0"
|