@nxtedition/lib 23.1.0 → 23.2.0

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.
Files changed (3) hide show
  1. package/app.js +12 -0
  2. package/couch.d.ts +2 -0
  3. package/package.json +1 -1
package/app.js CHANGED
@@ -993,6 +993,18 @@ export function makeApp(appConfig, onTerminate) {
993
993
  const server = http
994
994
  .createServer(async (req, res) => {
995
995
  try {
996
+ if (req.method === 'GET' && req.url === '/stats') {
997
+ res.setHeader('content-type', 'application/json')
998
+ res.end(JSON.stringify(stats$.value))
999
+ return
1000
+ }
1001
+
1002
+ if (req.method === 'GET' && req.url === '/status') {
1003
+ res.setHeader('content-type', 'application/json')
1004
+ res.end(JSON.stringify(status$.value))
1005
+ return
1006
+ }
1007
+
996
1008
  if (req.method === 'POST' && req.url === '/gc') {
997
1009
  utilsBC.postMessage({ type: 'utils:gc' })
998
1010
  res.end()
package/couch.d.ts CHANGED
@@ -11,6 +11,7 @@ export interface CouchRequestOptions<Stream extends boolean = false> {
11
11
  url?: URL
12
12
  pathname?: string
13
13
  path?: string
14
+ headers?: Record<string, string>
14
15
  method?: string
15
16
  body?: unknown
16
17
  query?: {
@@ -19,6 +20,7 @@ export interface CouchRequestOptions<Stream extends boolean = false> {
19
20
  update?: boolean
20
21
  seq?: string
21
22
  }
23
+ blocking?: boolean
22
24
  seq?: string
23
25
  signal?: AbortSignal
24
26
  logger?: Logger
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "23.1.0",
3
+ "version": "23.2.0",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",