@hosterai/types 0.0.3 → 0.0.5
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.
|
@@ -7,7 +7,7 @@ import { LanguageEnum } from '../../enums/language.enum';
|
|
|
7
7
|
import { RolesEnum } from '../../enums/roles.enum';
|
|
8
8
|
import { ActionDto } from '../action.dto';
|
|
9
9
|
import { TabDto } from '../tab.dto';
|
|
10
|
-
import {
|
|
10
|
+
import { MenuDtoWithSubmenu, MenuDtoWithUrl } from '../menu.dto';
|
|
11
11
|
/**
|
|
12
12
|
* DTO for integration information
|
|
13
13
|
* Contains all information related to a service integration
|
|
@@ -81,9 +81,8 @@ export declare class InfoDto {
|
|
|
81
81
|
order?: ActionDto[];
|
|
82
82
|
};
|
|
83
83
|
/** Main menu for the admin panel. Extends TabDto and adds icon information */
|
|
84
|
-
menu?:
|
|
85
|
-
|
|
86
|
-
settings: {
|
|
84
|
+
menu?: MenuDtoWithSubmenu | MenuDtoWithUrl;
|
|
85
|
+
settings?: {
|
|
87
86
|
label: string;
|
|
88
87
|
icon: string;
|
|
89
88
|
descrition: string;
|
|
@@ -117,7 +116,7 @@ export declare class InfoDto {
|
|
|
117
116
|
* If there are submenus, the label of the MenuDto and the TabDtos of the MenuDto will be displayed in the panel.
|
|
118
117
|
* The TabDtos of the MenuDto will be the submenus of the MenuDto.
|
|
119
118
|
*/
|
|
120
|
-
menu?:
|
|
119
|
+
menu?: MenuDtoWithSubmenu | MenuDtoWithUrl;
|
|
121
120
|
};
|
|
122
121
|
/**
|
|
123
122
|
* The url for the onboarding process after installation of the integration
|
package/dist/dtos/menu.dto.d.ts
CHANGED
|
@@ -16,29 +16,21 @@ interface BaseMenuDto {
|
|
|
16
16
|
* Menu item with URL (no submenu)
|
|
17
17
|
*/
|
|
18
18
|
export interface MenuDtoWithUrl extends BaseMenuDto {
|
|
19
|
-
type: 'url';
|
|
20
19
|
/**
|
|
21
20
|
* The URL associated with the tab.
|
|
22
21
|
* The requests coming from the hoster will be signed
|
|
23
22
|
* with jwt, which will contain information about the company
|
|
24
23
|
*/
|
|
25
24
|
url: string;
|
|
26
|
-
submenu?: never;
|
|
27
25
|
}
|
|
28
26
|
/**
|
|
29
27
|
* Menu item with submenu (no URL)
|
|
30
28
|
*/
|
|
31
29
|
export interface MenuDtoWithSubmenu extends BaseMenuDto {
|
|
32
|
-
type: 'submenu';
|
|
33
|
-
url?: never;
|
|
34
30
|
/**
|
|
35
31
|
* The list of tabs that will appear in the submenu and as a navigation bar above the main content
|
|
36
32
|
* In case of only one tab, there will be neither a submenu nor a navigation bar.
|
|
37
33
|
*/
|
|
38
34
|
submenu: SubmenuDto[];
|
|
39
35
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Union type that ensures a menu item has either a URL or a submenu, but never both
|
|
42
|
-
*/
|
|
43
|
-
export type MenuDto = MenuDtoWithUrl | MenuDtoWithSubmenu;
|
|
44
36
|
export {};
|