@nxtedition/lib 23.3.0 → 23.3.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.
- package/app.js +4 -13
- package/package.json +13 -13
- package/s3.js +13 -4
package/app.js
CHANGED
|
@@ -401,10 +401,6 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
401
401
|
url.pathname = '/deepstream'
|
|
402
402
|
}
|
|
403
403
|
|
|
404
|
-
if (!url.port) {
|
|
405
|
-
url.port = '6020'
|
|
406
|
-
}
|
|
407
|
-
|
|
408
404
|
let prevConnectionState
|
|
409
405
|
ds = deepstream(url.toString(), dsConfig)
|
|
410
406
|
.login(dsConfig.credentials, (success, authData) => {
|
|
@@ -870,9 +866,7 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
870
866
|
}
|
|
871
867
|
|
|
872
868
|
// TODO (fix): Determinisitc port also in dev mode... hash of something?
|
|
873
|
-
const port =
|
|
874
|
-
appConfig.inspect?.port ??
|
|
875
|
-
(isProduction ? 38603 : Math.floor(38000 + Math.random() * 10000))
|
|
869
|
+
const port = appConfig.inspect?.port ?? (isProduction ? 38603 : 0)
|
|
876
870
|
const server = http
|
|
877
871
|
.createServer(async (req, res) => {
|
|
878
872
|
try {
|
|
@@ -928,10 +922,9 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
928
922
|
}
|
|
929
923
|
})
|
|
930
924
|
.listen(port)
|
|
925
|
+
.once('listening', () => logger.debug({ port: server.address().port }, 'inspect listening'))
|
|
931
926
|
.unref()
|
|
932
927
|
|
|
933
|
-
logger.debug({ port }, 'inspect listening')
|
|
934
|
-
|
|
935
928
|
destroyers.unshift(() => new Promise((resolve) => server.close(resolve)))
|
|
936
929
|
}
|
|
937
930
|
|
|
@@ -989,8 +982,7 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
989
982
|
|
|
990
983
|
if (isMainThread) {
|
|
991
984
|
// TODO (fix): Determinisitc port also in dev mode... hash of something?
|
|
992
|
-
const port =
|
|
993
|
-
appConfig.utils?.port ?? (isProduction ? 38604 : Math.floor(38000 + Math.random() * 10000))
|
|
985
|
+
const port = appConfig.utils?.port ?? (isProduction ? 38604 : 0)
|
|
994
986
|
|
|
995
987
|
const server = http
|
|
996
988
|
.createServer(async (req, res) => {
|
|
@@ -1033,10 +1025,9 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
1033
1025
|
}
|
|
1034
1026
|
})
|
|
1035
1027
|
.listen(port)
|
|
1028
|
+
.once('listening', () => logger.debug({ port: server.address().port }, 'utils listening'))
|
|
1036
1029
|
.unref()
|
|
1037
1030
|
|
|
1038
|
-
logger.debug({ port }, 'utils listening')
|
|
1039
|
-
|
|
1040
1031
|
destroyers.unshift(() => new Promise((resolve) => server.close(resolve)))
|
|
1041
1032
|
}
|
|
1042
1033
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/lib",
|
|
3
|
-
"version": "23.3.
|
|
3
|
+
"version": "23.3.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Nagy <robert.nagy@boffins.se>",
|
|
6
6
|
"type": "module",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"scripts": {
|
|
47
47
|
"prepublishOnly": "pinst --disable",
|
|
48
48
|
"postpublish": "pinst --enable",
|
|
49
|
-
"test": "node --test",
|
|
49
|
+
"test": "node --test-timeout 60000 --test",
|
|
50
50
|
"prepare": "husky"
|
|
51
51
|
},
|
|
52
52
|
"lint-staged": {
|
|
@@ -61,14 +61,14 @@
|
|
|
61
61
|
"singleQuote": true
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@aws-sdk/client-s3": "^3.
|
|
64
|
+
"@aws-sdk/client-s3": "^3.749.0",
|
|
65
65
|
"@elastic/elasticsearch": "^8.16.1",
|
|
66
66
|
"@elastic/transport": "^8.9.3",
|
|
67
|
-
"@nxtedition/nxt-undici": "^6.
|
|
68
|
-
"@swc/wasm-web": "^1.10.
|
|
67
|
+
"@nxtedition/nxt-undici": "^6.1.2",
|
|
68
|
+
"@swc/wasm-web": "^1.10.16",
|
|
69
69
|
"canvas": "^3.1.0",
|
|
70
70
|
"content-type": "^1.0.5",
|
|
71
|
-
"date-fns": "^
|
|
71
|
+
"date-fns": "^4.1.0",
|
|
72
72
|
"fast-querystring": "^1.1.1",
|
|
73
73
|
"hasha": "^6.0.0",
|
|
74
74
|
"http-errors": "^2.0.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"lodash": "^4.17.21",
|
|
78
78
|
"lru-cache": "^11.0.2",
|
|
79
79
|
"mime": "^4.0.6",
|
|
80
|
-
"mitata": "^1.0.
|
|
80
|
+
"mitata": "^1.0.34",
|
|
81
81
|
"moment-timezone": "^0.5.46",
|
|
82
82
|
"nconf": "^0.12.1",
|
|
83
83
|
"nested-error-stacks": "^2.1.1",
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
"yocto-queue": "^1.1.1"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@nxtedition/deepstream.io-client-js": ">=28.1.
|
|
97
|
+
"@nxtedition/deepstream.io-client-js": ">=28.1.6",
|
|
98
98
|
"@types/lodash": "^4.17.14",
|
|
99
|
-
"@types/node": "^22.
|
|
100
|
-
"eslint": "^9.
|
|
99
|
+
"@types/node": "^22.13.4",
|
|
100
|
+
"eslint": "^9.20.1",
|
|
101
101
|
"eslint-config-prettier": "^10.0.1",
|
|
102
102
|
"eslint-config-standard": "^17.0.0",
|
|
103
103
|
"eslint-plugin-import": "^2.31.0",
|
|
@@ -107,11 +107,11 @@
|
|
|
107
107
|
"husky": "^9.1.7",
|
|
108
108
|
"lint-staged": "^15.3.0",
|
|
109
109
|
"pinst": "^3.0.0",
|
|
110
|
-
"prettier": "^3.
|
|
110
|
+
"prettier": "^3.5.1",
|
|
111
111
|
"rxjs": "^7.5.6",
|
|
112
112
|
"send": "^1.1.0",
|
|
113
|
-
"tap": "^21.0.
|
|
114
|
-
"typescript-eslint": "^8.
|
|
113
|
+
"tap": "^21.0.2",
|
|
114
|
+
"typescript-eslint": "^8.24.0"
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"@elastic/elasticsearch": "^8.6.0",
|
package/s3.js
CHANGED
|
@@ -4,7 +4,7 @@ import tp from 'node:timers/promises'
|
|
|
4
4
|
import AWS from '@aws-sdk/client-s3'
|
|
5
5
|
import PQueue from 'p-queue'
|
|
6
6
|
import { NodeHttpHandler } from '@smithy/node-http-handler'
|
|
7
|
-
import
|
|
7
|
+
import { request as undiciRequest, parseHeaders } from '@nxtedition/nxt-undici'
|
|
8
8
|
|
|
9
9
|
const QUEUE = new PQueue({ concurrency: 8 })
|
|
10
10
|
const MD5_HEX_EXPR = /^[A-F0-9]{32}$/i
|
|
@@ -46,19 +46,28 @@ class UndiciRequestHandler extends NodeHttpHandler {
|
|
|
46
46
|
const abortSignal = options?.abortSignal
|
|
47
47
|
|
|
48
48
|
const { protocol, hostname, port, path, ...requestOptions } = request
|
|
49
|
-
// NOTE: Expect header is not supported by undici
|
|
50
|
-
const {
|
|
49
|
+
// NOTE: Expect & Transfer-Encoding header is not supported by undici
|
|
50
|
+
const {
|
|
51
|
+
expect,
|
|
52
|
+
'transfer-encoding': transferEncoding,
|
|
53
|
+
...headers
|
|
54
|
+
} = parseHeaders(request.headers)
|
|
51
55
|
const typedMethod = /** @type {import('undici').Dispatcher.HttpMethod} */ (request.method)
|
|
52
56
|
|
|
53
57
|
const url = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : ''}${request.path}`
|
|
54
58
|
|
|
55
|
-
const response = await
|
|
59
|
+
const response = await undiciRequest(url, {
|
|
56
60
|
...requestOptions,
|
|
57
61
|
method: typedMethod,
|
|
58
62
|
signal: abortSignal,
|
|
59
63
|
dispatcher: this.#dispatcher,
|
|
60
64
|
headers,
|
|
61
65
|
body: request.body,
|
|
66
|
+
// nxt-undici
|
|
67
|
+
error: false,
|
|
68
|
+
dns: false,
|
|
69
|
+
retry: false,
|
|
70
|
+
follow: false,
|
|
62
71
|
})
|
|
63
72
|
|
|
64
73
|
return {
|