@n8n/backend-module-insights 0.2.3 → 0.3.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/dist/build.tsbuildinfo +1 -1
- package/dist/insights-compaction.task.d.ts +2 -4
- package/dist/insights-compaction.task.js +6 -3
- package/dist/insights-compaction.task.js.map +1 -1
- package/dist/insights-pruning.task.d.ts +2 -5
- package/dist/insights-pruning.task.js +7 -4
- package/dist/insights-pruning.task.js.map +1 -1
- package/package.json +14 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SystemTask } from '@n8n/decorators';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SystemTaskSchedule } from '@n8n/decorators';
|
|
3
3
|
import { InsightsCompactionService } from './insights-compaction.service';
|
|
4
4
|
import { InsightsConfig } from './insights.config';
|
|
5
5
|
export declare class InsightsCompactionTask implements SystemTask {
|
|
@@ -7,9 +7,7 @@ export declare class InsightsCompactionTask implements SystemTask {
|
|
|
7
7
|
private readonly compactionService;
|
|
8
8
|
readonly name = "insights-compaction";
|
|
9
9
|
readonly schedule: SystemTaskSchedule;
|
|
10
|
-
readonly
|
|
11
|
-
readonly placement: SystemTaskPlacement;
|
|
12
|
-
readonly timeoutSeconds: number;
|
|
10
|
+
readonly target: import("@n8n/decorators").ClusterTarget;
|
|
13
11
|
constructor(insightsConfig: InsightsConfig, compactionService: InsightsCompactionService);
|
|
14
12
|
run(signal: AbortSignal): Promise<void>;
|
|
15
13
|
}
|
|
@@ -20,9 +20,12 @@ let InsightsCompactionTask = class InsightsCompactionTask {
|
|
|
20
20
|
this.compactionService = compactionService;
|
|
21
21
|
this.name = 'insights-compaction';
|
|
22
22
|
this.schedule = (0, decorators_1.intervalFromSeconds)(this.insightsConfig.compactionIntervalMinutes * constants_1.Time.minutes.toSeconds);
|
|
23
|
-
this.
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
this.target = (0, decorators_1.clusterTarget)({
|
|
24
|
+
scheduler: {
|
|
25
|
+
retryOnFailure: true,
|
|
26
|
+
timeoutSeconds: (0, decorators_1.timeoutAfterLimit)(this.insightsConfig.compactionMaxRuntimeSeconds, 5 * constants_1.Time.minutes.toSeconds),
|
|
27
|
+
},
|
|
28
|
+
});
|
|
26
29
|
}
|
|
27
30
|
async run(signal) {
|
|
28
31
|
await this.compactionService.compactInsights(signal);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insights-compaction.task.js","sourceRoot":"","sources":["../src/insights-compaction.task.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"insights-compaction.task.js","sourceRoot":"","sources":["../src/insights-compaction.task.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAsC;AACtC,gDAAoG;AAGpG,+EAA0E;AAC1E,uDAAmD;AAO5C,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAkBlC,YACkB,cAA8B,EAC9B,iBAA4C;QAD5C,mBAAc,GAAd,cAAc,CAAgB;QAC9B,sBAAiB,GAAjB,iBAAiB,CAA2B;QAnBrD,SAAI,GAAG,qBAAqB,CAAC;QAE7B,aAAQ,GAAuB,IAAA,gCAAmB,EAC1D,IAAI,CAAC,cAAc,CAAC,yBAAyB,GAAG,gBAAI,CAAC,OAAO,CAAC,SAAS,CACtE,CAAC;QAEO,WAAM,GAAG,IAAA,0BAAa,EAAC;YAC/B,SAAS,EAAE;gBACV,cAAc,EAAE,IAAI;gBAEpB,cAAc,EAAE,IAAA,8BAAiB,EAChC,IAAI,CAAC,cAAc,CAAC,2BAA2B,EAC/C,CAAC,GAAG,gBAAI,CAAC,OAAO,CAAC,SAAS,CAC1B;aACD;SACD,CAAC,CAAC;IAKA,CAAC;IAEJ,KAAK,CAAC,GAAG,CAAC,MAAmB;QAC5B,MAAM,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;CACD,CAAA;;iCA1BY,sBAAsB;IADlC,IAAA,uBAAU,GAAE;qCAoBsB,gCAAc,EACX,uDAAyB;GApBlD,sBAAsB,CA0BlC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DatabaseConfig } from '@n8n/config';
|
|
2
2
|
import { SystemTask } from '@n8n/decorators';
|
|
3
|
-
import type {
|
|
3
|
+
import type { SystemTaskSchedule } from '@n8n/decorators';
|
|
4
4
|
import { InsightsPruningService } from './insights-pruning.service';
|
|
5
5
|
import { InsightsConfig } from './insights.config';
|
|
6
6
|
export declare class InsightsPruningTask implements SystemTask {
|
|
@@ -9,10 +9,7 @@ export declare class InsightsPruningTask implements SystemTask {
|
|
|
9
9
|
private readonly pruningService;
|
|
10
10
|
readonly name = "insights-pruning";
|
|
11
11
|
readonly schedule: SystemTaskSchedule;
|
|
12
|
-
readonly
|
|
13
|
-
readonly placement: SystemTaskPlacement;
|
|
14
|
-
readonly retryDelaySeconds = 1;
|
|
15
|
-
readonly timeoutSeconds: number;
|
|
12
|
+
readonly target: import("@n8n/decorators").ClusterTarget;
|
|
16
13
|
constructor(insightsConfig: InsightsConfig, databaseConfig: DatabaseConfig, pruningService: InsightsPruningService);
|
|
17
14
|
run(): Promise<void>;
|
|
18
15
|
}
|
|
@@ -22,10 +22,13 @@ let InsightsPruningTask = class InsightsPruningTask {
|
|
|
22
22
|
this.pruningService = pruningService;
|
|
23
23
|
this.name = 'insights-pruning';
|
|
24
24
|
this.schedule = (0, decorators_1.intervalFromSeconds)(this.insightsConfig.pruneCheckIntervalHours * constants_1.Time.hours.toSeconds);
|
|
25
|
-
this.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
this.target = (0, decorators_1.clusterTarget)({
|
|
26
|
+
scheduler: {
|
|
27
|
+
retryOnFailure: true,
|
|
28
|
+
timeoutSeconds: (0, decorators_1.timeoutAfterLimit)((0, config_1.statementTimeoutSeconds)(this.databaseConfig), 5 * constants_1.Time.minutes.toSeconds),
|
|
29
|
+
},
|
|
30
|
+
leaderTimer: { retryDelaySeconds: 1 },
|
|
31
|
+
});
|
|
29
32
|
}
|
|
30
33
|
async run() {
|
|
31
34
|
await this.pruningService.pruneInsights();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insights-pruning.task.js","sourceRoot":"","sources":["../src/insights-pruning.task.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAsE;AACtE,8CAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"insights-pruning.task.js","sourceRoot":"","sources":["../src/insights-pruning.task.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAsE;AACtE,8CAAsC;AACtC,gDAAoG;AAGpG,yEAAoE;AACpE,uDAAmD;AAO5C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAqB/B,YACkB,cAA8B,EAC9B,cAA8B,EAC9B,cAAsC;QAFtC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,mBAAc,GAAd,cAAc,CAAwB;QAvB/C,SAAI,GAAG,kBAAkB,CAAC;QAE1B,aAAQ,GAAuB,IAAA,gCAAmB,EAC1D,IAAI,CAAC,cAAc,CAAC,uBAAuB,GAAG,gBAAI,CAAC,KAAK,CAAC,SAAS,CAClE,CAAC;QAEO,WAAM,GAAG,IAAA,0BAAa,EAAC;YAC/B,SAAS,EAAE;gBACV,cAAc,EAAE,IAAI;gBAIpB,cAAc,EAAE,IAAA,8BAAiB,EAChC,IAAA,gCAAuB,EAAC,IAAI,CAAC,cAAc,CAAC,EAC5C,CAAC,GAAG,gBAAI,CAAC,OAAO,CAAC,SAAS,CAC1B;aACD;YACD,WAAW,EAAE,EAAE,iBAAiB,EAAE,CAAC,EAAE;SACrC,CAAC,CAAC;IAMA,CAAC;IAEJ,KAAK,CAAC,GAAG;QACR,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;IAC3C,CAAC;CACD,CAAA;;8BA9BY,mBAAmB;IAD/B,IAAA,uBAAU,GAAE;qCAuBsB,gCAAc,EACd,uBAAc,EACd,iDAAsB;GAxB5C,mBAAmB,CA8B/B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/backend-module-insights",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -41,30 +41,30 @@
|
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"dist/**/*",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
44
|
+
"LICENSE.md",
|
|
45
|
+
"LICENSE_EE.md"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@n8n/api-types": "1.
|
|
49
|
-
"@n8n/backend-common": "1.
|
|
50
|
-
"@n8n/backend-services": "1.
|
|
51
|
-
"@n8n/config": "2.
|
|
52
|
-
"@n8n/constants": "0.
|
|
53
|
-
"@n8n/db": "1.
|
|
54
|
-
"@n8n/decorators": "1.
|
|
48
|
+
"@n8n/api-types": "1.45.0",
|
|
49
|
+
"@n8n/backend-common": "1.45.0",
|
|
50
|
+
"@n8n/backend-services": "1.5.0",
|
|
51
|
+
"@n8n/config": "2.43.0",
|
|
52
|
+
"@n8n/constants": "0.43.0",
|
|
53
|
+
"@n8n/db": "1.45.0",
|
|
54
|
+
"@n8n/decorators": "1.45.0",
|
|
55
55
|
"@n8n/di": "0.17.0",
|
|
56
56
|
"@n8n/errors": "0.15.0",
|
|
57
57
|
"@n8n/typeorm": "0.12.0",
|
|
58
|
-
"@n8n/utils": "1.
|
|
58
|
+
"@n8n/utils": "1.52.0",
|
|
59
59
|
"luxon": "3.7.2",
|
|
60
|
-
"n8n-core": "2.
|
|
61
|
-
"n8n-workflow": "2.
|
|
60
|
+
"n8n-core": "2.45.0",
|
|
61
|
+
"n8n-workflow": "2.45.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"zod": "3.25.76"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@n8n/backend-test-utils": "1.
|
|
67
|
+
"@n8n/backend-test-utils": "1.45.0",
|
|
68
68
|
"@n8n/oxlint-config": "0.0.1",
|
|
69
69
|
"@n8n/typescript-config": "1.12.0",
|
|
70
70
|
"@n8n/vitest-config": "1.24.0",
|