@lensjs/express 1.3.2 → 1.4.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.
package/dist/adapter.cjs CHANGED
@@ -197,7 +197,7 @@ var ExpressAdapter = class extends import_core.LensAdapter {
197
197
  },
198
198
  user: await this.config.isAuthenticated?.(req) ? await this.config.getUser?.(req) : null
199
199
  };
200
- await requestWatcher.log(logPayload);
200
+ await requestWatcher.log(logPayload, this.config.hiddenParams);
201
201
  } catch (err) {
202
202
  console.error("Error finalizing request log:", err);
203
203
  }
package/dist/adapter.js CHANGED
@@ -169,7 +169,7 @@ var ExpressAdapter = class extends LensAdapter {
169
169
  },
170
170
  user: await this.config.isAuthenticated?.(req) ? await this.config.getUser?.(req) : null
171
171
  };
172
- await requestWatcher.log(logPayload);
172
+ await requestWatcher.log(logPayload, this.config.hiddenParams);
173
173
  } catch (err) {
174
174
  console.error("Error finalizing request log:", err);
175
175
  }
package/dist/index.cjs CHANGED
@@ -202,7 +202,7 @@ var ExpressAdapter = class extends import_core.LensAdapter {
202
202
  },
203
203
  user: await this.config.isAuthenticated?.(req) ? await this.config.getUser?.(req) : null
204
204
  };
205
- await requestWatcher.log(logPayload);
205
+ await requestWatcher.log(logPayload, this.config.hiddenParams);
206
206
  } catch (err) {
207
207
  console.error("Error finalizing request log:", err);
208
208
  }
@@ -275,7 +275,7 @@ var lens = async (config) => {
275
275
  await import_core2.Lens.setAdapter(adapter).setWatchers(watchers).start({
276
276
  appName: mergedConfig.appName,
277
277
  enabled: mergedConfig.enabled,
278
- basePath: normalizedPath
278
+ path: normalizedPath
279
279
  });
280
280
  return {
281
281
  handleExceptions: () => handleExceptions({
package/dist/index.js CHANGED
@@ -179,7 +179,7 @@ var ExpressAdapter = class extends LensAdapter {
179
179
  },
180
180
  user: await this.config.isAuthenticated?.(req) ? await this.config.getUser?.(req) : null
181
181
  };
182
- await requestWatcher.log(logPayload);
182
+ await requestWatcher.log(logPayload, this.config.hiddenParams);
183
183
  } catch (err) {
184
184
  console.error("Error finalizing request log:", err);
185
185
  }
@@ -252,7 +252,7 @@ var lens = async (config) => {
252
252
  await Lens.setAdapter(adapter).setWatchers(watchers).start({
253
253
  appName: mergedConfig.appName,
254
254
  enabled: mergedConfig.enabled,
255
- basePath: normalizedPath
255
+ path: normalizedPath
256
256
  });
257
257
  return {
258
258
  handleExceptions: () => handleExceptions({
@@ -1,12 +1,9 @@
1
1
  import { Express, Request } from 'express';
2
2
  import { QueryWatcherHandler } from '@lensjs/watchers';
3
- import { UserEntry } from '@lensjs/core';
3
+ import { UserEntry, LensConfig } from '@lensjs/core';
4
4
 
5
5
  type ExpressAdapterConfig = {
6
6
  app: Express;
7
- appName?: string;
8
- enabled?: boolean;
9
- path?: string;
10
7
  ignoredPaths?: RegExp[];
11
8
  onlyPaths?: RegExp[];
12
9
  requestWatcherEnabled?: boolean;
@@ -18,7 +15,7 @@ type ExpressAdapterConfig = {
18
15
  };
19
16
  isAuthenticated?: (request: Request) => Promise<boolean>;
20
17
  getUser?: (request: Request) => Promise<UserEntry>;
21
- };
18
+ } & Partial<LensConfig>;
22
19
  type RequiredExpressAdapterConfig = Required<ExpressAdapterConfig> & {
23
20
  queryWatcher?: ExpressAdapterConfig["queryWatcher"];
24
21
  isAuthenticated?: ExpressAdapterConfig["isAuthenticated"];
@@ -1,12 +1,9 @@
1
1
  import { Express, Request } from 'express';
2
2
  import { QueryWatcherHandler } from '@lensjs/watchers';
3
- import { UserEntry } from '@lensjs/core';
3
+ import { UserEntry, LensConfig } from '@lensjs/core';
4
4
 
5
5
  type ExpressAdapterConfig = {
6
6
  app: Express;
7
- appName?: string;
8
- enabled?: boolean;
9
- path?: string;
10
7
  ignoredPaths?: RegExp[];
11
8
  onlyPaths?: RegExp[];
12
9
  requestWatcherEnabled?: boolean;
@@ -18,7 +15,7 @@ type ExpressAdapterConfig = {
18
15
  };
19
16
  isAuthenticated?: (request: Request) => Promise<boolean>;
20
17
  getUser?: (request: Request) => Promise<UserEntry>;
21
- };
18
+ } & Partial<LensConfig>;
22
19
  type RequiredExpressAdapterConfig = Required<ExpressAdapterConfig> & {
23
20
  queryWatcher?: ExpressAdapterConfig["queryWatcher"];
24
21
  isAuthenticated?: ExpressAdapterConfig["isAuthenticated"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensjs/express",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "Express adapter for LensJs",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -39,10 +39,10 @@
39
39
  ],
40
40
  "dependencies": {
41
41
  "express": "^5.1.0",
42
- "@lensjs/core": "2.2.1",
42
+ "@lensjs/core": "2.3.0",
43
43
  "@lensjs/date": "1.0.12",
44
- "@lensjs/typescript-config": "1.0.12",
45
- "@lensjs/watchers": "1.0.17"
44
+ "@lensjs/watchers": "1.1.0",
45
+ "@lensjs/typescript-config": "1.0.12"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/express": "^5.0.3",