@lensjs/adonis 1.2.4 → 1.3.1

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.
@@ -23,6 +23,8 @@ export default class LensServiceProvider {
23
23
  config.ignoredPaths = ignoredPaths;
24
24
  if (config.watchers.exceptions) {
25
25
  this.app.container.bindValue('watchExceptions', async (error, ctx) => {
26
+ if (!config.enabled)
27
+ return;
26
28
  const payload = lensExceptionUtils.constructErrorObject(error);
27
29
  const requestId = ctx.request.lensEntry?.requestId;
28
30
  await watchersMap.exceptions?.log({
@@ -43,7 +45,7 @@ export default class LensServiceProvider {
43
45
  .setIgnoredPaths(ignoredPaths)
44
46
  .setOnlyPaths(config.onlyPaths);
45
47
  await Lens.setWatchers(allowedWatchers).setAdapter(adapter).start({
46
- basePath: normalizedPath,
48
+ path: normalizedPath,
47
49
  enabled: config.enabled,
48
50
  appName: config.appName,
49
51
  });
@@ -78,7 +78,7 @@ export default class AdonisAdapter extends LensAdapter {
78
78
  },
79
79
  user: await self.getUserFromContext(event.ctx),
80
80
  };
81
- await requestWatcher.log(logPayload);
81
+ await requestWatcher.log(logPayload, self.config.hiddenParams);
82
82
  });
83
83
  }
84
84
  async watchQueries(queryWatcher) {
@@ -1,10 +1,8 @@
1
1
  import { HttpContext } from '@adonisjs/core/http';
2
2
  import { QueryType, UserEntry } from '../../core/dist/types/index.js';
3
+ import type { LensConfig as BaseLensConfig } from '@lensjs/core';
3
4
  type AdonisQueryType = Extract<QueryType, "postgresql" | "sqlite" | "mysql" | "mariadb" | "plsql" | "transactsql">;
4
5
  export type LensConfig = {
5
- appName: string;
6
- path: string;
7
- enabled: boolean;
8
6
  ignoredPaths: RegExp[];
9
7
  onlyPaths: RegExp[];
10
8
  watchers: {
@@ -18,6 +16,6 @@ export type LensConfig = {
18
16
  };
19
17
  isAuthenticated?: (ctx: HttpContext) => Promise<boolean>;
20
18
  getUser?: (ctx: HttpContext) => Promise<UserEntry>;
21
- };
19
+ } & BaseLensConfig;
22
20
  export declare function defineConfig(config: LensConfig): import("@adonisjs/core/types").ConfigProvider<LensConfig>;
23
21
  export {};
@@ -19,6 +19,23 @@ const lensConfig = defineConfig({
19
19
  provider: 'sqlite', // Change to your database provider
20
20
  }
21
21
  },
22
+ hiddenParams: {
23
+ headers: [
24
+ 'Authorization',
25
+ 'Basic'
26
+ ],
27
+ bodyParams: [
28
+ 'password',
29
+ 'passwordConfirmation',
30
+ 'secret',
31
+ 'password_confirmation'
32
+ ],
33
+ },
34
+ storeQueueConfig: {
35
+ batchSize: 500,
36
+ processIntervalMs: 500,
37
+ warnThreshold: 100_000,
38
+ },
22
39
  // Optional
23
40
  isAuthenticated: async (ctx) => {
24
41
  return await ctx.auth?.check()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lensjs/adonis",
3
3
  "description": "AdonisJs adapter for lens package",
4
- "version": "1.2.4",
4
+ "version": "1.3.1",
5
5
  "engines": {
6
6
  "node": ">=20.6.0"
7
7
  },
@@ -47,8 +47,8 @@
47
47
  "dependencies": {
48
48
  "@poppinss/utils": "^6.10.1",
49
49
  "chalk": "^5.6.0",
50
- "@lensjs/date": "1.0.12",
51
- "@lensjs/core": "2.2.2"
50
+ "@lensjs/core": "2.3.1",
51
+ "@lensjs/date": "1.0.12"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public",