@nxtedition/lib 26.8.0 → 26.8.2

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 +9 -1
  2. package/couch.d.ts +3 -2
  3. package/package.json +1 -1
package/app.js CHANGED
@@ -702,7 +702,10 @@ export function makeApp(appConfig, onTerminate) {
702
702
  ),
703
703
  rx.map(([serviceStats, appStats, undiciStats]) => ({
704
704
  ...appStats,
705
- undici: undiciStats,
705
+ undici: {
706
+ sockets: globalThis.__undici_sockets?.size,
707
+ ...undiciStats,
708
+ },
706
709
  [serviceName]: serviceStats,
707
710
  })),
708
711
  rx.retryWhen((err$) =>
@@ -771,6 +774,11 @@ export function makeApp(appConfig, onTerminate) {
771
774
  undici$.pipe(
772
775
  rx.map((stats) => {
773
776
  return [
777
+ {
778
+ id: 'app:undici_upstream_sockets',
779
+ level: stats.sockets > 8192 ? 50 : stats.sockets > 4096 ? 40 : 30,
780
+ msg: `Undici: ${stats.sockets} upstream connected`,
781
+ },
774
782
  {
775
783
  id: 'app:undici_upstream_connections',
776
784
  level: stats.connections > 8192 ? 50 : stats.connections > 4096 ? 40 : 30,
package/couch.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { Logger } from './logger.js'
2
2
  import { HttpError } from 'http-errors'
3
+ import type { Readable } from 'node:stream'
3
4
 
4
5
  export interface CouchOptions {
5
6
  url?: string
@@ -38,8 +39,8 @@ export interface CouchResponse<T> {
38
39
 
39
40
  export function request<T, Stream extends boolean = false>(
40
41
  url: string | URL | { origin: string; path?: string; pathname?: string },
41
- opts?: CouchRequestOptions<Stream> | null,
42
- ): Stream extends true ? AsyncGenerator<T> & { length: number } : Promise<CouchResponse<T>>
42
+ opts?: CouchRequestOptione<Stream> | null,
43
+ ): Stream extends true ? Readable : Promise<CouchResponse<T>>
43
44
 
44
45
  interface ChangesOptions {
45
46
  signal?: AbortSignal | null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "26.8.0",
3
+ "version": "26.8.2",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",