Downgrade uuid to v9 and add sendNotification method

This commit is contained in:
Kyryll O 2026-05-25 15:29:00 +03:00
parent 519ecb23b2
commit 90d6298f1c
3 changed files with 30 additions and 6 deletions

22
package-lock.json generated
View File

@ -8,16 +8,20 @@
"name": "erp-plugin-sdk",
"version": "1.0.0",
"license": "ISC",
"bin": {
"create-erp-plugin": "dist/cli/index.js"
},
"devDependencies": {
"@nestjs/common": "^11.1.23",
"@nestjs/core": "^11.1.23",
"@nestjs/microservices": "^11.1.23",
"@types/node": "^25.9.1",
"@types/react": "^19.2.15",
"@types/uuid": "^9.0.8",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.2",
"typescript": "^6.0.3",
"uuid": "^14.0.0"
"uuid": "^9.0.1"
}
},
"node_modules/@borewit/text-codec": {
@ -236,6 +240,13 @@
"csstype": "^3.2.2"
}
},
"node_modules/@types/uuid": {
"version": "9.0.8",
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz",
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==",
"dev": true,
"license": "MIT"
},
"node_modules/consola": {
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz",
@ -474,9 +485,10 @@
"license": "MIT"
},
"node_modules/uuid": {
"version": "14.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.0.tgz",
"integrity": "sha512-Qo+uWgilfSmAhXCMav1uYFynlQO7fMFiMVZsQqZRMIXp0O7rR7qjkj+cPvBHLgBqi960QCoo/PH2/6ZtVqKvrg==",
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
"integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
"deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).",
"dev": true,
"funding": [
"https://github.com/sponsors/broofa",
@ -484,7 +496,7 @@
],
"license": "MIT",
"bin": {
"uuid": "dist-node/bin/uuid"
"uuid": "dist/bin/uuid"
}
}
}

View File

@ -25,9 +25,10 @@
"@nestjs/microservices": "^11.1.23",
"@types/node": "^25.9.1",
"@types/react": "^19.2.15",
"@types/uuid": "^9.0.8",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.2",
"typescript": "^6.0.3",
"uuid": "^14.0.0"
"uuid": "^9.0.1"
}
}

View File

@ -212,4 +212,15 @@ export class CoreService {
},
});
}
async sendNotification(payload: { userId: number | null; title: string; message: string; icon?: string; image?: string; details?: any }): Promise<void> {
await this.emit('system.notification.send', {
userId: payload.userId,
title: payload.title,
message: payload.message,
icon: payload.icon,
image: payload.image,
details: payload.details,
});
}
}