@n8n/decorators 1.18.3 → 1.20.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/cluster-check/cluster-check-metadata.d.ts +11 -0
- package/dist/cluster-check/cluster-check-metadata.js +33 -0
- package/dist/cluster-check/cluster-check-metadata.js.map +1 -0
- package/dist/cluster-check/cluster-check.d.ts +43 -0
- package/dist/cluster-check/cluster-check.js +3 -0
- package/dist/cluster-check/cluster-check.js.map +1 -0
- package/dist/cluster-check/index.d.ts +2 -0
- package/dist/cluster-check/index.js +7 -0
- package/dist/cluster-check/index.js.map +1 -0
- package/dist/context-establishment/context-establishment-hook-metadata.d.ts +0 -1
- package/dist/context-establishment/context-establishment-hook-metadata.js +0 -3
- package/dist/context-establishment/context-establishment-hook-metadata.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +9 -8
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ClusterCheckClass } from './cluster-check';
|
|
2
|
+
type ClusterCheckEntry = {
|
|
3
|
+
class: ClusterCheckClass;
|
|
4
|
+
};
|
|
5
|
+
export declare class ClusterCheckMetadata {
|
|
6
|
+
private readonly clusterChecks;
|
|
7
|
+
register(entry: ClusterCheckEntry): void;
|
|
8
|
+
getClasses(): ClusterCheckClass[];
|
|
9
|
+
}
|
|
10
|
+
export declare const ClusterCheck: <T extends ClusterCheckClass>() => (target: T) => any;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ClusterCheck = exports.ClusterCheckMetadata = void 0;
|
|
10
|
+
const di_1 = require("@n8n/di");
|
|
11
|
+
let ClusterCheckMetadata = class ClusterCheckMetadata {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.clusterChecks = new Set();
|
|
14
|
+
}
|
|
15
|
+
register(entry) {
|
|
16
|
+
this.clusterChecks.add(entry);
|
|
17
|
+
}
|
|
18
|
+
getClasses() {
|
|
19
|
+
return [...this.clusterChecks.values()].map((entry) => entry.class);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.ClusterCheckMetadata = ClusterCheckMetadata;
|
|
23
|
+
exports.ClusterCheckMetadata = ClusterCheckMetadata = __decorate([
|
|
24
|
+
(0, di_1.Service)()
|
|
25
|
+
], ClusterCheckMetadata);
|
|
26
|
+
const ClusterCheck = () => (target) => {
|
|
27
|
+
di_1.Container.get(ClusterCheckMetadata).register({
|
|
28
|
+
class: target,
|
|
29
|
+
});
|
|
30
|
+
return (0, di_1.Service)()(target);
|
|
31
|
+
};
|
|
32
|
+
exports.ClusterCheck = ClusterCheck;
|
|
33
|
+
//# sourceMappingURL=cluster-check-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cluster-check-metadata.js","sourceRoot":"","sources":["../../src/cluster-check/cluster-check-metadata.ts"],"names":[],"mappings":";;;;;;;;;AAAA,gCAA6C;AA8CtC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAA1B;QAOW,kBAAa,GAA2B,IAAI,GAAG,EAAE,CAAC;IAuCpE,CAAC;IAzBA,QAAQ,CAAC,KAAwB;QAChC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAoBD,UAAU;QACT,OAAO,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrE,CAAC;CACD,CAAA;AA9CY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,YAAO,GAAE;GACG,oBAAoB,CA8ChC;AAyCM,MAAM,YAAY,GACxB,GAAgC,EAAE,CAClC,CAAC,MAAS,EAAE,EAAE;IACb,cAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,QAAQ,CAAC;QAC5C,KAAK,EAAE,MAAM;KACb,CAAC,CAAC;IAGH,OAAO,IAAA,YAAO,GAAE,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC,CAAC;AATU,QAAA,YAAY,gBAStB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { InstanceRegistration } from '@n8n/api-types';
|
|
2
|
+
import type { Constructable } from '@n8n/di';
|
|
3
|
+
export type ClusterStateDiff = {
|
|
4
|
+
added: readonly InstanceRegistration[];
|
|
5
|
+
removed: readonly InstanceRegistration[];
|
|
6
|
+
changed: ReadonlyArray<{
|
|
7
|
+
previous: InstanceRegistration;
|
|
8
|
+
current: InstanceRegistration;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
export type ClusterCheckContext = {
|
|
12
|
+
currentState: ReadonlyMap<string, InstanceRegistration>;
|
|
13
|
+
previousState: ReadonlyMap<string, InstanceRegistration>;
|
|
14
|
+
diff: ClusterStateDiff;
|
|
15
|
+
};
|
|
16
|
+
export type ClusterCheckWarning = {
|
|
17
|
+
code: string;
|
|
18
|
+
message: string;
|
|
19
|
+
severity?: 'info' | 'warning' | 'error';
|
|
20
|
+
context?: Record<string, unknown>;
|
|
21
|
+
};
|
|
22
|
+
export type ClusterCheckAuditEvent = {
|
|
23
|
+
eventName: string;
|
|
24
|
+
payload: Record<string, unknown>;
|
|
25
|
+
};
|
|
26
|
+
export type ClusterCheckPushNotification = {
|
|
27
|
+
type: string;
|
|
28
|
+
data: Record<string, unknown>;
|
|
29
|
+
};
|
|
30
|
+
export type ClusterCheckResult = {
|
|
31
|
+
warnings?: ClusterCheckWarning[];
|
|
32
|
+
auditEvents?: ClusterCheckAuditEvent[];
|
|
33
|
+
pushNotifications?: ClusterCheckPushNotification[];
|
|
34
|
+
};
|
|
35
|
+
export type CheckDescription = {
|
|
36
|
+
name: string;
|
|
37
|
+
displayName?: string;
|
|
38
|
+
};
|
|
39
|
+
export interface IClusterCheck {
|
|
40
|
+
checkDescription: CheckDescription;
|
|
41
|
+
run(context: ClusterCheckContext): Promise<ClusterCheckResult>;
|
|
42
|
+
}
|
|
43
|
+
export type ClusterCheckClass = Constructable<IClusterCheck>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cluster-check.js","sourceRoot":"","sources":["../../src/cluster-check/cluster-check.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClusterCheck = exports.ClusterCheckMetadata = void 0;
|
|
4
|
+
var cluster_check_metadata_1 = require("./cluster-check-metadata");
|
|
5
|
+
Object.defineProperty(exports, "ClusterCheckMetadata", { enumerable: true, get: function () { return cluster_check_metadata_1.ClusterCheckMetadata; } });
|
|
6
|
+
Object.defineProperty(exports, "ClusterCheck", { enumerable: true, get: function () { return cluster_check_metadata_1.ClusterCheck; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cluster-check/index.ts"],"names":[],"mappings":";;;AAAA,mEAA8E;AAArE,8HAAA,oBAAoB,OAAA;AAAE,sHAAA,YAAY,OAAA"}
|
|
@@ -5,7 +5,6 @@ type ContextEstablishmentHookEntry = {
|
|
|
5
5
|
export declare class ContextEstablishmentHookMetadata {
|
|
6
6
|
private readonly contextEstablishmentHooks;
|
|
7
7
|
register(hookEntry: ContextEstablishmentHookEntry): void;
|
|
8
|
-
getEntries(): [ContextEstablishmentHookEntry, ContextEstablishmentHookEntry][];
|
|
9
8
|
getClasses(): ContextEstablishmentHookClass[];
|
|
10
9
|
}
|
|
11
10
|
export declare const ContextEstablishmentHook: <T extends ContextEstablishmentHookClass>() => (target: T) => any;
|
|
@@ -15,9 +15,6 @@ let ContextEstablishmentHookMetadata = class ContextEstablishmentHookMetadata {
|
|
|
15
15
|
register(hookEntry) {
|
|
16
16
|
this.contextEstablishmentHooks.add(hookEntry);
|
|
17
17
|
}
|
|
18
|
-
getEntries() {
|
|
19
|
-
return [...this.contextEstablishmentHooks.entries()];
|
|
20
|
-
}
|
|
21
18
|
getClasses() {
|
|
22
19
|
return [...this.contextEstablishmentHooks.values()].map((entry) => entry.class);
|
|
23
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-establishment-hook-metadata.js","sourceRoot":"","sources":["../../src/context-establishment/context-establishment-hook-metadata.ts"],"names":[],"mappings":";;;;;;;;;AAAA,gCAA6C;AAmCtC,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAAtC;QAOW,8BAAyB,GAAuC,IAAI,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"context-establishment-hook-metadata.js","sourceRoot":"","sources":["../../src/context-establishment/context-establishment-hook-metadata.ts"],"names":[],"mappings":";;;;;;;;;AAAA,gCAA6C;AAmCtC,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAAtC;QAOW,8BAAyB,GAAuC,IAAI,GAAG,EAAE,CAAC;IAoD5F,CAAC;IArCA,QAAQ,CAAC,SAAwC;QAChD,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;IAgCD,UAAU;QACT,OAAO,CAAC,GAAG,IAAI,CAAC,yBAAyB,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjF,CAAC;CACD,CAAA;AA3DY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,YAAO,GAAE;GACG,gCAAgC,CA2D5C;AAwEM,MAAM,wBAAwB,GACpC,GAA4C,EAAE,CAC9C,CAAC,MAAS,EAAE,EAAE;IAEb,cAAS,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC,QAAQ,CAAC;QACxD,KAAK,EAAE,MAAM;KACb,CAAC,CAAC;IAIH,OAAO,IAAA,YAAO,GAAE,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC,CAAC;AAXU,QAAA,wBAAwB,4BAWlC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { Debounce } from './debounce';
|
|
|
5
5
|
export * from './execution-lifecycle';
|
|
6
6
|
export { Memoized } from './memoized';
|
|
7
7
|
export * from './auth-handler';
|
|
8
|
+
export * from './cluster-check';
|
|
8
9
|
export * from './context-establishment';
|
|
9
10
|
export * from './credential-resolver';
|
|
10
11
|
export * from './module';
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __exportStar(require("./execution-lifecycle"), exports);
|
|
|
24
24
|
var memoized_1 = require("./memoized");
|
|
25
25
|
Object.defineProperty(exports, "Memoized", { enumerable: true, get: function () { return memoized_1.Memoized; } });
|
|
26
26
|
__exportStar(require("./auth-handler"), exports);
|
|
27
|
+
__exportStar(require("./cluster-check"), exports);
|
|
27
28
|
__exportStar(require("./context-establishment"), exports);
|
|
28
29
|
__exportStar(require("./credential-resolver"), exports);
|
|
29
30
|
__exportStar(require("./module"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,+CAA6B;AAC7B,4CAA0B;AAC1B,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,wDAAsC;AACtC,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,iDAA+B;AAC/B,0DAAwC;AACxC,wDAAsC;AACtC,2CAAyB;AACzB,+CAA6B;AAC7B,2CAAyB;AACzB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,6CAA2B;AAC3B,2DAAyC;AAEzC,iCAAgC;AAAvB,8FAAA,KAAK,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,+CAA6B;AAC7B,4CAA0B;AAC1B,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,wDAAsC;AACtC,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,iDAA+B;AAC/B,kDAAgC;AAChC,0DAAwC;AACxC,wDAAsC;AACtC,2CAAyB;AACzB,+CAA6B;AAC7B,2CAAyB;AACzB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,6CAA2B;AAC3B,2DAAyC;AAEzC,iCAAgC;AAAvB,8FAAA,KAAK,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/decorators",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "src/index.ts",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist/**/*",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"LICENSE.md",
|
|
10
|
+
"LICENSE_EE.md"
|
|
11
11
|
],
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@types/express": "^5.0.1",
|
|
@@ -15,14 +15,15 @@
|
|
|
15
15
|
"vitest": "^4.1.1",
|
|
16
16
|
"zod": "3.25.67",
|
|
17
17
|
"@n8n/typescript-config": "1.4.0",
|
|
18
|
-
"@n8n/vitest-config": "1.
|
|
18
|
+
"@n8n/vitest-config": "1.10.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"lodash": "4.18.1",
|
|
22
|
-
"@n8n/
|
|
23
|
-
"@n8n/constants": "0.
|
|
24
|
-
"
|
|
25
|
-
"n8n
|
|
22
|
+
"@n8n/api-types": "1.20.0",
|
|
23
|
+
"@n8n/constants": "0.23.0",
|
|
24
|
+
"n8n-workflow": "2.20.0",
|
|
25
|
+
"@n8n/di": "0.11.0",
|
|
26
|
+
"@n8n/permissions": "0.58.0"
|
|
26
27
|
},
|
|
27
28
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
28
29
|
"homepage": "https://n8n.io",
|