@n8n/frontend-module-sdk 0.13.2 → 0.14.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/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@n8n/frontend-module-sdk",
4
- "version": "0.13.2",
4
+ "version": "0.14.0",
5
5
  "main": "src/index.ts",
6
6
  "import": "src/index.ts",
7
7
  "exports": {
8
8
  ".": "./src/index.ts"
9
9
  },
10
10
  "dependencies": {
11
- "@n8n/api-types": "1.43.1",
12
- "@n8n/design-system": "2.42.2",
13
- "@n8n/utils": "1.50.0",
14
- "n8n-workflow": "2.43.1",
11
+ "@n8n/api-types": "1.44.0",
12
+ "@n8n/design-system": "2.43.0",
13
+ "@n8n/utils": "1.51.0",
14
+ "n8n-workflow": "2.44.0",
15
15
  "vue": "^3.5.13",
16
16
  "vue-router": "^4.5.0"
17
17
  },
@@ -1,4 +1,6 @@
1
+ import type { FrontendSettings } from '@n8n/api-types';
1
2
  import type { IMenuItem } from '@n8n/design-system';
3
+ import type { Component } from 'vue';
2
4
  import type { RouteRecordRaw } from 'vue-router';
3
5
 
4
6
  import type { ModuleBanner } from './banner';
@@ -12,6 +14,26 @@ import type { ModuleSetupContext } from './setup';
12
14
  import type { ModuleShortcut } from './shortcut';
13
15
  import type { DynamicTabOptions } from './tabs';
14
16
 
17
+ /** A key of `settings.enterprise`, e.g. `'logStreaming'`. */
18
+ export type ModuleLicenseFlag = keyof Omit<FrontendSettings['enterprise'], 'projects'>;
19
+
20
+ /** A page, e.g. a paywall, shown instead of the module's routes when it isn't licensed. */
21
+ export type ModulePlaceholderPage = {
22
+ /** Show the page only when this feature is off. */
23
+ licenseFlag: ModuleLicenseFlag;
24
+ component: () => Promise<Component>;
25
+ };
26
+
27
+ /** A link in the settings sidebar. Shell and modules both use it. */
28
+ export type IMenuSettingItem = IMenuItem & {
29
+ /**
30
+ * @description Sort position, low to high. Shell links use 10, 20, 30, ... so pick a number
31
+ * between two of them to land between them. No `order` means last. Equal values
32
+ * keep registration order.
33
+ */
34
+ order?: number;
35
+ };
36
+
15
37
  /**
16
38
  * The declarative contract a frontend module exposes to the editor-ui shell.
17
39
  *
@@ -37,7 +59,12 @@ export type FrontendModuleDescription = {
37
59
  * here so they arrive on the same path as `modals`, not by import side effect.
38
60
  */
39
61
  adHocModalKeyPrefixes?: string[];
40
- settingsPages?: IMenuItem[];
62
+ settingsPages?: IMenuSettingItem[];
63
+ /**
64
+ * Shown when the module is inactive and not licensed. Its settings links stay visible.
65
+ * A licensed module that is inactive (e.g. disabled) stays hidden.
66
+ */
67
+ placeholderPage?: ModulePlaceholderPage;
41
68
 
42
69
  // --- descriptor v2 (all optional, additive) ---
43
70