@cap-js-community/event-queue 2.0.2 → 2.0.4
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": "@cap-js-community/event-queue",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "An event queue that enables secure transactional processing of asynchronous and periodic events, featuring instant event processing with Redis Pub/Sub and load distribution across all application instances.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"start": "PORT=4005 cds-serve",
|
|
26
26
|
"watch": "PORT=4005 cds watch",
|
|
27
|
-
"test:unit": "jest --
|
|
28
|
-
"test:integration": "jest --
|
|
29
|
-
"voter:test:integration": "jest --
|
|
30
|
-
"test": "
|
|
27
|
+
"test:unit": "jest --selectProjects unit",
|
|
28
|
+
"test:integration": "jest --selectProjects integration --runInBand",
|
|
29
|
+
"voter:test:integration": "jest --selectProjects integration",
|
|
30
|
+
"test": "jest --runInBand",
|
|
31
31
|
"test:all:coverage": "jest --runInBand --forceExit --collect-coverage",
|
|
32
32
|
"test:prepare": "npm run build:ci --prefix=./test-integration/_env",
|
|
33
33
|
"test:deploySchema": "node test-integration/_env/srv/hana/deploy.js",
|
|
@@ -47,30 +47,28 @@
|
|
|
47
47
|
"node": ">=18"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@cap-js-community/common": "0.3.
|
|
51
|
-
"@sap/xssec": "^4.
|
|
52
|
-
"cron-parser": "^5.
|
|
50
|
+
"@cap-js-community/common": "^0.3.4",
|
|
51
|
+
"@sap/xssec": "^4.12.2",
|
|
52
|
+
"cron-parser": "^5.5.0",
|
|
53
53
|
"verror": "^1.10.1",
|
|
54
|
-
"yaml": "^2.
|
|
54
|
+
"yaml": "^2.8.2"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@actions/core": "^
|
|
58
|
-
"@cap-js/cds-test": "^0.4.
|
|
59
|
-
"@cap-js/db-service": "^2.
|
|
60
|
-
"@cap-js/hana": "^2.
|
|
61
|
-
"@cap-js/sqlite": "^2.1.
|
|
57
|
+
"@actions/core": "^2.0.2",
|
|
58
|
+
"@cap-js/cds-test": "^0.4.1",
|
|
59
|
+
"@cap-js/db-service": "^2.8.1",
|
|
60
|
+
"@cap-js/hana": "^2.5.1",
|
|
61
|
+
"@cap-js/sqlite": "^2.1.2",
|
|
62
62
|
"@opentelemetry/api": "^1.9.0",
|
|
63
|
-
"@sap/cds": "^9.4
|
|
64
|
-
"@sap/cds-dk": "^9.
|
|
65
|
-
"eslint": "^8.57.
|
|
66
|
-
"eslint-config-prettier": "^
|
|
67
|
-
"eslint-plugin-jest": "^
|
|
63
|
+
"@sap/cds": "^9.6.4",
|
|
64
|
+
"@sap/cds-dk": "^9.6.1",
|
|
65
|
+
"eslint": "^8.57.1",
|
|
66
|
+
"eslint-config-prettier": "^10.1.8",
|
|
67
|
+
"eslint-plugin-jest": "^29.12.1",
|
|
68
68
|
"eslint-plugin-node": "^11.1.0",
|
|
69
|
-
"express": "^4.
|
|
70
|
-
"hdb": "^2.26.1",
|
|
69
|
+
"express": "^4.22.1",
|
|
71
70
|
"jest": "^29.7.0",
|
|
72
|
-
"prettier": "^2.8.8"
|
|
73
|
-
"sqlite3": "^5.1.7"
|
|
71
|
+
"prettier": "^2.8.8"
|
|
74
72
|
},
|
|
75
73
|
"homepage": "https://cap-js-community.github.io/event-queue/",
|
|
76
74
|
"repository": {
|
|
@@ -79,6 +77,9 @@
|
|
|
79
77
|
},
|
|
80
78
|
"cds": {
|
|
81
79
|
"eventQueue": {
|
|
80
|
+
"[development]": {
|
|
81
|
+
"cleanupLocksAndEventsForDev": true
|
|
82
|
+
},
|
|
82
83
|
"[production]": {
|
|
83
84
|
"disableRedis": false
|
|
84
85
|
},
|
|
@@ -703,7 +703,7 @@ class EventQueueProcessorBase {
|
|
|
703
703
|
)
|
|
704
704
|
.orderBy("createdAt", "ID");
|
|
705
705
|
|
|
706
|
-
if (this.#eventConfig.selectedDelayedEventIds) {
|
|
706
|
+
if (this.#eventConfig.selectedDelayedEventIds.length) {
|
|
707
707
|
cqn.where("ID NOT IN", this.#eventConfig.selectedDelayedEventIds);
|
|
708
708
|
}
|
|
709
709
|
|
|
@@ -37,6 +37,10 @@ class EventQueueDeleteEvents extends EventQueueBaseClass {
|
|
|
37
37
|
{ ref: ["lastAttemptTimestamp"] },
|
|
38
38
|
"<=",
|
|
39
39
|
{ val: new Date(processContext.timestamp.getTime() - deleteAfter * DAY_IN_MS).toISOString() },
|
|
40
|
+
"AND",
|
|
41
|
+
{ ref: ["namespace"] },
|
|
42
|
+
"IN",
|
|
43
|
+
{ list: config.processingNamespaces.map((value) => ({ val: value })) },
|
|
40
44
|
])
|
|
41
45
|
);
|
|
42
46
|
this.logger.info("deleted eligible events", {
|
|
@@ -13,7 +13,7 @@ const COMPONENT_NAME = "/eventQueue/admin";
|
|
|
13
13
|
module.exports = class AdminService extends cds.ApplicationService {
|
|
14
14
|
async init() {
|
|
15
15
|
const { Event: EventService, Lock: LockService } = this.entities;
|
|
16
|
-
const { Event: EventDb } = cds.
|
|
16
|
+
const { Event: EventDb } = cds.entities("sap.eventqueue");
|
|
17
17
|
const { publishEvent } = this.actions;
|
|
18
18
|
|
|
19
19
|
this.before("*", (req) => {
|