@vulog/aima-notifier 1.0.0 → 1.0.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.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @vulog/aima-notifier
2
2
 
3
+ run `npm install @vulog/aima-notifier
4
+
3
5
  # sendEmail
4
6
 
5
7
  Call the AiMA notifier component to send an email
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vulog/aima-notifier",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,8 @@
8
8
  "build": "tsup",
9
9
  "dev": "tsup --watch",
10
10
  "test": "vitest run",
11
- "test:watch": "vitest"
11
+ "test:watch": "vitest",
12
+ "lint": "eslint src/**/* --ext .ts"
12
13
  },
13
14
  "keywords": [
14
15
  "AIMA",
@@ -18,18 +19,17 @@
18
19
  "author": "Vulog",
19
20
  "license": "ISC",
20
21
  "devDependencies": {
21
- "@types/lodash": "^4.17.12",
22
- "@types/node": "^22.7.9",
22
+ "@types/node": "^22.10.1",
23
23
  "eslint-config-airbnb-base": "^15.0.0",
24
24
  "eslint-config-airbnb-typescript": "^18.0.0",
25
25
  "eslint-config-prettier": "^9.1.0",
26
26
  "eslint-plugin-import": "^2.31.0",
27
27
  "eslint-plugin-prettier": "^5.2.1",
28
28
  "eslint-plugin-unused-imports": "^4.1.4",
29
- "prettier": "^3.3.3",
30
- "tsup": "^8.3.0",
31
- "typescript": "^5.6.3",
32
- "vitest": "^2.1.3"
29
+ "prettier": "^3.4.1",
30
+ "tsup": "^8.3.5",
31
+ "typescript": "^5.7.2",
32
+ "vitest": "^2.1.8"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@vulog/aima-client": "^1.0.0",
@@ -38,4 +38,4 @@
38
38
  "zod": "^3.23.8"
39
39
  },
40
40
  "description": ""
41
- }
41
+ }
package/src/index.ts CHANGED
@@ -1 +1 @@
1
- export { sendEmail } from './sendEmail';
1
+ export { SendEmailData, SendEmailParam, sendEmail } from './sendEmail';
@@ -51,9 +51,9 @@ describe('sendEmail', () => {
51
51
  type: 'test-type',
52
52
  };
53
53
 
54
- const rejects = await expect(() => sendEmail(client, body)).rejects;
55
- rejects.toThrowError('Invalid data');
56
- rejects.toSatisfy((error: any) => {
54
+ const rejects = expect(() => sendEmail(client, body)).rejects;
55
+ await rejects.toThrowError('Invalid data');
56
+ await rejects.toSatisfy((error: any) => {
57
57
  expect(error).toHaveProperty('cause');
58
58
  expect(error.cause).toHaveLength(1);
59
59
  expect(error.cause[0]).toHaveProperty('validation');
@@ -67,9 +67,9 @@ describe('sendEmail', () => {
67
67
  test('call missing all param', async () => {
68
68
  const body = {} as unknown as SendEmailParam;
69
69
 
70
- const rejects = await expect(() => sendEmail(client, body)).rejects;
71
- rejects.toThrowError('Invalid data');
72
- rejects.toSatisfy((error: any) => {
70
+ const rejects = expect(() => sendEmail(client, body)).rejects;
71
+ await rejects.toThrowError('Invalid data');
72
+ await rejects.toSatisfy((error: any) => {
73
73
  expect(error).toHaveProperty('cause');
74
74
  expect(error.cause).toHaveLength(4);
75
75
  expect(error.cause[0]).toHaveProperty('message');
@@ -84,9 +84,9 @@ describe('sendEmail', () => {
84
84
  };
85
85
  const body = null as unknown as SendEmailParam;
86
86
 
87
- const rejects = await expect(() => sendEmail(client, body)).rejects;
88
- rejects.toThrowError('Invalid data');
89
- rejects.toSatisfy((error: any) => {
87
+ const rejects = expect(() => sendEmail(client, body)).rejects;
88
+ await rejects.toThrowError('Invalid data');
89
+ await rejects.toSatisfy((error: any) => {
90
90
  expect(error).toHaveProperty('cause');
91
91
  expect(error.cause).toHaveLength(1);
92
92
  const cause = error.cause[0];