@bernierllc/email-webhook-events 1.0.1 → 1.2.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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# 1.2.0 (2025-12-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ci:** add lerna version step before publish ([3d20300](https://github.com/bernierllc/tools/commit/3d203002143bf353fffafe4f8a78a99009567347))
|
|
12
|
+
* update neverhub-adapter deps to workspace:* and publish 0.1.2 ([f0e3d04](https://github.com/bernierllc/tools/commit/f0e3d04d8d4f094e3bb899ddf81e93243d16e2c2))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **email-webhook-events:** migrate to Vitest and add integration testing ([c45c75c](https://github.com/bernierllc/tools/commit/c45c75ce2db9cc9f45fe1be6c73e8018a427727c))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# 1.1.0 (2025-12-25)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* update neverhub-adapter deps to workspace:* and publish 0.1.2 ([f0e3d04](https://github.com/bernierllc/tools/commit/f0e3d04d8d4f094e3bb899ddf81e93243d16e2c2))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* **email-webhook-events:** migrate to Vitest and add integration testing ([c45c75c](https://github.com/bernierllc/tools/commit/c45c75ce2db9cc9f45fe1be6c73e8018a427727c))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
1
39
|
# @bernierllc/email-webhook-events
|
|
2
40
|
|
|
3
41
|
## 1.0.1
|
|
@@ -25,7 +25,7 @@ Redistribution or use in other products or commercial offerings is not permitted
|
|
|
25
25
|
|
|
26
26
|
import * as dotenv from 'dotenv';
|
|
27
27
|
import * as path from 'path';
|
|
28
|
-
|
|
28
|
+
// Jest provides describe, it, expect, beforeAll, afterAll, beforeEach as globals
|
|
29
29
|
import { EmailManager } from '@bernierllc/email-manager';
|
|
30
30
|
import { EmailWebhookEventsService, EmailProvider, EmailEventType } from '../../src/index';
|
|
31
31
|
import { WebhookTestServer, CapturedWebhook } from './webhook-server';
|
|
@@ -71,7 +71,12 @@ describeOrSkip('SendGrid Webhook Integration Tests', () => {
|
|
|
71
71
|
// Initialize email manager
|
|
72
72
|
emailManager = new EmailManager({
|
|
73
73
|
providers: [],
|
|
74
|
-
scheduling: {
|
|
74
|
+
scheduling: {
|
|
75
|
+
enabled: false,
|
|
76
|
+
checkIntervalMs: 60000,
|
|
77
|
+
maxRetries: 3,
|
|
78
|
+
retryDelayMs: 1000
|
|
79
|
+
} // Disable scheduler for tests
|
|
75
80
|
});
|
|
76
81
|
|
|
77
82
|
// Manually add provider and await to ensure it's registered before sending
|
|
@@ -133,7 +133,7 @@ If SendGrid changes their payload format:
|
|
|
133
133
|
## Example Test
|
|
134
134
|
|
|
135
135
|
```typescript
|
|
136
|
-
|
|
136
|
+
// Jest provides describe, it, expect as globals; use jest.fn() instead of vi.fn()
|
|
137
137
|
import { EmailWebhookEventsService } from '../../src';
|
|
138
138
|
import { createDeliveredEvent, createWebhookPayload } from '../mocks';
|
|
139
139
|
|
package/jest.config.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2025 Bernier LLC
|
|
3
|
+
|
|
4
|
+
This file is licensed to the client under a limited-use license.
|
|
5
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
module.exports = {
|
|
10
|
+
displayName: 'email-webhook-events',
|
|
11
|
+
preset: 'ts-jest',
|
|
12
|
+
testEnvironment: 'node',
|
|
13
|
+
roots: ['<rootDir>/__tests__'],
|
|
14
|
+
testMatch: ['**/*.test.ts'],
|
|
15
|
+
// Skip integration tests by default (require RUN_INTEGRATION_TESTS=true)
|
|
16
|
+
testPathIgnorePatterns: ['/node_modules/', '/__tests__/integration/'],
|
|
17
|
+
transform: {
|
|
18
|
+
'^.+\\.tsx?$': ['ts-jest', {
|
|
19
|
+
tsconfig: '<rootDir>/tsconfig.json',
|
|
20
|
+
}],
|
|
21
|
+
},
|
|
22
|
+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
23
|
+
collectCoverageFrom: [
|
|
24
|
+
'src/**/*.ts',
|
|
25
|
+
'!src/**/*.d.ts',
|
|
26
|
+
'!src/index.ts',
|
|
27
|
+
],
|
|
28
|
+
coverageThreshold: {
|
|
29
|
+
global: {
|
|
30
|
+
branches: 68, // TODO: Increase to 85% - current: 68.35%
|
|
31
|
+
functions: 85,
|
|
32
|
+
lines: 85,
|
|
33
|
+
statements: 85,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
coverageReporters: ['text', 'lcov', 'html'],
|
|
37
|
+
};
|
|
38
|
+
|
package/package.json
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bernierllc/email-webhook-events",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Email event tracking, normalization, and analytics service for processing webhooks from all email providers",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"test": "jest",
|
|
10
|
+
"test:run": "jest",
|
|
11
|
+
"test:coverage": "jest --coverage",
|
|
12
|
+
"lint": "eslint src --ext .ts",
|
|
13
|
+
"clean": "rm -rf dist"
|
|
14
|
+
},
|
|
7
15
|
"keywords": [
|
|
8
16
|
"email",
|
|
9
17
|
"webhooks",
|
|
@@ -20,20 +28,21 @@
|
|
|
20
28
|
"author": "Bernier LLC",
|
|
21
29
|
"license": "SEE LICENSE IN LICENSE",
|
|
22
30
|
"dependencies": {
|
|
23
|
-
"@bernierllc/email-manager": "0.
|
|
31
|
+
"@bernierllc/email-manager": "0.4.0"
|
|
24
32
|
},
|
|
25
33
|
"devDependencies": {
|
|
26
34
|
"@ngrok/ngrok": "^1.7.0",
|
|
27
35
|
"@types/express": "^4.17.0",
|
|
36
|
+
"@types/jest": "^29.5.0",
|
|
28
37
|
"@types/node": "^20.0.0",
|
|
29
38
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
30
39
|
"@typescript-eslint/parser": "^6.0.0",
|
|
31
|
-
"@vitest/coverage-v8": "^1.0.0",
|
|
32
40
|
"dotenv": "^16.0.0",
|
|
33
41
|
"eslint": "^8.0.0",
|
|
34
42
|
"express": "^4.18.0",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
43
|
+
"jest": "^29.7.0",
|
|
44
|
+
"ts-jest": "^29.4.0",
|
|
45
|
+
"typescript": "^5.0.0"
|
|
37
46
|
},
|
|
38
47
|
"publishConfig": {
|
|
39
48
|
"access": "public",
|
|
@@ -46,12 +55,5 @@
|
|
|
46
55
|
"logger": "integrated"
|
|
47
56
|
}
|
|
48
57
|
},
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
"test": "vitest",
|
|
52
|
-
"test:run": "vitest run",
|
|
53
|
-
"test:coverage": "vitest run --coverage",
|
|
54
|
-
"lint": "eslint src --ext .ts",
|
|
55
|
-
"clean": "rm -rf dist"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
+
"gitHead": "af7e74b3715d56d3a193e1bb6743b337c2b0df6d"
|
|
59
|
+
}
|
package/vitest.config.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (c) 2025 Bernier LLC
|
|
3
|
-
|
|
4
|
-
This file is licensed to the client under a limited-use license.
|
|
5
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { defineConfig } from 'vitest/config';
|
|
10
|
-
|
|
11
|
-
export default defineConfig({
|
|
12
|
-
test: {
|
|
13
|
-
globals: true,
|
|
14
|
-
environment: 'node',
|
|
15
|
-
include: ['**/__tests__/**/*.test.ts'],
|
|
16
|
-
coverage: {
|
|
17
|
-
provider: 'v8',
|
|
18
|
-
reporter: ['text', 'json', 'html'],
|
|
19
|
-
exclude: [
|
|
20
|
-
'**/__tests__/**',
|
|
21
|
-
'**/dist/**',
|
|
22
|
-
'**/*.d.ts',
|
|
23
|
-
'**/index.ts'
|
|
24
|
-
],
|
|
25
|
-
thresholds: {
|
|
26
|
-
branches: 68, // TODO: Increase to 85% - current: 68.35%
|
|
27
|
-
functions: 85,
|
|
28
|
-
lines: 85,
|
|
29
|
-
statements: 85
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|