@n8n/decorators 1.4.2 → 1.5.1
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/controller/index.d.ts +1 -1
- package/dist/controller/route.d.ts +2 -1
- package/dist/controller/route.js +1 -0
- package/dist/controller/route.js.map +1 -1
- package/dist/controller/types.d.ts +8 -0
- package/dist/module/module.d.ts +1 -0
- package/dist/module/module.js.map +1 -1
- package/dist/pubsub/pubsub-metadata.d.ts +1 -1
- package/dist/pubsub/pubsub-metadata.js.map +1 -1
- package/package.json +5 -5
|
@@ -6,4 +6,4 @@ export { Middleware } from './middleware';
|
|
|
6
6
|
export { ControllerRegistryMetadata } from './controller-registry-metadata';
|
|
7
7
|
export { Licensed } from './licensed';
|
|
8
8
|
export { GlobalScope, ProjectScope } from './scoped';
|
|
9
|
-
export type { AccessScope, Controller, RateLimit, StaticRouterMetadata } from './types';
|
|
9
|
+
export type { AccessScope, Controller, CorsOptions, Method, RateLimit, StaticRouterMetadata, } from './types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RequestHandler } from 'express';
|
|
2
|
-
import type { RateLimit } from './types';
|
|
2
|
+
import type { CorsOptions, RateLimit } from './types';
|
|
3
3
|
interface RouteOptions {
|
|
4
4
|
middlewares?: RequestHandler[];
|
|
5
5
|
usesTemplates?: boolean;
|
|
@@ -8,6 +8,7 @@ interface RouteOptions {
|
|
|
8
8
|
allowSkipMFA?: boolean;
|
|
9
9
|
rateLimit?: boolean | RateLimit;
|
|
10
10
|
apiKeyAuth?: boolean;
|
|
11
|
+
cors?: Partial<CorsOptions> | true;
|
|
11
12
|
}
|
|
12
13
|
export declare const Get: (path: `/${string}`, options?: RouteOptions) => MethodDecorator;
|
|
13
14
|
export declare const Post: (path: `/${string}`, options?: RouteOptions) => MethodDecorator;
|
package/dist/controller/route.js
CHANGED
|
@@ -14,6 +14,7 @@ const RouteFactory = (method) => (path, options = {}) => (target, handlerName) =
|
|
|
14
14
|
routeMetadata.allowSkipMFA = options.allowSkipMFA ?? false;
|
|
15
15
|
routeMetadata.apiKeyAuth = options.apiKeyAuth ?? false;
|
|
16
16
|
routeMetadata.rateLimit = options.rateLimit;
|
|
17
|
+
routeMetadata.cors = options.cors;
|
|
17
18
|
};
|
|
18
19
|
exports.Get = RouteFactory('get');
|
|
19
20
|
exports.Post = RouteFactory('post');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/controller/route.ts"],"names":[],"mappings":";;;AAAA,gCAAoC;AAGpC,iFAA4E;
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/controller/route.ts"],"names":[],"mappings":";;;AAAA,gCAAoC;AAGpC,iFAA4E;AAmB5E,MAAM,YAAY,GACjB,CAAC,MAAc,EAAE,EAAE,CACnB,CAAC,IAAkB,EAAE,UAAwB,EAAE,EAAmB,EAAE,CACpE,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE;IACvB,MAAM,aAAa,GAAG,cAAS,CAAC,GAAG,CAAC,yDAA0B,CAAC,CAAC,gBAAgB,CAC/E,MAAM,CAAC,WAAyB,EAChC,MAAM,CAAC,WAAW,CAAC,CACnB,CAAC;IACF,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC;IAC9B,aAAa,CAAC,IAAI,GAAG,IAAI,CAAC;IAC1B,aAAa,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC;IACtD,aAAa,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,KAAK,CAAC;IAC7D,aAAa,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAC;IACnD,aAAa,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,IAAI,KAAK,CAAC;IAC3E,aAAa,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,KAAK,CAAC;IAC3D,aAAa,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC;IACvD,aAAa,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAC5C,aAAa,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AACnC,CAAC,CAAC;AAEU,QAAA,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;AAC1B,QAAA,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAC5B,QAAA,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;AAC1B,QAAA,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;AAC9B,QAAA,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;AAChC,QAAA,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAC5B,QAAA,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -9,6 +9,13 @@ export type Arg = {
|
|
|
9
9
|
type: 'param';
|
|
10
10
|
key: string;
|
|
11
11
|
};
|
|
12
|
+
export interface CorsOptions {
|
|
13
|
+
allowedOrigins: string[];
|
|
14
|
+
allowedMethods: Method[];
|
|
15
|
+
allowedHeaders: string[];
|
|
16
|
+
allowCredentials?: boolean;
|
|
17
|
+
maxAge?: number;
|
|
18
|
+
}
|
|
12
19
|
export interface RateLimit {
|
|
13
20
|
limit?: number;
|
|
14
21
|
windowMs?: number;
|
|
@@ -27,6 +34,7 @@ export interface RouteMetadata {
|
|
|
27
34
|
allowSkipPreviewAuth: boolean;
|
|
28
35
|
allowSkipMFA: boolean;
|
|
29
36
|
apiKeyAuth: boolean;
|
|
37
|
+
cors?: Partial<CorsOptions> | true;
|
|
30
38
|
rateLimit?: boolean | RateLimit;
|
|
31
39
|
licenseFeature?: BooleanLicenseFeature;
|
|
32
40
|
accessScope?: AccessScope;
|
package/dist/module/module.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export type ModuleContext = Record<string, unknown>;
|
|
|
23
23
|
export interface ModuleInterface {
|
|
24
24
|
init?(): Promise<void>;
|
|
25
25
|
shutdown?(): Promise<void>;
|
|
26
|
+
commands?(): Promise<void>;
|
|
26
27
|
entities?(): Promise<EntityClass[]>;
|
|
27
28
|
settings?(): Promise<ModuleSettings>;
|
|
28
29
|
context?(): Promise<ModuleContext>;
|
|
@@ -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;AAuG5C,MAAM,aAAa,GACzB,CAAC,IAA0B,EAAkB,EAAE,CAC/C,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;QAC9B,aAAa,EAAE,IAAI,EAAE,aAAa;KAClC,CAAC,CAAC;IAGH,OAAO,IAAA,YAAO,GAAE,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC,CAAC;AAXU,QAAA,aAAa,iBAWvB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InstanceRole, InstanceType } from '@n8n/constants';
|
|
2
2
|
import type { EventHandler } from '../types';
|
|
3
|
-
export type PubSubEventName = 'add-webhooks-triggers-and-pollers' | 'remove-triggers-and-pollers' | 'clear-test-webhooks' | 'display-workflow-activation' | 'display-workflow-deactivation' | 'display-workflow-activation-error' | 'community-package-install' | 'community-package-uninstall' | 'community-package-update' | 'get-worker-status' | 'reload-external-secrets-providers' | 'reload-license' | 'reload-oidc-config' | 'reload-saml-config' | 'reload-overwrite-credentials' | 'response-to-get-worker-status' | 'restart-event-bus' | 'relay-execution-lifecycle-event' | 'reload-sso-provisioning-configuration';
|
|
3
|
+
export type PubSubEventName = 'add-webhooks-triggers-and-pollers' | 'remove-triggers-and-pollers' | 'clear-test-webhooks' | 'display-workflow-activation' | 'display-workflow-deactivation' | 'display-workflow-activation-error' | 'community-package-install' | 'community-package-uninstall' | 'community-package-update' | 'get-worker-status' | 'reload-external-secrets-providers' | 'reload-license' | 'reload-oidc-config' | 'reload-saml-config' | 'reload-overwrite-credentials' | 'response-to-get-worker-status' | 'restart-event-bus' | 'relay-execution-lifecycle-event' | 'reload-sso-provisioning-configuration' | 'reload-source-control-config';
|
|
4
4
|
export type PubSubEventFilter = {
|
|
5
5
|
instanceType: 'main';
|
|
6
6
|
instanceRole?: Omit<InstanceRole, 'unset'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pubsub-metadata.js","sourceRoot":"","sources":["../../src/pubsub/pubsub-metadata.ts"],"names":[],"mappings":";;;;;;;;;AACA,gCAAkC;
|
|
1
|
+
{"version":3,"file":"pubsub-metadata.js","sourceRoot":"","sources":["../../src/pubsub/pubsub-metadata.ts"],"names":[],"mappings":";;;;;;;;;AACA,gCAAkC;AAuC3B,IAAM,cAAc,GAApB,MAAM,cAAc;IAApB;QACW,aAAQ,GAAyB,EAAE,CAAC;IAStD,CAAC;IAPA,QAAQ,CAAC,OAA2B;QACnC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED,WAAW;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;CACD,CAAA;AAVY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,YAAO,GAAE;GACG,cAAc,CAU1B"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/decorators",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
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",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"lodash": "4.17.21",
|
|
19
19
|
"@n8n/constants": "0.16.0",
|
|
20
20
|
"@n8n/permissions": "0.47.0",
|
|
21
|
-
"
|
|
22
|
-
"n8n
|
|
21
|
+
"n8n-workflow": "2.5.1",
|
|
22
|
+
"@n8n/di": "0.10.0"
|
|
23
23
|
},
|
|
24
24
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
25
25
|
"homepage": "https://n8n.io",
|