@nxtedition/lib 17.2.16 → 17.2.17
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/app.js +1 -1
- package/couch.js +11 -0
- package/http.js +1 -1
- package/package.json +1 -1
package/app.js
CHANGED
package/couch.js
CHANGED
|
@@ -116,6 +116,7 @@ export function makeCouch(opts) {
|
|
|
116
116
|
body: req.body ? JSON.stringify(req.body).slice(0, 4096) : null,
|
|
117
117
|
data: {
|
|
118
118
|
req: {
|
|
119
|
+
origin: dbOrigin,
|
|
119
120
|
path,
|
|
120
121
|
method: req.method,
|
|
121
122
|
headers: req.headers,
|
|
@@ -790,6 +791,15 @@ export function makeCouch(opts) {
|
|
|
790
791
|
return res.data
|
|
791
792
|
}
|
|
792
793
|
|
|
794
|
+
async function up(params, body, { client = defaultClient, signal } = {}) {
|
|
795
|
+
const res = await client.request({
|
|
796
|
+
path: '/_up',
|
|
797
|
+
method: 'GET',
|
|
798
|
+
signal,
|
|
799
|
+
throwOnError: true,
|
|
800
|
+
})
|
|
801
|
+
return await res.body.json()
|
|
802
|
+
}
|
|
793
803
|
async function upsert(pathname, diffFun, { client, signal } = {}) {
|
|
794
804
|
while (true) {
|
|
795
805
|
let doc
|
|
@@ -847,5 +857,6 @@ export function makeCouch(opts) {
|
|
|
847
857
|
info,
|
|
848
858
|
changes,
|
|
849
859
|
close,
|
|
860
|
+
up,
|
|
850
861
|
}
|
|
851
862
|
}
|
package/http.js
CHANGED
|
@@ -48,7 +48,7 @@ export async function request(ctx, next) {
|
|
|
48
48
|
|
|
49
49
|
res.setHeader('request-id', req.id)
|
|
50
50
|
|
|
51
|
-
const isHealthcheck = ctx.url.pathname === '/healthcheck'
|
|
51
|
+
const isHealthcheck = ctx.url.pathname === '/healthcheck' || ctx.url.pathname === '/_up'
|
|
52
52
|
|
|
53
53
|
reqLogger = logger.child({ req })
|
|
54
54
|
if (!isHealthcheck) {
|