autotel-mongoose 2.0.0 → 2.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autotel-mongoose",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
4
4
  "description": "OpenTelemetry instrumentation for Mongoose with db.query.text capture and automatic redaction",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -31,21 +31,21 @@
31
31
  "author": "Jag Reehal <jag@jagreehal.com> (https://jagreehal.com)",
32
32
  "license": "MIT",
33
33
  "peerDependencies": {
34
- "mongoose": ">=9.4.1",
34
+ "mongoose": ">=9.6.1",
35
35
  "autotel": "*"
36
36
  },
37
37
  "devDependencies": {
38
- "@opentelemetry/context-async-hooks": "^2.7.0",
39
- "@opentelemetry/core": "^2.7.0",
40
- "@opentelemetry/sdk-trace-node": "^2.7.0",
38
+ "@opentelemetry/context-async-hooks": "^2.7.1",
39
+ "@opentelemetry/core": "^2.7.1",
40
+ "@opentelemetry/sdk-trace-node": "^2.7.1",
41
41
  "@types/node": "^25.6.0",
42
- "mongodb-memory-server": "^11.0.1",
42
+ "mongodb-memory-server": "^11.1.0",
43
43
  "mongoose": "^9.5.0",
44
44
  "rimraf": "^6.1.3",
45
45
  "tsup": "^8.5.1",
46
46
  "typescript": "^6.0.3",
47
47
  "vitest": "^4.1.5",
48
- "autotel": "3.0.0"
48
+ "autotel": "3.0.3"
49
49
  },
50
50
  "repository": {
51
51
  "type": "git",
@@ -59,8 +59,8 @@
59
59
  "scripts": {
60
60
  "build": "tsup",
61
61
  "dev": "tsup --watch",
62
- "lint": "npx eslint src/**/*.ts",
63
- "lint:fix": "npx eslint src/**/*.ts --fix",
62
+ "lint": "eslint src/**/*.ts",
63
+ "lint:fix": "eslint src/**/*.ts --fix",
64
64
  "type-check": "tsc --noEmit",
65
65
  "test": "vitest run",
66
66
  "test:watch": "vitest",
@@ -102,7 +102,8 @@ describe('instrumentMongoose integration', () => {
102
102
  );
103
103
  const queryText = findSpan!.attributes[ATTR_DB_QUERY_TEXT] as string;
104
104
  expect(queryText).not.toContain('alice@example.com');
105
- expect(queryText).toContain('[REDACTED]');
105
+ // Default preset smart-masks emails as a***@***.com.
106
+ expect(queryText).toContain('a***@***.com');
106
107
  });
107
108
 
108
109
  it('captures db.query.text for save operations', async () => {
@@ -31,9 +31,9 @@ describe('createStatementCapture', () => {
31
31
  condition: { email: 'test@example.com' },
32
32
  });
33
33
  expect(result).toBeDefined();
34
- // Email should be redacted by default preset
34
+ // Email should be smart-masked by the default preset (t***@***.com).
35
35
  expect(result).not.toContain('test@example.com');
36
- expect(result).toContain('[REDACTED]');
36
+ expect(result).toContain('t***@***.com');
37
37
  });
38
38
 
39
39
  it('returns undefined when dbStatementSerializer is false', () => {