@nxtedition/lib 23.0.5 → 23.0.7

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.d.ts +6 -8
  2. package/couch.js +16 -1
  3. package/package.json +14 -14
package/app.d.ts CHANGED
@@ -5,28 +5,26 @@ import type { CouchClient } from './couch.js'
5
5
  import type { Server } from 'http'
6
6
  import type { BehaviorSubject } from 'rxjs'
7
7
 
8
- export function makeApp<AC extends AppConfig, Records, RpcMethods>(
9
- appConfig: AC,
8
+ export function makeApp<Records, RpcMethods, Config = Record<string, unknown>>(
9
+ appConfig: AppConfig<Config>,
10
10
  onTerminate?: (logger: Logger) => Promise<void>,
11
11
  ): App<AC, Records, RpcMethods>
12
12
 
13
- export interface AppConfig {
13
+ export interface AppConfig<Config = Record<string, unknown>> {
14
14
  name: string
15
15
  module?: string
16
16
  version?: string
17
- config: {
18
- [key: string]: unknown
19
- }
17
+ config: Config
20
18
  [key: string]: unknown
21
19
  }
22
20
 
23
- export interface App<AC extends AppConfig, Records, RpcMethods> {
21
+ export interface App<Records, RpcMethods, Config = Record<string, unknown>> {
24
22
  ds: DeepstreamClientWithNxt<Records, RpcMethods>
25
23
  nxt: NxtDeepstreamClient<Records, RpcMethods>
26
24
  couch: CouchClient
27
25
  server: Server
28
26
  compiler: unkonwn
29
- config: AC['config']
27
+ config: Config
30
28
  logger: Logger
31
29
  trace: unknown
32
30
  trace: unknown
package/couch.js CHANGED
@@ -1063,11 +1063,26 @@ export function request(url, opts) {
1063
1063
 
1064
1064
  if (opts == null && typeof url === 'object' && url != null) {
1065
1065
  opts = url
1066
- url = null
1066
+ }
1067
+
1068
+ url = opts.url
1069
+
1070
+ let origin = url.origin
1071
+ if (!origin) {
1072
+ const protocol = url.protocol ?? 'http:'
1073
+ const host = url.host ?? `${url.hostname}:${url.port ?? (protocol === 'https:' ? 443 : 80)}`
1074
+ origin = `${protocol}//${host}`
1075
+ }
1076
+
1077
+ let path = url.path
1078
+ if (!path) {
1079
+ path = url.search ? `${url.pathname}${url.search}` : url.pathname
1067
1080
  }
1068
1081
 
1069
1082
  const ureq = {
1070
1083
  ...opts,
1084
+ origin,
1085
+ path,
1071
1086
  method: opts.method ?? (opts.body ? 'POST' : 'GET'),
1072
1087
  blocking: opts.blocking ?? Boolean(opts.stream),
1073
1088
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "23.0.5",
3
+ "version": "23.0.7",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
@@ -60,11 +60,11 @@
60
60
  "singleQuote": true
61
61
  },
62
62
  "dependencies": {
63
- "@aws-sdk/client-s3": "^3.731.1",
63
+ "@aws-sdk/client-s3": "^3.735.0",
64
64
  "@elastic/elasticsearch": "^8.16.1",
65
- "@elastic/transport": "^8.9.3",
66
- "@nxtedition/nxt-undici": "^6.0.0",
67
- "@swc/wasm-web": "^1.10.1",
65
+ "@elastic/transport": "^8.9.4",
66
+ "@nxtedition/nxt-undici": "^6.0.9",
67
+ "@swc/wasm-web": "^1.10.11",
68
68
  "content-type": "^1.0.5",
69
69
  "date-fns": "^3.6.0",
70
70
  "fast-querystring": "^1.1.1",
@@ -75,27 +75,27 @@
75
75
  "lodash": "^4.17.21",
76
76
  "lru-cache": "^11.0.2",
77
77
  "mime": "^4.0.6",
78
- "mitata": "^1.0.31",
79
- "moment-timezone": "^0.5.46",
78
+ "mitata": "^1.0.32",
79
+ "moment-timezone": "^0.5.47",
80
80
  "nconf": "^0.12.1",
81
81
  "nested-error-stacks": "^2.1.1",
82
82
  "object-hash": "^3.0.0",
83
- "p-queue": "^8.0.1",
83
+ "p-queue": "^8.1.0",
84
84
  "pino": "^9.6.0",
85
85
  "qs": "^6.14.0",
86
86
  "request-target": "^1.0.2",
87
87
  "smpte-timecode": "^1.3.6",
88
88
  "split-string": "^6.0.0",
89
- "undici": "^7.2.3",
89
+ "undici": "^7.3.0",
90
90
  "url-join": "^5.0.0",
91
91
  "xuid": "^4.1.5",
92
92
  "yocto-queue": "^1.1.1"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@nxtedition/deepstream.io-client-js": ">=28.1.5",
96
- "@types/lodash": "^4.17.14",
97
- "@types/node": "^22.10.7",
98
- "eslint": "^9.15.0",
96
+ "@types/lodash": "^4.17.15",
97
+ "@types/node": "^22.12.0",
98
+ "eslint": "^9.19.0",
99
99
  "eslint-config-prettier": "^10.0.1",
100
100
  "eslint-config-standard": "^17.0.0",
101
101
  "eslint-plugin-import": "^2.31.0",
@@ -103,13 +103,13 @@
103
103
  "eslint-plugin-node": "^11.1.0",
104
104
  "eslint-plugin-promise": "^7.2.1",
105
105
  "husky": "^9.1.7",
106
- "lint-staged": "^15.3.0",
106
+ "lint-staged": "^15.4.3",
107
107
  "pinst": "^3.0.0",
108
108
  "prettier": "^3.4.2",
109
109
  "rxjs": "^7.5.6",
110
110
  "send": "^1.1.0",
111
111
  "tap": "^21.0.1",
112
- "typescript-eslint": "^8.20.0"
112
+ "typescript-eslint": "^8.22.0"
113
113
  },
114
114
  "peerDependencies": {
115
115
  "@elastic/elasticsearch": "^8.6.0",