@n8n/decorators 0.9.0 → 0.10.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/module/index.d.ts +1 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/module-metadata.d.ts +2 -1
- package/dist/module/module-metadata.js +4 -1
- package/dist/module/module-metadata.js.map +1 -1
- package/dist/module/module.d.ts +6 -3
- package/dist/module/module.js +1 -1
- package/dist/module/module.js.map +1 -1
- package/package.json +4 -4
package/dist/module/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ModuleInterface, BackendModule, EntityClass } from './module';
|
|
1
|
+
export { ModuleInterface, BackendModule, EntityClass, ModuleSettings } from './module';
|
|
2
2
|
export { ModuleMetadata } from './module-metadata';
|
package/dist/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/module/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/module/index.ts"],"names":[],"mappings":";;;AAAA,mCAAuF;AAA7D,uGAAA,aAAa,OAAA;AACvC,qDAAmD;AAA1C,iHAAA,cAAc,OAAA"}
|
|
@@ -6,6 +6,7 @@ type ModuleEntry = {
|
|
|
6
6
|
export declare class ModuleMetadata {
|
|
7
7
|
private readonly modules;
|
|
8
8
|
register(moduleName: string, moduleEntry: ModuleEntry): void;
|
|
9
|
-
getEntries(): ModuleEntry[];
|
|
9
|
+
getEntries(): [string, ModuleEntry][];
|
|
10
|
+
getClasses(): ModuleClass[];
|
|
10
11
|
}
|
|
11
12
|
export {};
|
|
@@ -16,7 +16,10 @@ let ModuleMetadata = class ModuleMetadata {
|
|
|
16
16
|
this.modules.set(moduleName, moduleEntry);
|
|
17
17
|
}
|
|
18
18
|
getEntries() {
|
|
19
|
-
return [...this.modules.
|
|
19
|
+
return [...this.modules.entries()];
|
|
20
|
+
}
|
|
21
|
+
getClasses() {
|
|
22
|
+
return [...this.modules.values()].map((entry) => entry.class);
|
|
20
23
|
}
|
|
21
24
|
};
|
|
22
25
|
exports.ModuleMetadata = ModuleMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-metadata.js","sourceRoot":"","sources":["../../src/module/module-metadata.ts"],"names":[],"mappings":";;;;;;;;;AAAA,gCAAkC;AAU3B,IAAM,cAAc,GAApB,MAAM,cAAc;IAApB;QACW,YAAO,GAA6B,IAAI,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"module-metadata.js","sourceRoot":"","sources":["../../src/module/module-metadata.ts"],"names":[],"mappings":";;;;;;;;;AAAA,gCAAkC;AAU3B,IAAM,cAAc,GAApB,MAAM,cAAc;IAApB;QACW,YAAO,GAA6B,IAAI,GAAG,EAAE,CAAC;IAahE,CAAC;IAXA,QAAQ,CAAC,UAAkB,EAAE,WAAwB;QACpD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;IAED,UAAU;QACT,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,UAAU;QACT,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC;CACD,CAAA;AAdY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,YAAO,GAAE;GACG,cAAc,CAc1B"}
|
package/dist/module/module.d.ts
CHANGED
|
@@ -9,12 +9,15 @@ export interface BaseEntity {
|
|
|
9
9
|
reload(): Promise<void>;
|
|
10
10
|
}
|
|
11
11
|
export type EntityClass = new () => BaseEntity;
|
|
12
|
+
export type ModuleSettings = Record<string, unknown>;
|
|
12
13
|
export interface ModuleInterface {
|
|
13
|
-
init?():
|
|
14
|
+
init?(): Promise<void>;
|
|
14
15
|
entities?(): EntityClass[];
|
|
16
|
+
settings?(): Promise<ModuleSettings>;
|
|
15
17
|
}
|
|
16
18
|
export type ModuleClass = Constructable<ModuleInterface>;
|
|
17
19
|
export type LicenseFlag = (typeof LICENSE_FEATURES)[keyof typeof LICENSE_FEATURES];
|
|
18
|
-
export declare const BackendModule: (opts
|
|
19
|
-
|
|
20
|
+
export declare const BackendModule: (opts: {
|
|
21
|
+
name: string;
|
|
22
|
+
licenseFlag?: LicenseFlag;
|
|
20
23
|
}) => ClassDecorator;
|
package/dist/module/module.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.BackendModule = void 0;
|
|
|
4
4
|
const di_1 = require("@n8n/di");
|
|
5
5
|
const module_metadata_1 = require("./module-metadata");
|
|
6
6
|
const BackendModule = (opts) => (target) => {
|
|
7
|
-
di_1.Container.get(module_metadata_1.ModuleMetadata).register(
|
|
7
|
+
di_1.Container.get(module_metadata_1.ModuleMetadata).register(opts.name, {
|
|
8
8
|
class: target,
|
|
9
9
|
licenseFlag: opts?.licenseFlag,
|
|
10
10
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/module/module.ts"],"names":[],"mappings":";;;AACA,gCAAiE;AAEjE,uDAAmD;
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/module/module.ts"],"names":[],"mappings":";;;AACA,gCAAiE;AAEjE,uDAAmD;AA6B5C,MAAM,aAAa,GACzB,CAAC,IAAiD,EAAkB,EAAE,CACtE,CAAC,MAAM,EAAE,EAAE;IACV,cAAS,CAAC,GAAG,CAAC,gCAAc,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE;QACjD,KAAK,EAAE,MAAgC;QACvC,WAAW,EAAE,IAAI,EAAE,WAAW;KAC9B,CAAC,CAAC;IAGH,OAAO,IAAA,YAAO,GAAE,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC,CAAC;AAVU,QAAA,aAAa,iBAUvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/decorators",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "src/index.ts",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"lodash": "4.17.21",
|
|
19
19
|
"@n8n/di": "^0.6.0",
|
|
20
|
-
"n8n
|
|
21
|
-
"
|
|
22
|
-
"@n8n/
|
|
20
|
+
"@n8n/permissions": "^0.28.0",
|
|
21
|
+
"n8n-workflow": "^1.97.0",
|
|
22
|
+
"@n8n/constants": "^0.7.0"
|
|
23
23
|
},
|
|
24
24
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
25
25
|
"homepage": "https://n8n.io",
|